-
Notifications
You must be signed in to change notification settings - Fork 2.8k
fix: add UI progress indicator for Background Editing file operations #10506
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…ools When the preventFocusDisruption (Background Editing) experiment is enabled, file writing operations now display a progress indicator (spinner) in the chat UI before file operations begin. This addresses Issue #10504 where users would see no visual feedback while Roo was preparing and writing files in the background, causing confusion about whether the app had frozen. Files updated: - WriteToFileTool.ts - ApplyDiffTool.ts - MultiApplyDiffTool.ts - SearchAndReplaceTool.ts - SearchReplaceTool.ts - EditFileTool.ts
Review completed. No issues found. The changes correctly add a progress indicator to the Background Editing feature by sending a partial message before file operations begin. The implementation is consistent across all 6 tool files and follows existing patterns in the codebase. Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues. |
lemiesz
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have an overall comment about swallowing errors in an empty catch block.
Is that considered okay in this repo?
| if (isPreventFocusDisruptionEnabled) { | ||
| // Show progress indicator in UI while preparing the file | ||
| const partialMessage = JSON.stringify(sharedMessageProps) | ||
| await task.ask("tool", partialMessage, true).catch(() => {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it okay to just swallow the error here?
| // Show progress indicator in UI while preparing the file when background editing is enabled | ||
| if (isPreventFocusDisruptionEnabled) { | ||
| const partialMessage = JSON.stringify(sharedMessageProps) | ||
| await task.ask("tool", partialMessage, true).catch(() => {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is it okay to swallow errors?
Related GitHub Issue
Closes: #10504
Description
This PR attempts to address Issue #10504 by adding a progress indicator (spinner) in the chat UI when the preventFocusDisruption (Background Editing) experimental feature is enabled.
Root Cause: When Background Editing is enabled, the file writing tools skip sending a partial message to the UI that would normally trigger a progress indicator. In the normal flow,
task.ask("tool", partialMessage, true)is called before showing the diff editor, which displays a loading spinner in the chat. When background editing is enabled, this step was skipped entirely.Solution: Added a partial message call (
task.ask("tool", partialMessage, true)) at the start of theisPreventFocusDisruptionEnabledcode path in all file edit tools. This displays the existingProgressIndicatorcomponent in the chat while the background file operation is in progress.Files modified:
src/core/tools/WriteToFileTool.tssrc/core/tools/ApplyDiffTool.tssrc/core/tools/MultiApplyDiffTool.tssrc/core/tools/SearchAndReplaceTool.tssrc/core/tools/SearchReplaceTool.tssrc/core/tools/EditFileTool.tsTest Procedure
Automated Tests: All 326 existing tool tests pass. TypeScript compilation and ESLint checks pass.
Pre-Submission Checklist
Screenshots / Videos
N/A - The change uses the existing
ProgressIndicatorcomponent that is already displayed for partial messages.Documentation Updates
Additional Notes
Feedback and guidance are welcome. This is a minimal fix that adds the missing partial message calls to provide visual feedback during background file operations.
Get in Touch
Discord: @roomote