Skip to content

Conversation

roomote[bot]
Copy link

@roomote roomote bot commented Jul 18, 2025

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 in src/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

  • Enhanced focusPanel function: Added logic to detect multi-window scenarios before automatically opening the sidebar
  • Added shouldAllowSidebarActivation helper: Determines if sidebar activation is appropriate based on:
    • Whether there's already a visible Roo Code instance
    • Whether the current window has active editors (indicating user activity)
    • Conservative approach to avoid disrupting workflow in other windows
  • Comprehensive test coverage: Added 8 test cases covering all scenarios including multi-window detection
  • Backward compatibility: Maintains existing behavior when appropriate, only prevents unwanted sidebar opening

Testing

  • Added comprehensive unit tests for focusPanel functionality (8 test cases)
  • Tests cover multi-window detection scenarios
  • Verified sidebar opens when expected (single window, visible instance)
  • Verified sidebar doesn't open inappropriately (multi-window scenarios)
  • Confirmed existing focus behavior for tab and sidebar panels works correctly

Files Changed

  • src/utils/focusPanel.ts - Enhanced with multi-window detection logic
  • src/utils/__tests__/focusPanel.test.ts - Added comprehensive test coverage

This 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.

  • Behavior:
    • Enhanced focusPanel in focusPanel.ts to prevent sidebar opening in multi-window VS Code setups.
    • Introduced shouldAllowSidebarActivation to check if sidebar activation is appropriate.
    • Maintains existing behavior when appropriate, only prevents unwanted sidebar opening.
  • Testing:
    • Added 8 test cases in focusPanel.test.ts for multi-window detection and sidebar activation logic.
    • Tests ensure sidebar opens correctly in single-window scenarios and does not open inappropriately in multi-window scenarios.
  • Files Changed:
    • focusPanel.ts - Enhanced with multi-window detection logic.
    • focusPanel.test.ts - Added comprehensive test coverage.

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

- Enhanced focusPanel function with multi-window detection logic
- Added shouldAllowSidebarActivation helper to determine if sidebar activation is appropriate
- Prevents unwanted sidebar opening when user is working in different VS Code windows
- Added comprehensive test coverage with 8 test cases
- Maintains backward compatibility for single-window scenarios
- Conservative approach to avoid disrupting workflow in other windows

Fixes #5485
@roomote roomote bot requested review from mrubens, cte and jr as code owners July 18, 2025 17:33
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Jul 18, 2025
@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jul 18, 2025
@daniel-lxs
Copy link
Collaborator

The issue doesn't have enough info, closing for now

@daniel-lxs daniel-lxs closed this Jul 19, 2025
@github-project-automation github-project-automation bot moved this from Triage to Done in Roo Code Roadmap Jul 19, 2025
@github-project-automation github-project-automation bot moved this from New to Done in Roo Code Roadmap Jul 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Roo Code opens its sidebar when open in another window
3 participants