Repository navigation
feat(site/src/pages/AgentsPage): share the attachments request and Git view helpers with the overview card - #31411
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.
…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.
…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.
…t into its section and name the clean repository check
…uest and reuse DiffStats in the overview card
…ard labels in a tooltip
# Conflicts: # site/src/pages/AgentsPage/components/ChatOverviewCardView.test.tsx # site/src/pages/AgentsPage/components/ChatOverviewCardView.tsx
…quest in the overview card view
…y for the overview card rows
# Conflicts: # site/src/pages/AgentsPage/components/ChatOverviewCardView.tsx
… role in the clean repository test
…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
jaaydenh
approved these changes
Nov 17, 2026
…without its error text The smaller attachments alert no longer shows the request's error detail, so EarlierAttachmentsRefetchAfterFailedRetry could not find "context deadline exceeded" and failed in Pixel. Hold the Retry response and wait for the button to disable and re-enable instead.
jaaydenh
had a problem deploying
to
docs-preview
November 17, 2026 06:24 — 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.
Moves two pieces of shared logic out of their single owners, so the overview card container in #31590 can read them without copies, and lets the card view show a failed attachments request. The Git panel behaves as before. The Summary panel behaves as before except for its failed attachments request, which now shows the same one-line alert as the card.
hooks/useChatAttachments.tstakes the Summary panel's attachment list: the files in the loaded messages, then the server'schatAttachmentslist for the messages before them. It also owns the request state and the retry (earlierAttachmentsRequest). The card and the panel read the same React Query key, so the earlier-attachments request runs once.components/GitPanel/gitViews.tsis a pure module forGitView,viewIdFor,DiffStats,computeRepoStats,repoLabel, andrepoBranchLabel.GitPanelimports them, andRepoHeaderusesrepoBranchLabelinstead of its inline branch label. The card view types its repository rows withDiffStats.earlierAttachmentsRequest. When the request fails, Attachments shows the error and a Retry button. The section shows even when no attachment loaded, and the card no longer says "Nothing to show yet" then.AttachmentsErrorAlertrenders that error in both the card and the Summary panel. The fullErrorAlertwas too tall for both: the server message wrapped, and the panel pushed Retry below its fold. The new alert is one row with a fixed "Failed to get attachments" message, no debug detail, and an extra-small Retry button.How to test
pnpm test src/pages/AgentsPage/components/ChatSummaryPanel.test.tsx src/pages/AgentsPage/components/ChatOverviewCardView.test.tsx src/pages/AgentsPage/components/GitPanel/GitPanel.test.tsxinsite/.GitPanel. Nothing changes visually. OpenChatSummaryPanel. Only theEarlierAttachments*stories with a failed request change, to the one-line alert.ChatOverviewCardView, storyEarlierAttachmentsError, andAttachmentsErrorAlertfor the new alert at the card width (idle and retrying) and the list width.What to look at first
useChatAttachments. A retry clears the error of a query with no data, so the hook keeps the failed error until the retry settles. The test "keeps the failure and its retry button while the retry runs" fails without this.AttachmentsErrorAlertlays the message and Retry on one row with child selectors ([&>div>div],[&>div>div>div]) onAlert's internal markup. A change toAlert's nesting would undo the layout, which theAttachmentsErrorAlertstories would catch. The alert also no longer shows the server's error message.computeRepoStatsingitViews.tsdrops theif (!repo.unified_diff) continuebranch. An empty diff counts zero lines and stays out of the map, so the result is the same.Review history
Follow-up fix: the card view shows a failed earlier attachments request with a retry.
useChatAttachmentsexports itsEarlierAttachmentsRequesttype for the view, andOverviewListSectiontakeschildrenafter its rows. A new test clicks Retry and checks the callback. It fails when the section drops itschildren. The PR title changed fromrefactortofeatfor this.Polish pass changes: added
gitViews.tsand the retry test. The PR title changed from "move the chat attachments list into a hook" to cover the Git helpers.Final round fixes: renamed the hook's
earlierresult toearlierAttachmentsRequest, typed the card's repository rows withDiffStats, and made the retry test assert the visible error and wait for the retry to finish.Declined in the final round:
computeRepoStatsprivate inGitPanel.tsx. The requester asked for it ingitViews.tsnext to the other Git view helpers.EarlierAttachmentsRetryingstory covers the state. The requester asked for this test. It fails in CI when the alert disappears during the retry, while the story only changes a screenshot.earlierAttachmentsRequesttoChatAttachmentsas one prop. It saves about six lines but touches theChatAttachmentsstories.Smaller error alert: added
AttachmentsErrorAlertand used it in the card and inChatAttachments. TheEarlierAttachmentsFailedstory no longer scrolls Retry into view, since the alert fits the panel. The retry test no longer checks the server's error text, which the alert stopped showing. It still checks that Retry stays disabled during the retry and disappears after it.Generated with
xum• Model:anthropic:claude-opus-5-5• Thinking:high