Repository navigation
refactor(site/src): simplify AgentChatPageView (stage 1 cleanup) - #31476
Merged
Merged
Conversation
DanielleMaywood
commented
Oct 29, 2026
DanielleMaywood
left a comment
Collaborator
Author
There was a problem hiding this comment.
This review was performed by ai-review, an automated review bot.
4 inline findings.
Coverage
Coverage: 13 of 13 files reviewed; 35 rules.
Candidates: 298 found, 286 outside changed lines, 0 already discussed, 12 evaluated.
Findings: 4 (7 sites, 5 pre-existing sites), 0 over budget, 0 failed.
Model: deepseek/deepseek-v4.1-flash; 6 questions, 6 answered, 0 abstained, 0 cached; 0 uncalibrated findings held back; 5015 input and 7175 output tokens.
DanielleMaywood
force-pushed
the
refactor/agents-chat-page-view-cleanup
branch
from
October 29, 2026 12:19
3aa1e41 to
a631ee3
Compare
DanielleMaywood
marked this pull request as ready for review
October 29, 2026 13:03
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
…eView Remove unreachable UserTabContent fallbacks (validateUserRightPanelTabs already drops those tabs), a support check the add-tab menu already applies, the shouldShowSidebar alias, no-op flex-row classes, an unused test id, stray text nodes, redundant agentId keys (KeyedAgentChatPage already keys the subtree), and a read-only term implied by canSubmitChatTurn.
QueuedForCapacityCallout reads entitlements and permissions itself, WorkspacePill fetches the deployment SSH config to build its command, and ChatWorkspaceContext wraps only the timeline, its sole consumer.
Separate the logical steps in the tab list and the open-tab handlers with blank lines.
DanielleMaywood
force-pushed
the
refactor/agents-chat-page-view-cleanup
branch
from
October 29, 2026 13:06
a631ee3 to
08c6e70
Compare
jakehwll
approved these changes
Oct 29, 2026
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.
Note
This PR was generated by Coder Agents on behalf of @DanielleMaywood.
Simplify some code
LLM Slop Description
Stage 1 of the
AgentChatPageViewsimplification, limited to changes that keep behavior the same.UserTabContentfallbacks, a support guard the add-tab menu already applies, theshouldShowSidebaralias, no-op classes, an unused test id, stray text nodes,agentIdkeys thatKeyedAgentChatPagealready provides, and a read-only term implied bycanSubmitChatTurn.QueuedForCapacityCalloutreads entitlements and permissions itself,WorkspacePillfetches the deployment SSH config itself (thesshCommandprop is gone from four components), andChatWorkspaceContextwraps only the timeline, its sole consumer.Behavior changes from the plan (computing tab visibility once, which fixes Desktop connecting behind a closed panel, and saving tabs on write with the built-in Terminal as a synthesized tab) are left for separate PRs with their own tests. Also not included: rebasing #30638, and moving the drag value into
RightPanel. Overlaps with open #31286 and #30638.Design review and plan
AgentChatPageView: why it looks like this, and how to simplify it
Scope:
site/src/pages/AgentsPage/AgentChatPage/AgentChatPageView.tsx(1125 lines) and its containerAgentChatPage.tsx(870 lines), onorigin/maina512a7f (2026-10-29). Line numbers below refer to that commit. "View" = AgentChatPageView.tsx, "Page" = AgentChatPage.tsx.Method: four read-only research lanes (git history, PR bodies, review threads), one cross-check of the 8 most load-bearing claims (7 confirmed, 1 uncertain, 0 refuted), then three parallel design passes under different constraints. Confidence is high unless marked.
1. Headline numbers
editingfields. It had 82 before refactor(site/src/pages/AgentsPage): extract AgentChatPage helpers and hooks #29032.AgentChatPageLoadingView, and the router Suspense fallbackAgentChatPageSkeleton. They have drifted three times (fix(site): prevent layout shift when agent chat right panel loads #22983 layout shift, fix(site/src/pages/AgentsPage): preserve chat input typed while loading #26415 lost typing, fix(site/src/pages/AgentsPage): size embedded agent chat to viewport #29602 missingh-full).2. Root causes
<ChatPageInput />#29118) moved reads into the leaves but deliberately stopped at the send pipeline. refactor(site/src/pages/AgentsPage): extract AgentChatPage helpers and hooks #29032 says the send pipeline and View "stay put". refactor(site/src/pages/AgentsPage): pass Chat instead of sliced chat flags #29064 says "Handlers stay props". refactor(site): drive plan mode from mutation pending state #29117 made mutation pending state driveisInputDisabled. The View became a relay. You noted the cost on refactor(site/src/pages/AgentsPage): extract AgentChatPage helpers and hooks #29032 ("So many props getting drilled").chatnorstore, so it was split off (refactor(site): separate AgentsPage and AgentDetail into container/view pairs #22812) and its layout copied.3. Catalogue: what each part does, why, and whether the reason still holds
Verdict key: Keep, Move (to the owner named), Delete.
3.1 Prop relay (Page to View)
submitChatTurnandisInputDisabledread them (Page 507-520, 654-698). #29032, #29064, #29117providerCount,modelCount,unsupportedProviderNames,canConfigureAgentSetup)AgentCreateFormalready derives the same values itself (AgentCreateForm.tsx 542-652)sshCommand(Page 613-616)SSHButtonalready readsdeploymentSSHConfigitselfurlTransform,gitWatcher3.2 Chat column
liveChatStatus(326, 834)isViewerNotOwner. #30483 itself lists "one viewer-permission check" as a follow-upattachedWorkspace,preferredFolder(397-421)onImplementPlan/onSendAskUserQuestionResponsegating (894-903)isOtherUserReadOnly ||is redundant in production:isInputDisabledalready includes viewer-not-owner (Page 242-243, 515-520)undefinedwhen a turn can't be submittedonEditUserMessagegating (886-890)QueuedForCapacityCalloutis the only consumer, and the stories already drive it through providers (cross-check confirmed)initialActiveTurnMaxMessageId+initialMessages(332-341)key={agentId}on the View (Page 787) and on ChatPageTimeline (875)KeyedAgentChatPagealready keys the whole subtree (Page 854-867)3.3 Right-panel tab model
sidebarTabIdsave is historical only. The effects write"[]"on every mount, and they rewrite state if a chat is unarchived while open (cross-check confirmed)validateUserRightPanelTabs(445)UserTabContentfallbacks (200-265)defaultTerminalHidden, 357, 450, 549-554, 688-704)reconnectionToken = chatId(cross-check confirmed)getEffectiveTabIdfalls back to the first tab (496)ChatsSidebar/3.4 Activation and tab content
onOpenDesktoponly when the panel can render (511-518)onReadyonce per mount, so the guard is requiredWorkspaceAppFrame.activedisplay:noneto invisible-but-laid-outTerminalClientSessionContext(366, 809)ChatWorkspaceContext(810)3.5 Layout, expansion, loading
isOpen(cross-check confirmed)isOpen &&into RightPaneldragVisualExpandedrelay (342-349, 971)hidden, which is visually redundant because the expanded panel isabsolute inset-0 z-30(medium)--agents-chat-panel-min-width,max-lg:hidden,h-fullshouldShowSidebar,flex-row,data-testid="agents-chat-panel",{" "}handleLoadingDraftChangeseed4. The three alternative designs
All three agree on Section 3's Delete/Move rows. They differ on the right panel and on page composition.
Design A: Delete and colocate (no new abstractions)
composernode.AgentChatRightPanel(about 440 lines, 16 props): user tabs, the terminal flag, pending, expansion, content.AgentChatLayout(about 35 lines): the frame shared by loading, loaded and Suspense.:hasdata-attribute coupling.Design B: Layout shell with slots (dissolve the View)
AgentChatPageShell(about 140 lines) withtopBar,notices,main,composerandrightPanelslots renders every state: loading, loaded, error, not-found and Suspense.ChatRightPanelowns all tab state. Tools reach it through an imperativeref.open(target).Design C: Feature-owned tabs
{ isActive, isShown, isExpanded }once and callstab.render(view).useSingletonTab,reduceRightprovider nesting, hooks returning render closures.Comparison
5. Recommendation: A's cleanup, then decide on C's ownership principle (without its framework)
Measure progress by contracts, duplicated decisions and effects removed, not by the View's line count.
Stage 1: design-agnostic cleanup (all three designs agree). Each item is an independent PR.
UserTabContentfallbacks, repeated support checks, aliases, no-op classes, unused test id, inner keys, the redundant read-only gating term.sshCommandinto WorkspacePillChatWorkspaceContextaround the timeline onlyattachedWorkspace, and the Page gates the turn-action handlers. Making the timeline a node too is a separate, optional PR.Stage 2: reassess. After Stage 1 the View is mostly a list of regions plus tab activation. Two choices:
Stage 3, only if Preview still hurts: apply C's principle at the smallest scale.
reduceRight, no storage migration, no shared read-modify-write keys.Not recommended for now: B's imperative ref, C's registry and seeded-terminal migration, and any new controller or provider around the whole page.
6. Decisions needed from you
7. Risks to validate during implementation