Skip to content

fix(web): reach every PR of a multi-repo thread - #299

Merged
LoganRupe merged 1 commit into
multi-repo-workspacesfrom
bug/multi-repo/per-repo-pull-requests
Sep 24, 2026
Merged

LoganRupe merged 1 commit into
multi-repo-workspacesfrom
bug/multi-repo/per-repo-pull-requests

Conversation

@LoganRupe

@LoganRupe LoganRupe commented Sep 24, 2026 •

Copy link
Copy Markdown
Owner

What Changed

  • PR badge (sidebar and composer): when a thread's +N badge stands for PRs in different repos, clicking it opens one right-panel tab per PR. The thread's current PR opens last, so its tab is the one showing. Hovering lists every PR with its number, title and state, instead of "PR [pull] main from pingdotgg:main #5 … and 1 more linked". Stacks still open the ordered Pull requests list. If none of the PRs match a project, the click falls back to that list. The tabs go through the same link resolver the Pull requests list uses (useOpenThreadPullRequestTabs in lib/openPullRequestLink.ts), and only the active tab loads its details.
  • Source Control popover: for an isolated run, each repo row reads the run's worktree instead of the original checkout (ChatView.tsx). The row is still labelled by repo name, not the worktree folder.
  • View PR: the header now passes the PR's URL along with its number, so a row for a non-primary repo opens that repo's PR. Before, it opened the same number in the primary repo.

Why

Fixes #298. Your agents already link each repo's PR, so the links were never missing. The badge still behaved like a link to one PR, and the header rows looked at checkouts that were on main. On a Max + Max_Workspace run, Max showed "Clean · Create PR" while Coldtap/Max#27 was open.

Verified: web typecheck is clean and ThreadStatusIndicators.test.ts passes. It covers the new count label and which badges open a list. In real dev builds of this branch and multi-repo-workspaces, I seeded the same two-repo isolated run with both PRs linked, and a scripted flow checked hover, click and popover on both builds. The Before build failed at the click and at the popover, and the After build passed. The fixture uses a local fake gh, so PR titles and details come from fixture data.

Limits: a PR only opens as a tab when it resolves to a project, which means the primary repo or any non-Azure host the project has a checkout on. Azure DevOps PRs in non-primary repos (MaxExternal, Max-Forms) fall back to the list. The Pull requests list resolves PRs the same way, so that limit is older than this change. The command palette, the legacy sidebar and mobile still show a single PR.

UI Changes

Before/after on a two-repo isolated run with a PR linked in each repo: hover the +2 badge, click it, open the other PR, then open Source Control.

compare.mp4

The +N PR badge in the sidebar and composer now opens a right-panel tab
per pull request when they are unrelated (one per repo, say), and lists
them all on hover. Stacks still open the ordered Pull requests list.

The multi-repo Source Control popover reads each repo's worktree for an
isolated run instead of the original checkout, so each row shows the
run's PR. View PR passes the PR's URL, so a non-primary repo row opens
its own repository's PR rather than the same number in the primary repo.

Fixes #298
Copilot AI lite review requested due to automatic review settings September 24, 2026 05:16
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L labels Sep 24, 2026
@LoganRupe
LoganRupe merged commit 6a262fb into multi-repo-workspaces Sep 24, 2026
8 of 18 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

ChatView must preserve Forgejo ports and correctly resolve or fall back for non-primary Azure PRs.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Updates multi-repository PR navigation and makes Source Control status worktree-aware.

Changes:

  • Opens linked PRs in separate tabs and improves badge tooltips.
  • Routes PR actions using repository-specific URLs.
  • Uses isolated worktrees for multi-repo status rows.
  • Adds coverage for multi-PR badge behavior.
File Summary
apps/​web/​src/​lib/​vcsStatusState.ts Exports repository display-name helper.
apps/​web/​src/​lib/​openPullRequestLink.ts Adds multi-PR tab opening logic.
apps/​web/​src/​components/​ThreadStatusIndicators.tsx Updates badge labels and tooltips.
apps/​web/​src/​components/​ThreadStatusIndicators.test.ts Tests multi-PR badge behavior.
apps/​web/​src/​components/​Sidebar.tsx Opens linked PR tabs from sidebar badges.
apps/​web/​src/​components/​GitActionsControl.tsx Passes PR URLs to handlers.
apps/​web/​src/​components/​ChatView.tsx Uses worktrees and repository-specific PR targets.
apps/​web/​src/​components/​chat/​MultiRepoGitControl.tsx Updates PR callback typing.
apps/​web/​src/​components/​chat/​ChatHeader.tsx Updates header callback typing.
apps/​web/​src/​components/​BranchToolbarBranchSelector.tsx Opens linked PR tabs from composer badges.

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

useRightPanelStore.getState().openPullRequest(activeThreadRef, {
projectId: activeProject.id,
repository: activeProjectRepository,
...(parsed ? { host: parsed.host } : {}),
LoganRupe added a commit that referenced this pull request Sep 24, 2026
The +N PR badge in the sidebar and composer now opens a right-panel tab
per pull request when they are unrelated (one per repo, say), and lists
them all on hover. Stacks still open the ordered Pull requests list.

The multi-repo Source Control popover reads each repo's worktree for an
isolated run instead of the original checkout, so each row shows the
run's PR. View PR passes the PR's URL, so a non-primary repo row opens
its own repository's PR rather than the same number in the primary repo.

Fixes #298

Co-authored-by: Logan Rupe <logzerroneous@gmail.com>
LoganRupe added a commit that referenced this pull request Sep 26, 2026
The +N PR badge in the sidebar and composer now opens a right-panel tab
per pull request when they are unrelated (one per repo, say), and lists
them all on hover. Stacks still open the ordered Pull requests list.

The multi-repo Source Control popover reads each repo's worktree for an
isolated run instead of the original checkout, so each row shows the
run's PR. View PR passes the PR's URL, so a non-primary repo row opens
its own repository's PR rather than the same number in the primary repo.

Fixes #298

Co-authored-by: Logan Rupe <logzerroneous@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants