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/src/pages/AgentsPage/components): simplify the git panel header by tracyjohnsonux · Pull Request #29699 · coder/coder

Conversation

@tracyjohnsonux

@tracyjohnsonux tracyjohnsonux commented Sep 22, 2026 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Simplifies the git panel header. Stacked on #29544 (per-ref views in the git panel) so the multi-PR switcher and this header change do not collide.

  • A lone view (one PR, one branch, or one working repo with nothing else) renders as a plain label instead of a bordered dropdown trigger.
  • The toolbar is [switcher] [refresh] ... [action]. The action follows the active view: a PR shows a small View PR link, a working repo shows a small Commit button. The unified/split toggle moves into the branch/stats sub-header as a shared DiffStyleToggle.
  • The toolbar's padding puts the switcher text on the same 16px gutter and first-line center as a Summary paragraph, so switching tabs does not jump.
  • The switcher follows the other agents dropdowns: rotating chevron, radio items with a check mark on the active view, compact item sizing, and a separator between remote and working entries instead of an indent.
Header states
State Header
Single PR only ⑂ PR #4847 label, refresh, View PR on the right
Working repo only ● coder label, refresh, Commit on the right
PR + working repo Open | PR #4847 ▾ dropdown, action swaps with the selected view
Branch-only ref ⑂ feat/branch label, no action
Decision log
  • Branch-only refs get no action: the server synthesizes /tree/<branch> URLs for them, so the link requires a PR number, not just a URL.
  • DiffStyleToggle lives in DiffViewer.tsx next to DiffStyle so both sub-headers can render it without a GitPanel/RemoteDiffPanel import cycle.
  • The plain single-view label keeps the trigger's (transparent) border box and inner padding so text does not shift when a second view appears.
  • LocalDiffPanel is mocked in the header tests because the @pierre/diffs web component cannot be constructed under jsdom.

Generated by Coder Agents on behalf of @tracyjohnsonux.

Sorry, something went wrong.

Uh oh!

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

All reactions
DanielleMaywood and others added 20 commits September 21, 2026 08:22
@DanielleMaywood
feat(coderd): key chat diff statuses by ref
50c7b30
chat_diff_statuses held one row per chat, so a chat could only track
one pull request at a time and a branch switch carried the previous
PR's URL onto the new branch's data.

Re-key the table to (chat_id, git_remote_origin, git_branch) so every
ref the agent reports keeps its own row. Existing rows satisfy the new
key without a rewrite: both columns are NOT NULL with '' defaults and
the old key capped rows at one per chat.

The worker claims stale rows by the full key. Retained refs keep
polling on their own schedule, so no pause state or resume protocol is
needed. Telemetry reports one diff row per chat via DISTINCT ON.

The diff GET's discovery write now keys its upsert to the stored ref.
Under the old single-row key an empty ref key was safe; under the
composite key it would create a stray row the worker ignores.

Old coderd instances must finish before this migration runs: their
ON CONFLICT (chat_id) writes have no arbiter under the new key.
@DanielleMaywood
fix(coderd): key discovery writes off the report ordering
70aaf3a
The primary ref is the most recently reported one, but its
ordering column was updated_at, the generic mutation time. A
discovery GET that resolves a changed PR URL late could bump the
old ref's updated_at past a newer report and steal the primary
back.

