Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 23, 2026

In multi-repo workspaces, the PR status bar item remained static when switching between repositories via the Source Control view.

Uses the git extension API's RepositoryUIState interface (repository.ui.selected and repository.ui.onDidChange) to track selection changes and update status bar visibility accordingly.

Changes

ReviewManager (PR status bar):

  • Track _isRepositorySelected state, initialized from repository.ui.selected
  • Subscribe to repository.ui.onDidChange to detect selection changes
  • Gate all statusBarItem.show() calls on selection state

StateManager (Issues status bar):

  • Filter currentIssues() to only include issues from selected repositories
  • Subscribe to repository.ui.onDidChange to refresh status bar on selection change
// Example: listening for repository selection changes
this._register(this._repository.ui.onDidChange(() => {
    this._isRepositorySelected = this._repository.ui.selected;
    this.updateStatusBarVisibility();
}));

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • update.code.visualstudio.com
    • Triggering command: /opt/hostedtoolcache/node/20.20.0/x64/bin/node node ./out/src/test/runTests.js (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>PR extension doesn't honor swapping between repositories</issue_title>
<issue_description>Testing microsoft/vscode#274788

It would be cool if the PR extension knew when I swapped between repos.

This status bar icon stayed the same regardless of which repo i chose

Image</issue_description>

<agent_instructions>The git extension API has a RepositoryUIState interface, with an onDidChange. Use this to watch for changes, and show the appropriate status bar item based on the selected repo</agent_instructions>

Comments on the Issue (you are @copilot in this section)

@lszomoru Adding @alexr00. I think that this should be possible, but please let me know if you are missing any git extension API.

💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI and others added 2 commits January 23, 2026 17:27
Listen to repository.ui.onDidChange event to track when the user
switches between repositories. The PR status bar item and issue
status bar item now show only when their respective repository
is selected in the VS Code UI.

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
- Use definite assignment assertion for _isRepositorySelected field
- Update updateStatusBarVisibility to also handle switching state

Co-authored-by: alexr00 <38270282+alexr00@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix PR extension to update status bar when swapping repositories Honor repository selection for PR and issue status bars Jan 23, 2026
Copilot AI requested a review from alexr00 January 23, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PR extension doesn't honor swapping between repositories

2 participants