Skip to content

refactor(site/src/pages/AgentsPage): split ChatTopBar into chatless frame and loaded bar - #29902

Closed
DanielleMaywood wants to merge 4 commits into
mainfrom
nullability/chat-top-bar
Closed

DanielleMaywood wants to merge 4 commits into
mainfrom
nullability/chat-top-bar

Conversation

@DanielleMaywood

Copy link
Copy Markdown
Collaborator

Stacked on #29890.

ChatTopBarProps.chat was optional only because the loading, error, and not-found views rendered the bar without a chat. The loaded page always passes a Chat. This splits the component:

  • ChatTopBarFrame renders the shared layout (back button, sidebar expand button, title area, PR slot, share slot, panel toggle). The loading and not-found views in AgentChatPageView.tsx and AgentChatPageErrorView.tsx use it directly, with the same no-op panel toggle as before.
  • ChatTopBar now requires chat: Chat and fills the frame's slots, removing the repeated chat?., chat !== undefined, and chat ? ... : false checks.
  • getParentChatID now requires a Chat; the undefined test case is removed.
  • The NoTitle story renders ChatTopBarFrame, keeping its story ID and screenshot.

Rendered markup is unchanged for every view.

Part of the AgentsPage nullability cleanup; see #29888 for the methodology.

Verified: pnpm lint:types, pnpm check, pnpm lint:oxlint, pnpm lint:compiler, pnpm lint:knip, pnpm test src/pages/AgentsPage, and pnpm test:storybook for ChatTopBar, AgentsPageLayout, and AgentChatPageView stories.

Plan excerpt

Analysed on a local, unpushed merge of all cleanup branches; ranking script local only. After the bottom-up PRs only 43 dead slots remain, so what's left is nullability that is real at its origin. Two read-only agents reviewed the top origins in code. Guard counts from the tool overstate the win: many "guards" are real branches (loading, no workspace, first/last row).

# Change Guards removed Size Risk
T2 Split ChatTopBar into ChatTopBarFrame (used by loading/error/not-found views) and ChatTopBar({ chat: Chat }) ~14 chat checks, getParentChatID(undefined) ~6 files / 75 lines Low; keep frame DOM identical

This PR was generated by Coder Agents on behalf of @DanielleMaywood.

@linear-code

linear-code Bot commented Sep 30, 2026

Copy link
Copy Markdown

CODAGT-1258

… props

AgentChatPage, AgentChatPageView, ChatPageContent, AgentCreateForm
and AgentChatInput always pass the composer, page shell, attachment
preview and skills menu props below, but the receiving components
still declared them optional and defaulted or guarded them.

Make them required and drop the dead defaults and guards:
AgentChatPageView and its loading view props, ChatPageTimeline and
ChatPageInput editor, MCP and loading props, AgentChatInput
initialValue/onContentChange/plan mode/catalog loading,
ChatMessageInput, SkillsTriggerMenu and AttachmentPreview callbacks
and flags. ChatMessageInput always autofocuses, so its autoFocus prop
is removed. Tests and stories now pass the values production sends;
the story for plan mode without a toggle handler is removed.
@DanielleMaywood
DanielleMaywood force-pushed the nullability/chat-top-bar branch from 64dc088 to fff2b48 Compare October 6, 2026 11:18
Base automatically changed from nullability/chat-input to main October 6, 2026 12:30
@github-actions github-actions Bot added the stale This issue is like stale bread. label Oct 31, 2026
@github-actions github-actions Bot closed this Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale This issue is like stale bread.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant