Skip to content

Conversation

@roomote
Copy link
Contributor

@roomote roomote bot commented Jan 21, 2026

Summary

This PR attempts to address Issue #10855 by implementing a two-phase UX for file editing operations, as suggested by @Jerrill:

  1. Immediately show "Roo is preparing to edit a file..." when a file edit starts
  2. Update to "Roo wants to edit this file" with the actual filename once the path has stabilized

Problem

File paths arrive character-by-character during streaming. Previously, the UI waited for path stabilization before displaying anything, which caused the appearance of a frozen/stuck UI for several seconds.

Solution

  • Send an initial "preparing" message with path: undefined immediately when a file edit tool starts
  • The frontend detects !tool.path and shows the "preparing" message
  • Once the path stabilizes, the full message with the filename is sent and displayed

Changes

Backend (src/core/tools/)

  • Added hasSentInitialMessage flag to BaseTool.ts to track initial message state
  • Modified file editing tools to send initial message before path stabilizes:
    • ApplyDiffTool.ts
    • EditFileTool.ts
    • WriteToFileTool.ts
    • SearchAndReplaceTool.ts
    • SearchReplaceTool.ts

Frontend (webview-ui/)

  • Updated ChatRow.tsx to show "Roo is preparing to edit a file..." when tool.path is undefined
  • Updated CodeAccordian.tsx to show "Loading file..." placeholder when path is undefined
  • Added preparingToEdit translation string to all 18 locale files

Tests

  • Updated writeToFileTool.spec.ts to reflect new behavior

Testing

  • All 400 backend tests pass
  • All 1109 frontend tests pass
  • Type checking passes for all packages

Related Issue

Closes #10855

Feedback and guidance are welcome!


Important

Introduces a two-phase message system for file editing operations to provide immediate user feedback, with backend and frontend updates to support this behavior.

  • Behavior:
    • Implements a two-phase message system for file editing operations.
    • Shows "Roo is preparing to edit a file..." immediately when editing starts, updating to "Roo wants to edit this file" once the path stabilizes.
  • Backend:
    • Adds hasSentInitialMessage flag in BaseTool.ts to track message state.
    • Updates ApplyDiffTool.ts, EditFileTool.ts, and WriteToFileTool.ts to send initial messages before path stabilization.
  • Frontend:
    • Modifies ChatRow.tsx and CodeAccordian.tsx to display "preparing" messages when tool.path is undefined.
    • Adds preparingToEdit translation string to 18 locale files.
  • Tests:
    • Updates writeToFileTool.spec.ts to test new behavior.
  • Misc:

This description was created by Ellipsis for 5979bda. You can customize this summary. It will automatically update as commits are pushed.

This change implements a two-phase UX for file editing operations:
1. Show "Roo is preparing to edit a file..." immediately when a file edit starts
2. Update to "Roo wants to edit this file" with the actual filename once path stabilizes

The issue was that file paths arrive character-by-character during streaming, and
the UI waited for path stabilization before showing anything, creating the appearance
of a frozen UI.

Changes:
- Added preparingToEdit translation string to all 18 locale files
- Modified ChatRow.tsx to show preparing message when tool.path is undefined
- Updated CodeAccordian.tsx to show loading placeholder for undefined paths
- Added hasSentInitialMessage flag to BaseTool.ts
- Updated ApplyDiffTool, EditFileTool, WriteToFileTool, SearchAndReplaceTool,
  and SearchReplaceTool to send initial "preparing" message immediately
- Updated writeToFileTool test to reflect new behavior

Addresses issue #10855
@roomote
Copy link
Contributor Author

roomote bot commented Jan 21, 2026

Rooviewer Clock   See task on Roo Cloud

Review complete. Found 1 issue that needs attention before merging.

  • Missing translations: The preparingToEdit string is not translated in 15 of 17 non-English locale files (es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, zh-TW). Only ca and de have proper translations.

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

"wantsToFetch": "Roo quiere obtener instrucciones detalladas para ayudar con la tarea actual"
},
"fileOperations": {
"preparingToEdit": "Roo is preparing to edit a file...",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The preparingToEdit string is not actually translated in this file (and 14 other non-English locale files). It contains English text "Roo is preparing to edit a file..." instead of the Spanish translation. This affects: es, fr, hi, id, it, ja, ko, nl, pl, pt-BR, ru, tr, vi, zh-CN, and zh-TW. Only ca and de have proper translations. Non-English users will see English text for this message.

Fix it with Roo Code or mention @roomote and request a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

[BUG] Roo wants to edit this file doesn't finish rendering until file is written

2 participants