GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — feat(site): per-ref views in the git panel by DanielleMaywood · Pull Request #29544 · coder/coder

Conversation

@DanielleMaywood

@DanielleMaywood DanielleMaywood commented Sep 18, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Part 4 of 6. Depends on #29543.

The git panel's view switcher now has one entry per tracked ref from diff_statuses. A PR ref shows its state and number; a ref without a PR shows its branch name. When refs come from more than one origin, each entry is prefixed with owner/repo. Selecting an entry fetches that ref's diff using its origin/branch selector. The header, PR title and stats follow the selection.

Refs without a PR now load their branch diff, and the "View PR" link is hidden for them. The remote tab appears once the chat tracks any ref. If the selected ref disappears, the panel falls back to the primary. Switching refs remounts the diff viewer, so an open inline comment draft cannot carry over to another PR. A legacy row with no origin or branch can only be selected when it is the primary, because an empty selector always returns the primary's diff.

Generated by Coder Agents.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@DanielleMaywood DanielleMaywood added the experimental Changes that might not necessarily be merged, until its approved to proceed with. label Sep 18, 2026
@github-actions github-actions Bot assigned DanielleMaywood Sep 18, 2026
@DanielleMaywood
DanielleMaywood added this pull request to stack #29551 September 18, 2026 10:48
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch 3 times, most recently from dcb5f27 to 50c848c Compare September 18, 2026 15:28
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch 2 times, most recently from 7a3cf14 to 896d6f4 Compare September 21, 2026 10:33
@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 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

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:45.672752Z 7e27d9d 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Sep 21, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

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: 896d6f495c

ℹ️ 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".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread site/src/pages/AgentsPage/components/GitPanel/GitPanel.test.tsx Outdated
],
});

// The default view targets the primary ref.

@chatgpt-codex-connector chatgpt-codex-connector Bot Sep 21, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P1 Badge Remove comments that merely narrate assertions

This comment, along with the similar comments before the assertions around lines 102, 132, and 168, only paraphrases the immediately following expectation without explaining a non-obvious constraint. Remove these narration comments and retain only rationale such as the legacy-keyless-row explanation later in the test.

AGENTS.md reference: site/AGENTS.md:L10-L10

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@DanielleMaywood DanielleMaywood Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Fixed in 7e27d9d. The narration comments cited at lines 102, 132, and 168 were removed in an earlier pass; the one remaining narration comment (before the branch-only fetch assertion) is now gone too. The fixture-rationale comments for the keyless legacy row stay, as you suggested.

Generated by Coder Agents

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread site/src/pages/AgentsPage/components/GitPanel/GitPanel.tsx Outdated
Comment on lines +249 to +251
triggerIdentifier: branchName || "Branch",
itemPrimary: "Branch",
itemSecondary: branchName || undefined,

@chatgpt-codex-connector chatgpt-codex-connector Bot Sep 21, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Include the remote in branch-only ref labels

When multiple tracked repositories use the same branch name, such as feature/foo, these fields render identical dropdown entries and an identical active trigger even though the ref identity and fetched diff also depend on remote_origin. Users, including screen-reader users, cannot determine which repository they are selecting, so include a repository or origin identifier in the branch-only label.

AGENTS.md reference: site/AGENTS.md:L12-L12

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@DanielleMaywood DanielleMaywood Sep 22, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Fixed in 7e27d9d, for both remote row kinds. When a chat tracks more than one origin, every remote entry names its repository (parsed deterministically from remote_origin): branch-only rows read "coder/coder · feature/shared" and PR rows read "coder/other-project · PR #5", in both the dropdown and the active trigger. PR rows get the same treatment because PR numbers are only unique per repository, so they had the identical cross-repo ambiguity. Single-origin chats keep the old labels unchanged. A test asserts the menu items' accessible names are all distinct, and a new MultipleOrigins story covers the visual state.

Generated by Coder Agents

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch from 896d6f4 to 86c5cf6 Compare September 21, 2026 12:17
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch from 86c5cf6 to e87f9d8 Compare September 21, 2026 12:38
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch 2 times, most recently from 9adea34 to bcdc567 Compare September 21, 2026 16:19
@tracyjohnsonux tracyjohnsonux mentioned this pull request Sep 22, 2026
feat(site/src/pages/AgentsPage/components): simplify the git panel header #29699
Closed
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch from bcdc567 to 975c2cc Compare September 22, 2026 08:22
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch 2 times, most recently from b791a68 to 9c6655d Compare September 22, 2026 10:24
@DanielleMaywood

DanielleMaywood commented Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

chatgpt-codex-connector[bot]
chatgpt-codex-connector Bot reviewed Sep 23, 2026
View reviewed changes

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

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: 7e27d9d0d4

ℹ️ 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".

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread site/src/pages/AgentsPage/components/GitPanel/GitPanel.tsx
Comment on lines +373 to +377
const effectiveView = fallbackView(view, {
localRepos,
remoteDiffStats,
primaryRefId,
});

@chatgpt-codex-connector chatgpt-codex-connector Bot Sep 23, 2026

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

P2 Badge Persist the reconciled fallback selection

When the selected ref or repository disappears during a status update, fallbackView changes only effectiveView; the stored view remains pointed at the missing item. If that item later reappears, such as after a ref is re-reported or a repository watcher reconnects, the panel silently switches back to it instead of retaining the fallback that the user has been shown. Persist the fallback when the current selection becomes invalid, as the removed reconciliation effect previously did.

AGENTS.md reference: site/AGENTS.md:L11-L11

Useful? React with 👍 / 👎.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@DanielleMaywood DanielleMaywood Sep 23, 2026

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Keeping the derived reconciliation without persistence.

