Skip to content

feat(site): list every PR in the top bar - #29545

Merged
DanielleMaywood merged 0 commit into
feat/chat-diff-ref-gitpanelfrom
feat/chat-diff-ref-topbar
Sep 23, 2026
Merged

DanielleMaywood merged 0 commit into
feat/chat-diff-ref-gitpanelfrom
feat/chat-diff-ref-topbar

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

Part 5 of 6. Depends on #29544.

The top bar PR chip now reads diff_statuses instead 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 with owner/repo so equal PR numbers stay distinct. Refs without a PR number (branch-only refs) are left out.

originRepoLabel moves from the git panel to utils/originRepoLabel.ts so both places share it.

Generated by Coder Agents.

@DanielleMaywood DanielleMaywood added the experimental Changes that might not necessarily be merged, until its approved to proceed with. label Sep 18, 2026
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-topbar branch 2 times, most recently from 93e1f92 to 7a39cea Compare September 18, 2026 12:14
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-topbar branch 2 times, most recently from 1267e42 to adc79ca Compare September 18, 2026 15:03
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-topbar branch from adc79ca to 2acee22 Compare September 18, 2026 15:30
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-topbar branch from 2acee22 to 055f2a7 Compare September 21, 2026 08:34
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-topbar branch from 055f2a7 to 1425293 Compare September 21, 2026 10:35
@DanielleMaywood DanielleMaywood removed the experimental Changes that might not necessarily be merged, until its approved to proceed with. label Sep 21, 2026
@DanielleMaywood
DanielleMaywood marked this pull request as ready for review September 21, 2026 10:59
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 21, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T08:59:34.324764Z 68e2a11 Manual request
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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".

Comment on lines +332 to +335
onSelect={() => {
if (status.url) {
window.open(status.url, "_blank", "noreferrer");
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

Comment on lines +394 to +395
// The PR chip in the top bar. On mobile it shows the number, on
// desktop the title.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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

@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-topbar branch from 1425293 to 50e8b0a Compare September 21, 2026 12:18
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-topbar branch from 50e8b0a to bc7742d Compare September 21, 2026 12:38
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-topbar branch 2 times, most recently from 7c4e854 to 38d6d3a Compare September 21, 2026 16:19
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-topbar branch from 38d6d3a to c02bba6 Compare September 22, 2026 08:22
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-topbar branch from c02bba6 to e4b4e1e Compare September 22, 2026 08:54
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-topbar branch 3 times, most recently from d6aed39 to 06ad63d Compare September 22, 2026 11:29
@DanielleMaywood

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 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");

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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 = [
{

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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}`}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge 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 👍 / 👎.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

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.

@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-topbar branch 2 times, most recently from bf514bf to 4469e78 Compare September 23, 2026 11:19
@linear-code

linear-code Bot commented Sep 23, 2026

Copy link
Copy Markdown

CODAGT-990

@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-topbar branch from f1f3fa9 to 96fbdeb Compare September 23, 2026 17:52
@DanielleMaywood
DanielleMaywood merged commit 96fbdeb into main Sep 23, 2026
@DanielleMaywood
DanielleMaywood deleted the feat/chat-diff-ref-topbar branch September 23, 2026 17:52
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 23, 2026
@DanielleMaywood

Copy link
Copy Markdown
Collaborator Author

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant