fix: show preparing message before file path stabilizes #10856
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR attempts to address Issue #10855 by implementing a two-phase UX for file editing operations, as suggested by @Jerrill:
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
path: undefinedimmediately when a file edit tool starts!tool.pathand shows the "preparing" messageChanges
Backend (src/core/tools/)
hasSentInitialMessageflag toBaseTool.tsto track initial message stateApplyDiffTool.tsEditFileTool.tsWriteToFileTool.tsSearchAndReplaceTool.tsSearchReplaceTool.tsFrontend (webview-ui/)
ChatRow.tsxto show "Roo is preparing to edit a file..." whentool.pathis undefinedCodeAccordian.tsxto show "Loading file..." placeholder when path is undefinedpreparingToEdittranslation string to all 18 locale filesTests
writeToFileTool.spec.tsto reflect new behaviorTesting
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.
hasSentInitialMessageflag inBaseTool.tsto track message state.ApplyDiffTool.ts,EditFileTool.ts, andWriteToFileTool.tsto send initial messages before path stabilization.ChatRow.tsxandCodeAccordian.tsxto display "preparing" messages whentool.pathis undefined.preparingToEdittranslation string to 18 locale files.writeToFileTool.spec.tsto test new behavior.Roo wants to edit this filedoesn't finish rendering until file is written #10855.This description was created by
for 5979bda. You can customize this summary. It will automatically update as commits are pushed.