A ref row cannot disappear and reappear: the server has no delete path for chat_diff_statuses, so rows only leave when the chat is deleted, which remounts the panel. The only reachable case where the selected ref stops matching is the keyless primary being demoted by a newer ref, and falling back to the new primary there is intended and covered by tests.

For a local view, the reachable disappearance is a transient agent disconnect. Returning to the repo the user was viewing once the watcher reconnects is the intended everDirty behavior. Persisting the fallback would discard that selection permanently because of a temporary disconnect.

This reply was generated by Coder Agents.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch from 7e27d9d to 9b020bf Compare September 23, 2026 11:07
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch from a9210b7 to 48935e7 Compare October 5, 2026 09:06
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch from 48935e7 to 045fbb8 Compare October 5, 2026 14:38
Base automatically changed from feat/chat-diff-ref-client to main October 6, 2026 09:19
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch from 045fbb8 to 2ade5e8 Compare October 6, 2026 10:14
@pr-queue-manager
pr-queue-manager Bot requested review from jaaydenh and jakehwll and removed request for jaaydenh October 6, 2026 10:15
ibetitsmike
ibetitsmike approved these changes Oct 9, 2026
View reviewed changes
DanielleMaywood added 12 commits October 9, 2026 09:03
@DanielleMaywood
feat(site): per-ref views in the git panel
2a21f75
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.
@DanielleMaywood
refactor(site): name mock data consistently in git panel stories
d34c198
Every mock data fixture now starts with mock: mockDiffStatus,
mockChatWithDiffStatus, and mockDiffContents. Factory helpers keep
their make prefix: makePrStatus and makeRepo.
@DanielleMaywood
refactor(site): make the diff contents fixture a const
388eec2
Every call site passed the same chat id. A const removes the
argument that no caller varied.
@DanielleMaywood
refactor(site): make the git view reconciliation easy to read
9f12b25
The effective view was a four-level ternary chain. It is now a
reconcile function whose branches read in order: hidden remote
tab, untracked ref, gone repo root, then the fallbacks. The
selector object for the selected ref is a named variable instead
of an inline JSX object, and the closure predicates use named
variables instead of re-narrowing the union.
@DanielleMaywood
refactor(site): name the diff fetch conditions
0cd2190
The query enable conditions are named variables: hasPrUrl and
hasRefSelector state what the enable rule checks.
@DanielleMaywood
refactor(site): extract the git panel derivations
ceae60d
The component mixed its derivation logic inline: diff line counting,
repo set unions, switcher item building, view reconciliation, and
the selected-ref lookup each lived as nested code inside the
component body. Each is now a module-level helper with a name,
and the component reads as wiring between them. The diff fetch
enable check states its contract in one line.
@DanielleMaywood
style(site): give the selected ref derivations room to breathe
bf80a06
The view selection, the selected row, and its PR metadata were one
unbroken run of declarations. Each group now sits under its own
comment with a blank line between groups.
@DanielleMaywood
style(site): drop restated derivations in the git panel
75d829c
@DanielleMaywood
style(site): use a type for ViewFallbackInput
202432d
@DanielleMaywood
fix(site): name the repository in remote ref labels
39bcce9
@DanielleMaywood
test(site): expect the abort signal in per-ref diff fetches
83b7a59
@DanielleMaywood
fix(site): take the git panel primary from diff_status
cb0dbd0
The first row of diff_statuses is no longer the primary. The git
panel now gets the primary from diff_status. It uses the primary to
pick the default view and to decide if a keyless row can show.
jakehwll
jakehwll approved these changes Oct 9, 2026
View reviewed changes

@jakehwll jakehwll left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I'm a little stressed about injection, pre approving for that fix 🙂

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread site/src/pages/AgentsPage/components/DiffViewer/RemoteDiffPanel.tsx Outdated
{/* A remount per ref keeps any open inline comment box
from leaking into a different PR's diff. */}
<CommentableDiffViewer
key={`${remoteRef?.remote_origin ?? ""}/${remoteRef?.git_branch ?? ""}`}

@jakehwll jakehwll Oct 9, 2026

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

I don't love this

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch from 2ade5e8 to cb0dbd0 Compare October 9, 2026 09:36
@DanielleMaywood
fix(site): use the view switcher's ref id to remount the remote diff
e08b7d7
The remount key joined the origin and the branch with "/", and both can contain "/". Two refs could then share a key and skip the remount. The view switcher already has a unique id for each ref, so RemoteContent now uses it as its key.
@DanielleMaywood
DanielleMaywood merged commit 86013c2 into main Oct 9, 2026
27 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@DanielleMaywood
DanielleMaywood deleted the feat/chat-diff-ref-gitpanel branch October 9, 2026 10:27
DanielleMaywood added a commit that referenced this pull request Oct 9, 2026
@DanielleMaywood
feat(site): list every PR in the top bar (#29831)
051eb58
Part 5 of 6. Depends on #29544. Supersedes #29545, which merged with a
flattened head by mistake.

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

Each menu entry shows the PR state icon, the PR number, the title on one
line, and an external-link icon. Screen readers hear the PR state. The
menu is 288px wide and shows five entries before it scrolls.
`PRMenuLinks` renders the entries.

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

Generated by Coder Agents.
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

@chatgpt-codex-connector chatgpt-codex-connector[bot] chatgpt-codex-connector[bot] left review comments
@jakehwll jakehwll jakehwll approved these changes
@ibetitsmike ibetitsmike ibetitsmike approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@DanielleMaywood DanielleMaywood

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@DanielleMaywood @jakehwll @ibetitsmike
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.