Repository navigation
Conversation
…d view Add ChatOverviewCardView, the card that a later change shows in the chat's top-right corner while the right panel is closed. It lists the chat cost, the uncommitted changes per repository, the pull requests, and the attachments. A row opens the matching right panel tab through onOpenTab. A clean repository shows +0 -0, so the card has a Changes row when AI Gateway turns cost off. Nothing mounts the view yet.
…nto a hook Move the Summary panel's attachment list into useChatAttachments: the files in the loaded messages, then the server's list for the messages before them. The overview card in the next change reads the same hook, so both show one list from one shared query. The Summary panel behaves as before.
…n the overview card Add a Subagents section to the overview card. It lists the subagents that are not idle, at most five, with the ones that need the user (error, requires action) first, so the cap never hides them. The heading counts all subagents, so a chat whose subagents are all idle shows "0 of N not idle" instead of the empty state. A row links to the subagent's chat.
Mount the overview card in the chat's top-right corner with a "Toggle overview" list button in the top bar. The card and the button exist only while the right panel is closed, the transcript is not full width, and the page is not an embed. Both show only from an 84rem chat, so the card never covers the transcript. The card shows by default in a new chat and stays open until the user hides it with the button. The choice is stored in localStorage under agents.overview-card-open. A row opens the right panel on its tab, which hides the card until the panel closes. The card lists every repository the git watcher reports, with +0 -0 for a clean one, and reads the attachments through useChatAttachments, the same list as the Summary panel. GitPanel exports computeRepoStats and repoLabel, and useChatFullWidth exports its storage key for stories. Document the card in the Coder Agents overview and in the list of places that show spend.
A pull request row in the overview card now opens the Git tab on that pull request's diff, and a repository row opens that repository's uncommitted changes. Before, both opened the Git tab on its default view. GitPanel accepts a viewRequest: each new request switches the view once, whether the panel is already mounted or mounts with it, and a request for a ref or repo that is gone falls back like any stale view. The card passes a target with the tab and, for Git, the view. A row click also moves keyboard focus to the panel's active tab, because the card unmounts when the panel opens.
…te in useChatAttachments The hook now owns the retry state and returns the earlier attachments status (loading, error, retrying, retry) instead of the raw query. The Summary panel passes it straight to ChatAttachments, and the overview card in the next change reads the same loading flag instead of its own copy of the rule. Behavior is unchanged.
…chments loading flag from useChatAttachments
GitPanel's viewRequest and SidebarTabView's focus request now carry an explicit request id instead of relying on object identity, so a caller cannot retrigger them by passing a fresh object. GitPanel applies a request through one path for both a mounted panel and a fresh mount. AgentChatPageView derives the Git request once, and the card's callback is renamed onOpenTarget because it now takes a target, not a tab. Behavior is unchanged.
# Conflicts: # docs/ai-coder/agents/index.md # site/src/pages/AgentsPage/AgentChatPage/AgentChatPageView.tsx
# Conflicts: # site/src/pages/AgentsPage/AgentChatPage/AgentChatPageView.tsx
# Conflicts: # site/src/pages/AgentsPage/AgentChatPage/AgentChatPageView.stories.tsx
…d view Rename the view file to ChatOverviewCardView.tsx, so the container in a later change can take ChatOverviewCard.tsx, as AgentChatPage does. Rows now call onOpenTarget with a target object, so the deep links later only add a view to it. A titled OverviewListSection replaces the repeated "if not empty, section around a list" blocks, and RepoDiffStat holds the +0 -0 placeholder. A repository without changes is no longer a button: the Git panel lists only repositories with changes, so the row had nothing to open.
Move the Subagents section into a SubagentsSection that owns the filter, the five-row cap, and the heading, with isIdle and needsUser naming the two status groups.
…pers into gitViews.ts Move GitView, viewIdFor, the diff line counting, computeRepoStats, and repoLabel out of the 900-line GitPanel component file into a pure module, and add repoBranchLabel for the "branch or folder name" label. The overview card in a later change reads the same helpers instead of importing them from the component file. Also cover the Summary panel keeping its earlier attachments failure while a retry runs. Behavior is unchanged.
…ins in the overview card with padding The card now pads by px-1.5 and its headings, empty and loading states, and rows pad themselves, so rows no longer pull outward with -mx-1.5. Text, icons, and hover areas stay in place; section dividers run 6px closer to the card edge.
… in the overview card The Changes section listed one row per repository but labeled each row with its branch, so two repositories on the same branch looked the same, and the toggle counted repositories as changes. Rename the section to Repositories, label each row with the repository name, and show the branch as the subtitle.
…ies in the overview card Show "No branch" when HEAD is detached instead of an empty subtitle, use a repository icon now that rows name repositories, and drop a test assertion on rendered output that the tab order test already covers.
# Conflicts: # site/src/pages/AgentsPage/components/ChatOverviewCardView.tsx
…nd branch to the overview card The card now labels each repository row with its folder name and shows the branch as the subtitle, so the container passes both values instead of one branch-or-folder label.
# Conflicts: # site/src/pages/AgentsPage/components/ChatOverviewCardView.test.tsx
ThomasK33
added a commit
that referenced
this pull request
Nov 10, 2026
…d view (#31409) Adds `ChatOverviewCardView`, a small card that lists a chat's cost, its repositories with their uncommitted line counts, the pull requests, and the attachments. Nothing mounts the view yet, so this PR changes no page. #31412 mounts it in the chat's top-right corner while the right panel is closed. A row calls `onOpenTarget({ tabId })` with the right panel tab that holds its details: **Summary** for cost and attachments, **Git** for repositories and pull requests. A repository row shows the repository's folder name, with its branch below it, or "No branch" when HEAD is on no branch. A repository without uncommitted changes shows `+0 −0` as plain text, with no hover state and no click, because the Git panel has nothing to show for it. A button row's label truncates in the 16rem card. When the label or subtitle is cut off, a tooltip shows it in full on hover and on keyboard focus. A row that fits gets no tooltip, so a screen reader does not hear its text twice. The plain-text row wraps instead, and it takes no tab stop. Long lists show three rows and a toggle that names the section, such as "Show all 5 repositories" and "Show fewer repositories". While the card is empty and loading, it shows skeleton rows in a `status` region that reads "Loading overview", and the card is marked `aria-busy`. The card has no animation. The code comes from the prototype in #31260 (do not merge), adapted to the `MessageAttachment` type from #31140. #31260 stays the hands-on reference for the whole card. The card with a long list, where the third repository has no branch:  The expanded list, and a clean repository without cost:   A repository row whose branch is cut off, on hover:  The loading state:  ## How to test 1. Open Storybook at `pages/AgentsPage/ChatOverviewCardView` and step through the stories. `TruncatedRowTooltip` hovers a repository row whose branch is cut off. 2. Run `pnpm exec vitest run --project=unit src/pages/AgentsPage/components/ChatOverviewCardView.test.tsx` in `site/`. The tests check the target each row sends, that a clean repository row is not a button, that a truncated row's tooltip opens on hover, that a row that fits gets no tooltip, and that Tab skips a clean repository row. ## What to look at first 1. `OverviewRow`: one row renders as a button with `onClick`, or as plain text without it, inside the shared `Tooltip`. 2. `OverviewListSection`: the shared "title, first three rows, toggle" list for Repositories, Pull requests, and Attachments. 3. `hasChanges` and `RepoDiffStat`: the clean repository rule lives in one predicate. <details> <summary>Review history</summary> Review follow-up: the Changes section listed repositories but labeled each row with its branch, so two repositories on the same branch looked the same, and the toggle counted repositories as changes. The section is now **Repositories**: each row shows the repository name, with the branch (or "No branch") as the subtitle and a repository icon. The view model gained `name`, and #31590 fills it. The stack above was updated by merges. The repository's frontend-deep-review ran three rounds on the first version, then one strict code quality review ran, then a polish pass and one final review round (a code quality review plus frontend-deep-review) ran on the whole stack. Polish pass changes in this PR: - Renamed the file to `ChatOverviewCardView.tsx`. The container lives in `ChatOverviewCard.tsx` in #31590 and the toggle joins it in #31412, like `AgentChatPage` and `AgentChatPageView`. - `onOpenTab(tab)` became `onOpenTarget({ tabId })`, so #31478 only adds a Git view to the target. The existing row test now expects `{ tabId: tab }` instead of `tab`. That is the only changed assertion, and it follows the rename. - Added `OverviewListSection`, `RepoDiffStat`, and `hasChanges`. - Clean repository rows became plain text. Before, a click opened the default Git view. The new test "opens nothing from a repository without changes" fails without this change. Final round fixes: folded `OverviewList` into `OverviewListSection`, named the clean repository check `hasChanges`, made `getCostSubtitle` return `undefined` instead of an empty string, and shortened the card's doc comment. Accessibility review from Jaayden (four threads) and an audit against site/AGENTS.md "Accessibility and robustness", FE6 and the frontend-deep-review SA6 checkpoint: - The clean repository row is plain text again: no `tabIndex`, no tooltip, no `oxlint` exception, and its label wraps. This reverses the follow-up fix below. The keyboard test now checks that Tab skips the row and lands on the next button, found by role. - The loading state uses skeleton rows in `role="status"` with screen reader text, and the card gets `aria-busy`. - The list toggle drops `aria-expanded` and names the section in its visible label. - The tooltip opens only when the text is truncated, measured with a `ResizeObserver` as the Git panel does for its PR title. New test: "adds no tooltip to a row whose label fits". - New story `TruncatedRowKeyboardFocus` screenshots the focus ring and the tooltip from the keyboard. - Declined from the audit: `aria-expanded` on the toggle (the review asked for one state signal), moving focus after a subagent link opens another chat (the sidebar chat links behave the same way), and moving focus when the window shrinks below 84rem while focus is in the card (rare). - Declined from the advisor: `useCallback` for the measuring ref. The React Compiler memoizes it, and the frontend rules forbid manual memoization in compiled folders. - I merged `origin/main` into this branch and carried it up the stack by merges, without a force push. Follow-up fixes, after the final round: - Added the row tooltip, with the shared `Tooltip` primitive. The plain-text row gets `tabIndex={0}` and an `oxlint` exception with its reason, as `SecretsTable.tsx` does, so the keyboard can open its tooltip. Its earlier "no focus" behavior changes for that reason only. - Two new tests check the tooltip through the row's accessible description, by hover and by keyboard. Each fails when the tooltip stays closed. The test file now renders with `renderComponent`, which adds the tooltip provider. No existing assertion changed. - New story `TruncatedRowTooltip` gives the open tooltip a screenshot. - The PR grew to 605 changed lines, most of them stories and tests. I kept it in one PR. Skipped in the polish pass: - A cost model that carries `coversWholeTree`. It moves a conditional into the container and changes the tested `getOverviewCost` contract without deleting a branch. - A shared helper for the unpriced-requests sentence. The two copies are short and use different punctuation, and the helper would touch `ChatSummary` in an unrelated PR. - A `CostRow` component from the final round. It overlaps the cost model item above and saves about three lines. Declined in earlier rounds: - Story fixture factories (`mockRepo`, `mockAttachment`) instead of named `Mock*` constants. They build view-model rows for one component, not shared API entities. - Stories for the "Pull request" and attachment name fallbacks, and for merged, closed, and draft pull request icons. `getPRIconConfig` and `getAttachmentDisplayName` are shared helpers with their own coverage. - A fallback label in the view for an empty branch name. The container passes `repoBranchLabel(root, repo)`, the same label as the Git panel. - A loading line while some sections already show data. Sections render as their data arrives, by design. </details> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_ --------- Co-authored-by: Jaayden Halko <jaayden.halko@gmail.com>
…ntainer story to its error state
…nd branch to the overview card The card now labels each repository row with its folder name and shows the branch as the subtitle, so the container passes both values instead of one branch-or-folder label.
…emoved hydration state Main's #30478 removed isHydratingMessages from useChatAttachments and replaceMessages from the chat store, so the container no longer type checked after the rebase.
…d hydration state to the overview card
# Conflicts: # site/src/pages/AgentsPage/AgentChatPage/AgentChatPageView.tsx
… isExpanded prop from the overview request test
jaaydenh
added a commit
that referenced
this pull request
Nov 18, 2026
…k and link the toggle to the card A card row opens the right panel, which unmounts the card and the focused row. The panel now focuses its active tab once per row click, using the same focus request that #31478 builds on. The top bar toggle names the card in aria-controls while it shows and has a tooltip, and the docs name the button.
jaaydenh
added a commit
that referenced
this pull request
Nov 18, 2026
Shows the overview card container from #31590 in Coder Agents chats. The card sits in the chat's top-right corner, and a list button in the chat top bar shows and hides it, as in the Codex desktop app. The card and the button exist only while the right panel is closed, the transcript is not full width, and the page is not an embed. Both show only from an 84rem chat, so the card never covers the transcript and the transcript never moves. Below 84rem the card does not mount, so its cost and attachment requests do not run. Phones and narrow windows do not show the card. The card shows by default and stays open until the user hides it. The choice is stored in localStorage under `agents.overview-card-open`, for every chat. The right panel keeps its own saved preference. A row opens the right panel on its tab, which hides the card. The card returns when the panel closes. The Repositories section lists every repository the git watcher reports, by folder name with its branch below. A clean repository shows `+0 −0`, so a chat keeps a Repositories row when AI Gateway turns cost off. The card reads the attachments through `useChatAttachments` from #31411, so it shows the Summary panel's list and shares its query. When the earlier attachments fail to load, the card shows the error and a **Retry** button in Attachments, as the Summary panel does. The docs describe the card in the Coder Agents overview and add it to the places that show spend. #31260 (do not merge) stays the hands-on reference. 1600px chat with the card open:  1600px chat after the user hid the card:  960px chat, no card and no button:  ## Decision and open questions for Jaayden Decision you can reverse: a clean repository row is plain text, not a button. The Git panel lists only repositories with changes, so a click on a clean row used to open the default Git view. To reverse it, give the clean row its `onClick` back in `ChatOverviewCardView`. 1. Should a new chat show the card instead of the Summary panel? This PR keeps the right panel's saved preference as it is. 2. A chat with no repository and no cost shows "Nothing to show yet". Is that the placeholder you want? 3. Subagents (#31410): the heading says "not idle" instead of "active" because errored subagents stay in the list, and the ones that need the user sort first. Do that wording and order work for you? 4. A row click (#31478) moves focus to the active right panel tab. Do you prefer the Git view switcher instead? ## How to test 1. Open Storybook at `pages/AgentsPage/AgentChatPageView`, stories `OverviewCardBesideTranscript`, `OverviewCardHiddenWhenNarrow`, `OverviewCardHiddenInFullWidth`, and `OverviewCardHiddenByUser`. 2. Run `pnpm exec vitest run --project=unit src/pages/AgentsPage/AgentChatPage/AgentChatPage.test.tsx src/pages/AgentsPage/hooks/useChatOverview.test.ts` in `site/`. The page tests set the chat width with the repo's `MockResizeObserver`. They check that a narrow chat requests none of the card's data, and that **Retry** in the card requests the earlier attachments again. 3. In a dev deployment, open a chat in a window at least 84rem wide. Hide the card with the list button, reload, and check that it stays hidden. ## What to look at first 1. `hooks/useChatOverview.ts`: one `canShow` value gates both the toggle and the card, so the page only renders what the hook returns. The hook measures the chat's outer element with a `ResizeObserver` through `observeChat`, and `OVERVIEW_MIN_CHAT_WIDTH_REM` holds the 84rem value in one place, so the button and the card cannot disagree. 2. `AgentChatPageView.tsx`: the page passes `observeChat` as the chat element's ref and destructures it from the hook result. The React Compiler treats an object that holds a ref callback as a ref, so the page keeps it apart from the other values. 3. `components/ChatOverviewCard.tsx`: this PR adds `ChatOverviewToggle` to the container from #31590. <details> <summary>Review history</summary> The repository's frontend-deep-review ran three rounds on the first version, a clean-context advisor ran once, then one strict code quality review ran, then a polish pass and one final review round ran on the whole stack. Polish pass changes: - Split `ChatOverviewCard.tsx` into the container plus `ChatOverviewToggle`, with the view in `ChatOverviewCardView.tsx` (#31409). The `getOverviewCost` tests moved to `ChatOverviewCard.test.tsx` unchanged. - Added `useChatOverview`, which owns the visibility gate and the open state. - The card builds repository rows with `repoLabel`, the repository's branch, and `countRepoChanges`. Before, it filtered repositories through `computeRepoStats` only to add the clean ones back. - The docs say that you cannot select a clean repository row. Final round fixes: renamed the top bar prop `overview` to `overviewToggle`, inlined the toggle value in the hook, and corrected three doc comments. Follow-up fixes, after the final round: - The card no longer mounts below an 84rem chat. Before, it stayed mounted and CSS hid it, so its queries kept running. The repo has no element-size hook, so `useChatOverview` observes the chat element itself. The `@container/chat` class and the `@min-[84rem]/chat` classes are gone. - The card wires the earlier attachments request into the view, so a failure shows its error and a retry. - New tests: the hook test checks the 84rem boundary on both sides, and two page tests check the narrow chat's requests and the card's retry. Each fails without its fix. The existing page tests now set a 1600px chat width before they look for the card. Their assertions did not change. - The container moved to #31590, because this PR grew past 600 changed lines. GitHub cannot insert a PR in the middle of a stack, so I removed stack #31413 and linked the six PRs again as stack #31591. - Safari: Playwright 1.63.0 downloaded WebKit, but WebKit does not start on this host, because system libraries such as `libsoup-3.0` and `libGLESv2` are missing. I did not check the narrow right panel or the card in WebKit. The `@container/chat` wrapper that the check was about no longer exists. Skipped in the polish pass: passing the card's placement class from the page. That keeps the 84rem breakpoint in one file with the toggle, and moving it adds a pass-through prop. Declined: - The page test checks that the card is gone while the right panel is open (`toBeNull`). That unmount is the behavior under test, and no callback or request captures it. - `@container/chat` traps the right panel's `fixed inset-0` overlay below the `lg` breakpoint. I rendered `NarrowWithSidebarPanel` at 390px and 900px in Chromium, and the panel still covers the viewport. The follow-up fixes removed `@container/chat`. - `try`/`catch` around `localStorage` in `overviewCardStorage.ts`. The file follows `sidebarTabStorage.ts`. - Final round: move `ChatOverviewToggleProps` into the hook. The hook imports only a type from the component file, so no runtime cycle exists. </details> --- _Generated with [`xum`](https://github.com/coder/xum) • Model: `anthropic:claude-opus-5-5` • Thinking: `high`_ --------- Co-authored-by: Jaayden Halko <jaayden.halko@gmail.com>
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
A pull request row in the overview card now opens the Git tab on that pull request's diff, and a repository row with changes opens that repository's uncommitted changes, in one click. Before, both rows opened the Git tab on its default view. A row click also moves keyboard focus to the panel's active tab. Before, focus dropped to the page body, because the card unmounts when the panel opens. Cost and attachment rows still open Summary, and a clean repository row still opens nothing (#31409).
The Git panel stays mounted while it is hidden:
RightPanelhides it with CSS, andSidebarTabViewkeeps inactive tabs mounted. A prop that only sets the initial view does not work for that reason. SoGitPaneltakes aviewRequestof{ id, view }, and it switches the view once per newid, in a mounted panel and in one that mounts with the request. The user can switch away after. A request for a ref or repository that no longer exists falls back through the existingfallbackView.useChatOverviewnumbers each row click, so a repeated click on the same row still opens its view and moves focus. Each request applies exactly once:GitPanelreportsonViewRequestAppliedandSidebarTabViewreportsonFocusRequestApplied, and the hook then stops passing that request on. A Git panel or tab view that mounts again later does not replay an old click.A click on the #4822 row opens that pull request, not the primary one (#123), with focus on the Git tab:
The recording, from Storybook, starts on the state above. It closes the panel and clicks the clean
mainrow, which does nothing. Then it clicks the repository row with changes, closes the panel again, and clicks the #123 row. Each click opens the exact view:pr5-row-clicks.mp4
The open question about focus is in #31412 with the others.
How to test
pages/AgentsPage/AgentChatPageView, storyOverviewCardOpensPullRequest, at 1600px. Close the panel with the panel toggle and click the rows.pnpm exec vitest run --project=unit src/pages/AgentsPage/components/GitPanel/GitPanel.test.tsx src/pages/AgentsPage/components/ChatsSidebar/tabs/SidebarTabView.test.tsx src/pages/AgentsPage/AgentChatPage/AgentChatPage.test.tsx src/pages/AgentsPage/components/ChatOverviewCardView.test.tsxinsite/. The remount tests drive the realuseChatOverviewhook.What to look at first
GitPanel.tsx: theviewRequestcheck during render, which applies each request id once.hooks/useChatOverview.ts:recordTarget,focusRequestId,gitViewRequest, and the applied ids that stop a request after its consumer reports it.SidebarTabView.tsx: the effect that focuses the active tab for a newfocusRequestIdand reports it.Review history
The repository's frontend-deep-review ran two rounds on the first version, and a clean-context advisor recommended it as ready. Then one strict code quality review ran, then a polish pass and one final review round ran on the whole stack.
Earlier changes:
GitPaneltakes a view request with an explicitid, andSidebarTabViewtakes afocusRequestId. Before, both reacted to a new object identity.Polish pass changes: the Git request state moved from the page into
useChatOverview. The page'sopenOverviewTargetrecords the target and opens its tab.OverviewTargetfor Git now carries aview: GitView, so the row test expects full targets.GitPanel.test.tsximportsviewIdForfromgitViews.ts.Final round fixes:
GitViewRequestmoved intogitViews.ts, so the panel and the hook share one type. The hook's doc comment is shorter.Follow-up fixes, after the final round:
GitPanelorSidebarTabViewapplied it again. Each consumer reports the id it applied through an effect withuseEffectEvent, becauseGitPanelapplies the view during render and cannot update its owner there. Fewer moving parts were not possible without lifting the Git view state into the page.GitPanel.test.tsxremounts the panel after a request, and the newSidebarTabView.test.tsxremounts the tab view after a focus request. Both fail when the hook ignores the report. No existing assertion changed. The page test for this PR sets a 1600px chat width first, because feat: show the overview card in Coder Agents chats #31412 now measures the chat.Declined:
getChatDiffContentsspy in the new story withparameters.queries. Two sibling stories in the same file spy on the same endpoint, and a queries override must copy the whole meta query array.useChatOverview. The hook then depends on page state, and the reviewer recommended no change.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high