feat(site): per-ref views in the git panel - #29083
DanielleMaywood wants to merge 19 commits into
Conversation
700032c to
65cf1d9
Compare
65cf1d9 to
85cfa2a
Compare
85cfa2a to
87b43c0
Compare
87b43c0 to
aeceffa
Compare
aeceffa to
b9af2b3
Compare
Docs previewCheck off each page once it's been reviewed. If a page changes in a later push, its checkbox clears automatically so it gets a fresh look. Pages not yet wired into the docs navigation aren't listed here. |
b9af2b3 to
7f4cecc
Compare
4fe2414 to
8533fe8
Compare
b3077f7 to
d0cddef
Compare
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d0cddeffbc
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
f3c50c4 to
d18f7a4
Compare
Replace the per-file PR status factories in the multi-PR tests and stories with a MockChatDiffStatus fixture and a spread factory in testHelpers, following the shared Mock* convention. Branch-only fixtures now clear the PR fields explicitly, since the shared base represents a full PR.
Stop deriving PR display metadata from diff_statuses[0]. The search results render the shared PR icon component and pair line stats with the sole PR only. The multi-PR sidebar badge and the top bar trigger show the PR count with a neutral glyph, and the PR tab applies only when the chat tracks exactly one pull request. Remove the prIcon and diffStatus picks from the chat display config; the tree already consumed only the full PR list.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7fd9d0f8f
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The PR filter closure between hook calls disabled memoization for the panel handlers, so the compiler check failed. Hoist the PR predicate to module scope and derive the sole PR after the hooks. Also unexport the unused MockChatDiffStatus fixture constant.
The watch merge now inserts the event's embedded primary when the cache lacks that row, so a client that missed the primary's push no longer keeps an older ref at the head of the list. A cached row always wins over the embedded snapshot, which can be older by delivery delay. Populate diff_statuses in the chat page story fixtures, which still seeded only the deprecated field, and assert the first arriving ref drives the git panel's default diff fetch.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 618248c436
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Unify the diff-status merge into a single map path so the embedded primary is adopted and promoted even when the cache is empty. The tombstone removal runs after the adoption, so a removed primary cannot re-enter through the embedded snapshot. Add pull_request_state to the diff-stat story fixtures, which the PR filter requires, so the stories cover the counters again.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7dcdd13653
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 25eedf469c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: e8b55e58ca
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8e13faf8a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 76ed8669b7
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| // The title row must carry the selected PR's title, not the | ||
| // branch-only primary's. | ||
| screen.getByText("fix: second change"); |
There was a problem hiding this comment.
Move the selected-title presence check to Storybook
This test ends with a throwing getByText lookup, so its only outcome is that the selected title exists in the DOM. The branch-primary/older-PR state is visual coverage and should be captured in a Storybook story; keep Vitest focused on the already-covered ref-specific API request or another non-visual outcome.
AGENTS.md reference: site/AGENTS.md:L7-L7
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 42b57ea11e. The presence test is removed. The branch-primary state moves to a new BranchPrimarySelectedPr story whose play selects the older PR, so Pixel captures the title row following the selection. The title row has no role or accessible name, so no compliant Vitest query can target it.
| <span className="truncate"> | ||
| {status.pull_request_title || | ||
| (number ? `#${number}` : "PR")} |
There was a problem hiding this comment.
Include PR numbers in multi-PR menu labels
When two tracked PRs share the same title, which is common for repeated fixes or dependency updates, both menu items render with identical visible and accessible names because the unique PR number is used only as a fallback. Users cannot determine which PR each item opens; include the number alongside the title so every action is distinguishable.
AGENTS.md reference: site/AGENTS.md:L12-L12
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 42b57ea11e. Every menu item now renders PR #<number> <title>, matching the sidebar popover and the Git view switcher. The number is always present because branch-only rows are filtered out before classification. The selection test queries by the full name, and a new regression test selects by number alone when two PRs share a title.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 42b57ea11e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| } else if (hasGitContext) { | ||
| title = "No pushed changes yet"; | ||
| body = "Once commits are pushed, the branch diff will appear here."; | ||
| } else if (hasPullRequest) { |
There was a problem hiding this comment.
Prioritize the PR-only empty state
When prTab exists but remoteDiffStats has no row, showRemoteTab makes hasGitContext unconditionally true, while it also makes the passed isGitStatusLoading false. Fresh evidence beyond the earlier resolved empty-state thread is that this ordering therefore makes the following hasPullRequest branch unreachable, so a chat with a known PR always shows the misleading “No pushed changes yet” state instead of the dedicated pending-PR state. Check hasPullRequest before the generic Git-context branch and derive loading independently.
AGENTS.md reference: site/AGENTS.md:L11-L11
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 2697edb539. Both halves: RemoteContent now checks hasPullRequest before the generic Git-context branch, so a known PR with no status row shows the pending-PR state, and the panel passes the raw watcher isGitStatusLoading flag instead of the collapsed derivation that could never be true when a PR was known. Precedence is now loading, then pending PR, then generic no-changes. The EmptyState story screenshots the pending-PR state, and the settle test exercises both flags uncollapsed.
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2697edb539
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| expect(link).toHaveAttribute( | ||
| "href", | ||
| "https://github.com/coder/coder/pull/123", | ||
| ); |
There was a problem hiding this comment.
Replace attribute-only link assertions
These new single-PR tests, including the similar checks in the no-PR and branch-only cases, end by asserting only the rendered href. FE1 explicitly prohibits attribute-presence assertions because they duplicate visual DOM coverage rather than exercising a non-visual outcome; keep these states in Storybook and retain a Vitest only if it drives an interaction and verifies navigation or another observable behavior.
AGENTS.md reference: site/AGENTS.md:L7-L7
Useful? React with 👍 / 👎.
Summary
The git panel now shows one view per tracked ref. Selecting a ref loads that ref's diff. This is part 3 of 3, stacked on the API change in part 2.
Fix
diff_statuses. Each entry shows the PR state and number, or the branch name when no PR exists.originandbranchselector. The diff body, PR title, and stats all follow the selection. A selection that resolves to nothing falls back to the newest ref.changed_diff_statusevent updates only its own entry, so the other refs' cached statuses survive.Notes for review
diff_status, the primary the server picks. It does not pick the primary on the client, so the two can never disagree.Generated by Coder Agents.