Skip to content

feat(site): per-ref views in the git panel - #29083

Closed
DanielleMaywood wants to merge 4 commits into
feat/chat-diff-ref-apifrom
feat/chat-diff-ref-ui
Closed

DanielleMaywood wants to merge 4 commits into
feat/chat-diff-ref-apifrom
feat/chat-diff-ref-ui

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

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

  • The view switcher lists one entry per ref from diff_statuses. Each entry shows the PR state and number, or the branch name when no PR exists.
  • Selecting an entry fetches that ref's diff with its origin and branch selector. The diff body, PR title, and stats all follow the selection. A selection that resolves to nothing falls back to the newest ref.
  • The watch merge keys statuses by ref. A changed_diff_status event updates only its own entry, so the other refs' cached statuses survive.
  • The diff contents query key includes the ref, so each ref caches its own diff.

Notes for review

  • The top bar pill reads 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.

@DanielleMaywood DanielleMaywood added the experimental Changes that might not necessarily be merged, until its approved to proceed with. label Sep 8, 2026
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-api branch 2 times, most recently from 064d2a7 to f7f3b28 Compare September 8, 2026 13:40
@github-actions

Copy link
Copy Markdown
Contributor

Docs preview

Check 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.

@DanielleMaywood

Copy link
Copy Markdown
Collaborator Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 11, 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-17T10:04:58.137834Z 2697edb 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: 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".

Comment thread site/src/api/queries/chats.ts Resolved
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-api branch 2 times, most recently from 4c58154 to e81202d Compare September 15, 2026 11:12
@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: 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".

Comment thread site/src/api/queries/chats.ts Resolved
@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: 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".

Comment thread site/src/api/queries/chats.ts Resolved
@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: 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".

Comment thread site/src/api/queries/chats.ts Resolved
@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: 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".

@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: 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".

@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: 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".

@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: 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");

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

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

Comment on lines +343 to +345
<span className="truncate">
{status.pull_request_title ||
(number ? `#${number}` : "PR")}

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

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

@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: 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".

Comment on lines +653 to +656
} else if (hasGitContext) {
title = "No pushed changes yet";
body = "Once commits are pushed, the branch diff will appear here.";
} else if (hasPullRequest) {

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

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

@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: 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".

The chat diff client and query cache now track every ref the chat
follows, not only the primary. The GET diff client accepts a ref
selector. The diff-contents query key includes the ref, so each ref
keeps its own cache entry. The watch merge keys rows by ref, so a
changed row for one ref leaves the other refs' rows intact, and a
tombstone row removes its ref. The diff-contents invalidation
prefix-matches every ref.
The git panel now shows one view per tracked ref. Selecting a ref
loads that ref's diff. A chat tracks one status row per ref, and the
first row is the primary.

The view switcher lists one entry per ref from diff_statuses. Each
entry shows the PR state and number, or the branch name when no PR
exists. Selecting an entry fetches that ref's diff with its origin
and branch selector. The diff body, PR title, and stats follow the
selection. A selection that resolves to nothing falls back to the
newest ref. The inline comment box resets when the ref switches, so
a comment draft cannot leak from one PR into another.
The top bar PR chip now follows the full PR list. One PR stays a
direct link. Several PRs open a menu with one link per PR; the menu
item shows the PR number, so two PRs that share a title stay
distinguishable. Rows that do not point to a PR stay out of the
list.
The sidebar and the search results now follow the full PR list. A
chat with one PR shows that PR's state icon and line stats. A chat
with several PRs shows the PR count instead; one state icon cannot
represent the others. Hovering the icon lists every PR, one row per
PR, each with its state, number, and title.
@DanielleMaywood

Copy link
Copy Markdown
Collaborator Author

Split into smaller layers. The sidebar changes continue in the replacement PR for branch feat/chat-diff-ref-ui, based on the new git panel and top bar PRs.

@github-actions github-actions Bot locked and limited conversation to collaborators Sep 18, 2026
@DanielleMaywood
DanielleMaywood removed this pull request from stack #29089 September 18, 2026 10:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

experimental Changes that might not necessarily be merged, until its approved to proceed with.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant