Repository navigation
feat: show the overview card in Coder Agents chats - #31412
Merged
Merged
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.
Contributor
Docs previewCheck 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. |
…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
# Conflicts: # docs/ai-coder/agents/index.md # 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.
Move the container, getOverviewCost, and the top bar toggle into ChatOverviewCard.tsx, next to the view in ChatOverviewCardView.tsx. The card reads repoBranchLabel and countRepoChanges from gitViews.ts instead of filtering the repositories through computeRepoStats and adding the clean ones back. useChatOverview owns the card's visibility gate and its stored open state, so AgentChatPageView only renders what it returns. The docs say that a clean repository row cannot be selected.
…t into its section and name the clean repository check
…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
jaaydenh
added a commit
that referenced
this pull request
Nov 18, 2026
…tainer (#31590) Adds `ChatOverviewCard`, the container that builds the overview card's data and renders `ChatOverviewCardView` from #31409. Nothing mounts it yet, so this PR changes no page. #31412 mounts it in the chat. The container reads the chat cost query, the git watcher's repositories, the pull request statuses, the subagent statuses, and the attachments from `useChatAttachments` (#31411). `getOverviewCost` turns the cost query into the card's three cost states. When the earlier attachments fail to load, the container passes the request to the view. Attachments then shows the same one-line "Failed to get attachments" alert with a **Retry** button as the Summary panel. I split this PR out of #31412 when that PR grew past 600 changed lines. The code is the same container that #31412 reviewed before, without the top bar toggle, which stays in #31412 with its only caller. | `Default` | `EarlierAttachmentsError` | |---|---| |  |  | ## How to test 1. Open Storybook at `pages/AgentsPage/ChatOverviewCard`, stories `Default` and `EarlierAttachmentsError`. 2. Run `pnpm test src/pages/AgentsPage/components/ChatOverviewCard.test.tsx` in `site/`. The page test in #31412 checks that **Retry** requests the earlier attachments again. ## What to look at first 1. `ChatOverviewCard`: one place builds the `ChatOverview` model from the queries and the chat store. 2. `getOverviewCost`: a failed refetch keeps the cost that loaded, and a chat without AI Gateway requests has no cost row. <details> <summary>Review history</summary> This container was reviewed as part of #31412 through three frontend-deep-review rounds, a code quality review, a polish pass, and a final review round. It moved here in the follow-up pass that fixed the open follow-ups: - The container now passes `earlierAttachmentsRequest` to the view, so a failed request shows its error and a retry. - `GitPanel/gitViews.ts` exports `countRepoChanges` here, where its first caller arrives. - Each repository row gets its `name` from `repoLabel(root)` and its trimmed `branch`, which the view shows as the subtitle, or "No branch" when it is empty. - The stories are new. They give the container's error state a screenshot. The stories have no `play` assertions, because the page test in #31412 covers the retry request. After #31411 merged, this branch was rebased onto `main` with no conflicts and now targets `main`. It picks up the smaller `AttachmentsErrorAlert` from #31411 without code changes here, so the screenshots above are new. </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>
…erge # Conflicts: # site/src/pages/AgentsPage/components/ChatOverviewCard.tsx
…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
approved these changes
Nov 18, 2026
…at before using the overview card The loading view renders its own overview toggle and a skeleton card with the same accessible names, so the tests acted on elements that unmount once the chat loads.
jaaydenh
enabled stacked auto-merge (squash)
November 18, 2026 16:48
jaaydenh
had a problem deploying
to
docs-preview
November 18, 2026 16:55 — with
GitHub Actions
Failure
This branch had an error being 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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
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 throughuseChatAttachmentsfrom #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
onClickback inChatOverviewCardView.How to test
pages/AgentsPage/AgentChatPageView, storiesOverviewCardBesideTranscript,OverviewCardHiddenWhenNarrow,OverviewCardHiddenInFullWidth, andOverviewCardHiddenByUser.pnpm exec vitest run --project=unit src/pages/AgentsPage/AgentChatPage/AgentChatPage.test.tsx src/pages/AgentsPage/hooks/useChatOverview.test.tsinsite/. The page tests set the chat width with the repo'sMockResizeObserver. They check that a narrow chat requests none of the card's data, and that Retry in the card requests the earlier attachments again.What to look at first
hooks/useChatOverview.ts: onecanShowvalue 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 aResizeObserverthroughobserveChat, andOVERVIEW_MIN_CHAT_WIDTH_REMholds the 84rem value in one place, so the button and the card cannot disagree.AgentChatPageView.tsx: the page passesobserveChatas 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.components/ChatOverviewCard.tsx: this PR addsChatOverviewToggleto the container from feat(site/src/pages/AgentsPage/components): add the overview card container #31590.Review history
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:
ChatOverviewCard.tsxinto the container plusChatOverviewToggle, with the view inChatOverviewCardView.tsx(feat(site/src/pages/AgentsPage/components): add the chat overview card view #31409). ThegetOverviewCosttests moved toChatOverviewCard.test.tsxunchanged.useChatOverview, which owns the visibility gate and the open state.repoLabel, the repository's branch, andcountRepoChanges. Before, it filtered repositories throughcomputeRepoStatsonly to add the clean ones back.Final round fixes: renamed the top bar prop
overviewtooverviewToggle, inlined the toggle value in the hook, and corrected three doc comments.Follow-up fixes, after the final round:
useChatOverviewobserves the chat element itself. The@container/chatclass and the@min-[84rem]/chatclasses are gone.libsoup-3.0andlibGLESv2are missing. I did not check the narrow right panel or the card in WebKit. The@container/chatwrapper 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:
toBeNull). That unmount is the behavior under test, and no callback or request captures it.@container/chattraps the right panel'sfixed inset-0overlay below thelgbreakpoint. I renderedNarrowWithSidebarPanelat 390px and 900px in Chromium, and the panel still covers the viewport. The follow-up fixes removed@container/chat.try/catcharoundlocalStorageinoverviewCardStorage.ts. The file followssidebarTabStorage.ts.ChatOverviewTogglePropsinto the hook. The hook imports only a type from the component file, so no runtime cycle exists.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high