Skip to content

refactor(site/src/pages/AgentsPage): extract composer options into compound parts - #30634

Closed
DanielleMaywood wants to merge 1 commit into
refactor/agents-composer-compound-partsfrom
refactor/agents-composer-options
Closed

DanielleMaywood wants to merge 1 commit into
refactor/agents-composer-compound-partsfrom
refactor/agents-composer-options

Conversation

@DanielleMaywood

Copy link
Copy Markdown
Collaborator

Part 6 of the stack splitting #30545. Depends on #30633.

Moves the composer options UI out of AgentChatInput into compound parts:

  • AgentComposerOptions (Provider, Frame, Menu, Model, PlanningBadge, Badges) with its context in AgentComposerOptionsContext.ts
  • AgentComposerOptionsMenu, AgentComposerMCPMenu, AgentComposerWorkspacePicker, AgentComposerBadges
  • AgentComposerLayout (Container, SetupNotice, ContextIndicator, needsAgentSetup)

AgentChatInput keeps the same props and now assembles these parts under AgentComposer.RuntimeProvider. No behavior change is intended. The existing AgentChatInput tests and stories pass without changes, which shows behavior is preserved.

Key decisions
  • Pure pass-through provider. The reference's changeWorkspace capability is left out. The base gating stays on each control. The plus button and the workspace entry use onChange && !isLoading. Selecting or removing calls onChange directly. The dismiss X buttons stay disabled by isDisabled.
  • Base-shaped options data. mcp.onSelectionChange and the workspaceSelection fields are optional. setMCPServerSelected does nothing without a handler, the same as the base handleMcpToggle. AgentChatInput passes onSelectionChange only when selectedMCPServerIds is set.
  • isViewOnly flag (set from readOnlyNotice). It hides the menu trigger, renders the static model pill, and removes the badge, planning, and workspace pill dismiss actions, as the base does.
  • Menu keeps base markup and state. The Plan first button keeps its markup. The Attach file handler keeps its order. The desktop workspace flyout stays controlled at the menu root because the base state outlives plus-menu close, so uncontrolled Radix state would not be equivalent. The mobile view keeps its p-0 wrapper. The file input keeps its accept attribute.
  • Disconnect dialog isolation. The ConfirmDialog now renders inside the frame. A new FrameEventBoundary (also reused by Attachments) stops Escape and drag events, as when the dialog sat outside the frame. I checked this with a throwaway test against the previous PR: Escape and drop inside the dialog produced no interrupt, history-edit cancel, or attach on either branch, and dropping the boundary made the test fail. The boundary is hidden, so it adds no flex gap.
  • Badges keep the base keys and markup. That covers the position-qualified keys, workspace-pill and workspace-pill-overflow, the overflow trigger without tabIndex, and the controlled MCPGroupBadge with the lucide chevron. The shared MCP predicates are pure equivalents of the inline checks.
  • Planning placement. {!overflow && <PlanningBadge />}<Badges includePlanning={overflow} /> keeps the badge row at a stable position.
  • DOM-only differences. The stray {" "} text node inside the plus Popover is dropped (collapsed whitespace in a flex row, not rendered). The hidden file input moves from the frame into the options row. The planning badge's class order changes but its classes are the same.

Generated by Coder Agents on behalf of @DanielleMaywood.

@linear-code

linear-code Bot commented Oct 13, 2026

Copy link
Copy Markdown

CODAGT-1405

@DanielleMaywood

Copy link
Copy Markdown
Collaborator Author

Closing stack until can be re-prioritized

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant