Skip to content

Improve PR stack refreshing - #9021

Merged
Alex Ross (alexr00) merged 3 commits into
mainfrom
alexr00/spotless-buzzard
Oct 7, 2026
Merged

Alex Ross (alexr00) merged 3 commits into
mainfrom
alexr00/spotless-buzzard

Conversation

@alexr00

@alexr00 Alex Ross (alexr00) commented Oct 6, 2026 •

Copy link
Copy Markdown
Member

Fixes #9020
Fixes #9015
Fixes #9014

@alexr00 Alex Ross (alexr00) self-assigned this Oct 6, 2026
@alexr00
Alex Ross (alexr00) marked this pull request as ready for review October 7, 2026 15:20
Copilot AI balanced review requested due to automatic review settings October 7, 2026 15:20

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Instance-scoped notifications miss cross-folder mutations, and dissolved stacks can retain stale merge-queue state.

2 open findings
What changed in this PR

Improves automatic stacked-PR overview refreshes after membership or PR-state changes.

Changes:

  • Adds repository stack-change notifications and detailed PR change events.
  • Coalesces and serializes stack refreshes, including hidden panels.
  • Expands tests for refresh races, failures, and stack mutations.
File Description
src/​github/​githubRepository.ts Emits stack mutation events.
src/​github/​issueModel.ts Extends change-event fields.
src/​github/​pullRequestModel.ts Detects stack-relevant PR changes.
src/​github/​pullRequestOverview.ts Implements event-driven stack refreshes.
src/​view/​prsTreeDataProvider.ts Relies on repository notifications.
src/​test/​github/​createPRViewProvider.test.ts Tests creation-time stack updates.
src/​test/​github/​pullRequestModel.test.ts Tests events and mutation responses.
src/​test/​github/​pullRequestOverview.test.ts Tests refresh behavior and races.
src/​test/​view/​prsTree.test.ts Tests tree-driven stack additions.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/github/githubRepository.ts
Comment thread src/github/pullRequestOverview.ts Outdated
@alexr00
Alex Ross (alexr00) marked this pull request as draft October 7, 2026 15:35
@alexr00
Alex Ross (alexr00) marked this pull request as ready for review October 7, 2026 15:46
Copilot AI balanced review requested due to automatic review settings October 7, 2026 15:46
@alexr00
Alex Ross (alexr00) enabled auto-merge (squash) October 7, 2026 15:46

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Repository-instance-local notifications can leave panels stale in multi-root or worktree setups.

0 open findings

2 resolved since last review
Previously missed (1)

In code that hasn't changed since last review

Medium severity Panel misses stack updates from other workspace folders

src/​github/​pullRequestOverview.ts:350

This subscription is scoped to this panel's GitHubRepository instance. In a multi-root/worktree workspace, each FolderRepositoryManager can create a separate instance for the same owner/repository (folderRepositoryManager.ts:3059-3063), while the overview panel is shared by owner/repository/PR. A stack mutation initiated from another folder therefore fires only on that other instance and this open panel remains stale, unlike the removed panel-wide refresh. Please route stack-change notifications through a repository-manager-wide event (keyed by owner/repository) or otherwise broadcast them to matching open panels.

🧠 Review effort: Balanced

@alexr00
Alex Ross (alexr00) merged commit f3a6927 into main Oct 7, 2026
7 checks passed
@alexr00
Alex Ross (alexr00) deleted the alexr00/spotless-buzzard branch October 7, 2026 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants