fix: prevent sidebar opening in multi-window VS Code setups (#5485) #5906
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.
Fixes #5485
This PR resolves the issue where Roo Code's sidebar would automatically open when the extension is used in another VS Code window, disrupting the user's workflow in multi-window setups.
Root Cause
The issue was in the
focusPanel
utility function at line 18-19 insrc/utils/focusPanel.ts
. When no panel was available, it would automatically execute a command to open the sidebar without considering multi-window scenarios.Changes Made
focusPanel
function: Added logic to detect multi-window scenarios before automatically opening the sidebarshouldAllowSidebarActivation
helper: Determines if sidebar activation is appropriate based on:Testing
focusPanel
functionality (8 test cases)Files Changed
src/utils/focusPanel.ts
- Enhanced with multi-window detection logicsrc/utils/__tests__/focusPanel.test.ts
- Added comprehensive test coverageThis fix significantly improves the user experience for multi-window VS Code users while maintaining backward compatibility.
Important
Enhances
focusPanel
to prevent unwanted sidebar opening in multi-window VS Code setups with new detection logic and tests.focusPanel
infocusPanel.ts
to prevent sidebar opening in multi-window VS Code setups.shouldAllowSidebarActivation
to check if sidebar activation is appropriate.focusPanel.test.ts
for multi-window detection and sidebar activation logic.focusPanel.ts
- Enhanced with multi-window detection logic.focusPanel.test.ts
- Added comprehensive test coverage.This description was created by
for 40741bb. You can customize this summary. It will automatically update as commits are pushed.