#4199 split screen diff error fix#4385
Closed
Mnehmos wants to merge 1 commit intoRooCodeInc:mainfrom
Mnehmos:#4199-split-screen-diff-error
Closed
#4199 split screen diff error fix#4385Mnehmos wants to merge 1 commit intoRooCodeInc:mainfrom Mnehmos:#4199-split-screen-diff-error
Mnehmos wants to merge 1 commit intoRooCodeInc:mainfrom
Mnehmos:#4199-split-screen-diff-error
Conversation
24 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Related GitHub Issue
Closes: #4199
Description
This PR addresses GitHub Issue #4199, where Roo Code failed to reliably detect the activation of the diff editor when its webview panel was moved to an auxiliary VS Code window (e.g., on a separate monitor). This resulted in a timeout and the error "Failed to open diff editor, please try again...".
The primary fix involves a more robust detection mechanism within
src/integrations/editor/DiffViewProvider.ts:vscode.diffcommand is executed, the code now immediately iterates through allvscode.window.tabGroups.allto find the newly opened diff editor. This allows for detection across all VS Code windows, including auxiliary ones.vscode.window.tabGroups.onDidChangeTabGroupshas been added. This event is triggered when tabs are moved between windows or new windows are opened, providing a more reliable signal for detecting the diff editor's appearance in multi-window setups.vscode.window.showTextDocumentis used to obtain theTextEditorinstance and resolve the promise, confirming activation.A subsequent commit in this PR also addresses an ESLint warning (
no-async-promise-executor) that was present insrc/integrations/editor/DiffViewProvider.ts. The Promise executor was refactored using an IIFE (Immediately Invoked Function Expression) to comply with the linting rule while preserving the asynchronous logic required for diff detection.Test Procedure
Manual Verification (Essential for the core bug fix):
apply_diffon an existing file, orwrite_to_fileif it would trigger a diff for an existing file).Linting Verification:
pnpm lint(or the project's equivalent linting command) to confirm that theno-async-promise-executorwarning insrc/integrations/editor/DiffViewProvider.tsis resolved. This was confirmed during development.Automated tests for the specific multi-monitor, auxiliary window interaction are complex to implement and are not included in this PR.
Type of Change
srcor test files.Pre-Submission Checklist
npm run lint).console.log) used during development of this fix has been reviewed and necessary diagnostic logs are retained as per the scope.npm test). (Linting passes; core functionality requires manual verification as outlined).mainbranch. (User should ensure this before merging).npm run changesetif this PR includes user-facing changes or dependency updates. (This is a user-facing bug fix, so a changeset is recommended).Screenshots / Videos
N/A (This is a functional fix related to editor event detection, not a UI change).
Documentation Updates
Additional Notes
The fix was implemented in two stages:
Get in Touch
Important
Fixes diff editor detection in
DiffViewProviderfor multi-window setups and resolves ESLint warning.DiffViewProviderwhen moved to auxiliary VS Code windows.DiffViewProviderusing an IIFE to resolveno-async-promise-executorESLint warning.This description was created by
for 411d95e. You can customize this summary. It will automatically update as commits are pushed.