Skip to content

Remove external uses of current panel#8493

Merged
alexr00 merged 1 commit intomainfrom
alexr00/wooden-marmoset
Feb 9, 2026
Merged

Remove external uses of current panel#8493
alexr00 merged 1 commit intomainfrom
alexr00/wooden-marmoset

Conversation

@alexr00
Copy link
Copy Markdown
Member

@alexr00 alexr00 commented Feb 9, 2026

Part of #3058

Copilot AI review requested due to automatic review settings February 9, 2026 11:26
@alexr00 alexr00 enabled auto-merge (squash) February 9, 2026 11:26
@alexr00 alexr00 self-assigned this Feb 9, 2026
@vs-code-engineering vs-code-engineering Bot added this to the February 2026 milestone Feb 9, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Refactors PR/issue overview panel interactions to avoid relying on the singleton currentPanel, as groundwork for supporting multiple PR description editors (per #3058).

Changes:

  • Update “scroll to pending review” behavior to target a specific PR by identity instead of using a global panel.
  • Introduce getActivePanel() and switch chat context/tools/commands to use the active (focused) overview panel.
  • Add instance method scrollToPendingReview() and adjust commands to call instance methods on the active panel.

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/view/reviewCommentController.ts Scroll-to-review now targets the active PR identity instead of the global panel.
src/view/pullRequestCommentController.ts Scroll-to-review now passes PR identity (owner/repo/number).
src/lm/tools/openPullRequestTool.ts Uses active PR overview panel rather than currentPanel.
src/lm/pullRequestContextProvider.ts Pulls PR chat context from the active PR overview panel.
src/lm/issueContextProvider.ts Pulls issue chat context from the active issue overview panel.
src/github/pullRequestOverview.ts Adds identity-based panel lookup for scrolling; adds getActivePanel() and instance scroll method; updates refresh behavior.
src/github/issueOverview.ts Adds getActivePanel() helper for focused issue/PR panel detection.
src/commands.ts Updates refresh/focus commands to operate on the active PR overview panel instance.

public static override refresh(): void {
if (this.currentPanel) {
this.currentPanel.refreshPanel();
const panel = this.getActivePanel();
Copy link

Copilot AI Feb 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PullRequestOverviewPanel.refresh() now only refreshes when the PR webview is the active editor (_panel.active). This changes behavior vs the previous currentPanel check and can make pr.refreshPullRequest (triggered from the tree view while focus is not on the webview) a no-op even when a PR description panel is open. Consider refreshing the matching panel regardless of focus (e.g., refresh currentPanel, or add a refresh(owner, repo, number) that uses findPanel).

Suggested change
const panel = this.getActivePanel();
const panel = this.currentPanel ?? this.getActivePanel();

Copilot uses AI. Check for mistakes.
Comment thread src/github/pullRequestOverview.ts
Comment thread src/github/issueOverview.ts
@alexr00 alexr00 merged commit 38c83e8 into main Feb 9, 2026
12 checks passed
@alexr00 alexr00 deleted the alexr00/wooden-marmoset branch February 9, 2026 11:42
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.

3 participants