Repository navigation
feat(site): list every PR in the top bar - #29545
Conversation
93e1f92 to
7a39cea
Compare
1267e42 to
adc79ca
Compare
adc79ca to
2acee22
Compare
2acee22 to
055f2a7
Compare
055f2a7 to
1425293
Compare
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: 14252937a9
ℹ️ 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".
| onSelect={() => { | ||
| if (status.url) { | ||
| window.open(status.url, "_blank", "noreferrer"); | ||
| } |
There was a problem hiding this comment.
Use anchors for the PR menu entries
When a chat has multiple PRs, these rows are generic Radix menu items that call window.open instead of links. Users consequently lose standard link behaviors such as inspecting or copying the destination and using the browser's context menu or middle-click, while assistive technology cannot expose the destination as a link. Render each DropdownMenuItem with asChild around an <a href={status.url} target="_blank" rel="noreferrer">, matching existing dropdown links in the repository.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 68e2a11. Each entry is now <DropdownMenuItem asChild> around <a href={status.url} target="_blank" rel="noreferrer"> holding the existing icon and label, matching the repo's other dropdown links. The onSelect/window.open path is gone, so middle-click, copy-link, and the context menu work and assistive tech gets the destination. The test now asserts each menuitem carries its PR's href.
Generated by Coder Agents
| // The PR chip in the top bar. On mobile it shows the number, on | ||
| // desktop the title. |
There was a problem hiding this comment.
Remove the comment that restates PrLink
This comment only repeats the component's name and narrates the two responsive spans immediately below it, without documenting a non-obvious constraint or tradeoff. Remove it to comply with FE4's prohibition on comments that restate identifiers or control flow.
AGENTS.md reference: site/AGENTS.md:L10-L10
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 68e2a11. The PrLink comment is removed. The larger JSX block comment above the PR-link section was also narration under the same rule, except for one line: it kept only the sidebar-panel hiding constraint (hidden on desktop while the panel is open), which is the non-obvious part behind the lg:hidden classes.
Generated by Coder Agents
1425293 to
50e8b0a
Compare
50e8b0a to
bc7742d
Compare
7c4e854 to
38d6d3a
Compare
38d6d3a to
c02bba6
Compare
c02bba6 to
e4b4e1e
Compare
d6aed39 to
06ad63d
Compare
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 68e2a11c62
ℹ️ 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".
| // destination is announced. | ||
| expect( | ||
| within(menu).getByRole("menuitem", { name: /PR #123/ }), | ||
| ).toHaveAttribute("href", "https://github.com/coder/coder/pull/123"); |
There was a problem hiding this comment.
Replace href assertions with observable behavior coverage
This new test uses toHaveAttribute as its only outcome, so it verifies rendered DOM rather than an observable callback, request, or state change. FE1 requires userEvent-driven tests to assert the non-visual effect of the interaction; exercise the selected entry and assert its navigation effect instead of inspecting href.
AGENTS.md reference: site/AGENTS.md:L7-L7
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Keeping the assertion. The href value is the entire behavioral contract of an external target="_blank" anchor: jsdom implements no navigation, so there is no callback, request, or state change to assert instead. The query is semantic (getByRole("menuitem", { name: /PR #123/ })) and the assertion is value-bearing, not DOM presence. This matches existing repo practice, such as the skip-link destination in DashboardLayout.test.tsx.
This reply was generated by Coder Agents.
| }; | ||
|
|
||
| const mockPRStatuses = [ | ||
| { |
There was a problem hiding this comment.
Compose the story statuses from the shared fixture
This story re-declares complete ChatDiffStatus entities even though MockChatDiffStatus already exists in testHelpers/chatEntities; these copies can silently drift when the generated API shape or standard fixture changes. Import the shared fixture and create the two named variants by spreading it, as required by FE9.
AGENTS.md reference: site/AGENTS.md:L15-L15
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Leaving these shapes as they are. The single-PR story rows are pre-stack data carried over unchanged: they mirror rows written before pr_number (migration 000437) and pull_request_state backfills existed, which is why the component recovers the number from the URL (prNumber falls back to parsePullRequestUrl). Spreading MockChatDiffStatus would inject pr_number, remote_origin, and state: "open", switching those stories onto the modern-row path and dropping the URL-fallback coverage. mockPRStatuses is a named local variant under FE9; both rows differ from the shared fixture.
This reply was generated by Coder Agents.
| {/* The number keeps every item distinguishable when | ||
| two PRs share a title. */} | ||
| <span className="truncate"> | ||
| {`PR #${prNumber(status)} ${status.pull_request_title}`} |
There was a problem hiding this comment.
Include the repository in cross-origin PR labels
When a chat tracks repositories with the same PR number and title, both menu entries receive the identical visible and accessible label even though they open different URLs, so users cannot tell which repository they are selecting. Multiple origins are a supported state and GitPanel already detects it and prefixes originRepoLabel; apply the same distinction here.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in f1f3fa9. originRepoLabel moved to site/src/pages/AgentsPage/utils/ and is shared with the git panel. The top bar menu now prefixes each entry with the repository name when the tracked PRs span multiple origins, so two origins carrying the same PR number stay distinguishable by accessible name. Covered by a test with two origins sharing PR #123 and a WithCrossOriginPRs screenshot state.
This reply was generated by Coder Agents.
bf514bf to
4469e78
Compare
f1f3fa9 to
96fbdeb
Compare
|
This pull request was merged after its branch was accidentally flattened, so the merged diff does not contain the changes. The same work now lives in #29831. Coder Agents generated this comment. |
Part 5 of 6. Depends on #29544.
The top bar PR chip now reads
diff_statusesinstead of the single primary. With one PR it stays a direct link. With several it shows "N PRs" and opens a menu with one link per PR, showing its state, number and title. When the PRs span multiple origins, each entry is prefixed withowner/reposo equal PR numbers stay distinct. Refs without a PR number (branch-only refs) are left out.originRepoLabelmoves from the git panel toutils/originRepoLabel.tsso both places share it.Generated by Coder Agents.