The table now tracks reported_at, set only by reports. Primary
ordering, the chat-list tiebreak, and telemetry dedup read it.
Refreshes, claims, backoffs, and URL writes cannot reorder the
primary anymore. The discovery write uses a dedicated query that
never touches ordering columns.
@DanielleMaywood
fix(coderd): state each timestamp rule without its history
6203c52
@DanielleMaywood
fix(coderd): make the timestamp comments plain
cc365fe
@DanielleMaywood
fix(coderd): drop comments that restate the queries
0d92ac5
@DanielleMaywood
feat: expose per-ref diff statuses
18ad411
@DanielleMaywood
feat(site): fetch and merge diff statuses per ref
eac2f11
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.
@DanielleMaywood
refactor(site): spread the diff status ref fixture
8f846ab
The factory took positional git_branch and additions arguments.
A const base with object spread states every field at each call
site, matching the mock fixture convention.
@DanielleMaywood
refactor(site): readable names in the diff status merge
8c30437
Single-letter loop variables now name their rows. The tombstone
and changed-row arguments are built before the merge call instead
of nested ternaries inside it. The diff-contents key prefix gets
a named family key that the invalidation reuses.
@DanielleMaywood
style(site): give the diff status merge room to breathe
be63540
The merge phases and the event derivation groups ran together
without separation. Each phase and group now has its own comment
with a blank line between them.
@DanielleMaywood
style(site): trim the merge comments to their arguments
c0e01e3
@DanielleMaywood
feat(site): per-ref views in the git panel
062a4fb
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
e39968f
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
bd4ee94
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
2b11d9b
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
7739f78
The query enable conditions are named variables: hasPrUrl and
hasRefSelector state what the enable rule checks.
@DanielleMaywood
refactor(site): extract the git panel derivations
b3180a4
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
04b7de9
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
bcdc567
@tracyjohnsonux
feat(site/src/pages/AgentsPage/components): simplify the git panel he…
5906a9d
…ader

A lone view (one PR, one branch, or one working repo with nothing
else) renders as a plain label instead of a bordered menu trigger.

The primary action moves into the toolbar and follows the view: a
PR shows a View PR link, a working repo shows a Commit button. The
per-view sub-headers keep the branch and stats but drop their
buttons.
@github-actions github-actions Bot assigned tracyjohnsonux Sep 22, 2026
tracyjohnsonux added 2 commits September 22, 2026 05:05
@tracyjohnsonux
style(site/src/pages/AgentsPage/components): align the git panel head…
ceb8455
…er with the summary tab

The refresh control sits beside the view switcher, the primary action
takes the far right, and the unified/split toggle moves into the
branch/stats sub-header as a shared DiffStyleToggle.

The toolbar's padding puts the switcher text on the same 16px gutter
and first-line center as a summary paragraph. The plain single-view
label keeps the trigger's border box so text does not shift when a
second view appears.

The switcher now follows the other agents dropdowns: a rotating
chevron, radio items with a check mark on the active view, compact
item sizing, and a separator between remote and working entries.
@tracyjohnsonux
style(site/src/pages/AgentsPage/components): size the git switcher li…
9cd374b
…ke the terminal selector

The trigger is h-8 in a px-3 gutter with the terminal selector's
padding, chevron size, and w-56 menu. The refresh button and Commit
button scale up with it. pt-3 keeps the control centered on the
summary tab's first line.
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch 7 times, most recently from 96fbdeb to 93f2d37 Compare September 24, 2026 08:32
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch 10 times, most recently from 8994071 to a9210b7 Compare October 1, 2026 09:59
@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch 3 times, most recently from 045fbb8 to 2ade5e8 Compare October 6, 2026 10:14
@linear-code

linear-code Bot commented Oct 8, 2026

Copy link
Copy Markdown

CODAGT-990

All reactions

Sorry, something went wrong.

Uh oh!

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

@DanielleMaywood
DanielleMaywood force-pushed the feat/chat-diff-ref-gitpanel branch from 2ade5e8 to cb0dbd0 Compare October 9, 2026 09:36
Base automatically changed from feat/chat-diff-ref-gitpanel to main October 9, 2026 10:27
@tracyjohnsonux tracyjohnsonux added the experimental Changes that might not necessarily be merged, until its approved to proceed with. label Oct 13, 2026
@tracyjohnsonux tracyjohnsonux closed this Oct 13, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 13, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Reviewers

No reviews

Uh oh!

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

Assignees

@tracyjohnsonux tracyjohnsonux

Labels

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

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.

2 participants

@tracyjohnsonux @DanielleMaywood
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.