Skip to content

refactor(site/src/pages/AgentsPage): compose AgentChatInput from compound composer parts - #30633

Closed
DanielleMaywood wants to merge 1 commit into
refactor/agents-composer-runtimefrom
refactor/agents-composer-compound-parts
Closed

DanielleMaywood wants to merge 1 commit into
refactor/agents-composer-runtimefrom
refactor/agents-composer-compound-parts

Conversation

@DanielleMaywood

Copy link
Copy Markdown
Collaborator

Part 5 of the stack that splits #30545 into small mergeable PRs. Depends on #30632.

Adds the core compound composer parts in components/AgentComposer.tsx and components/AgentComposer/Frame.tsx, plus ComposerContext/useAgentComposer, and rebuilds AgentChatInput's JSX from them. The parts are Provider, RuntimeProvider, Frame, Editor, Attachments, Toolbar, VoiceInput, Submit, SaveEdit, Stop, InterruptStatus, InvisibleCharacterWarning, Warning, and EditBanner. The model selector, plus menu, badges, MCP, and workspace picker stay inline in AgentChatInput for the options PR.

There is no intended behavior change. AgentChatInput keeps its exact props, and the existing AgentChatInput tests and stories pass unmodified.

Key decisions
  • Frame keeps this base's handlers. Escape cancels a history edit or interrupts the stream with no portal containment check and no loading guard. Drag handlers are attached only when files can be attached, and dragover always calls preventDefault. Read-only views pass their border through className.
  • Attachments owns the preview dialogs and keeps them isolated from Frame. On the base, the dialogs rendered outside the composer, so their React events never reached it. Inside Frame, Escape in a preview would cancel an edit and a file dropped on a preview would attach. A wrapper that is rendered only while a preview is open stops Escape keydown and drag events from bubbling to Frame. Nothing in the app listens for Escape or drag events above the React root. The wrapper can go away when the portal containment fix lands. Attachments also accepts the existing onTextPreview override.
  • AgentChatInput calls the runtime and injects it through Provider. Its inline options UI still reads runtime state, so it can't sit below RuntimeProvider. RuntimeProvider is included for upcoming assemblies.
  • Submit labels itself Save Edit, Queue, or Send. Picking SaveEdit or Submit by mode would remount the button whenever history editing toggles. The base keeps one button instance, which preserves focus. SaveEdit exists for assemblies that want it explicitly.
  • Contract changes.
    • useComposerRuntime takes needsSetup, which Frame reads.
    • actions.removeAttachment is optional, so Attachments shows the attachment strip only when removal is wired, as the base did.

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