Conversation
There was a problem hiding this comment.
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(); |
There was a problem hiding this comment.
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).
| const panel = this.getActivePanel(); | |
| const panel = this.currentPanel ?? this.getActivePanel(); |
Part of #3058