Repository navigation
refactor(site/src/pages/AgentsPage): compose AgentChatInput from compound composer parts - #30633
Closed
DanielleMaywood wants to merge 1 commit into
Closed
DanielleMaywood wants to merge 1 commit into
DanielleMaywood wants to merge 1 commit into
Conversation
…ound composer parts
Collaborator
Author
|
Closing stack until can be re-prioritized |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Part 5 of the stack that splits #30545 into small mergeable PRs. Depends on #30632.
Adds the core compound composer parts in
components/AgentComposer.tsxandcomponents/AgentComposer/Frame.tsx, plusComposerContext/useAgentComposer, and rebuildsAgentChatInput's JSX from them. The parts areProvider,RuntimeProvider,Frame,Editor,Attachments,Toolbar,VoiceInput,Submit,SaveEdit,Stop,InterruptStatus,InvisibleCharacterWarning,Warning, andEditBanner. The model selector, plus menu, badges, MCP, and workspace picker stay inline inAgentChatInputfor the options PR.There is no intended behavior change.
AgentChatInputkeeps its exact props, and the existingAgentChatInputtests and stories pass unmodified.Key decisions
Framekeeps 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, anddragoveralways callspreventDefault. Read-only views pass their border throughclassName.Attachmentsowns the preview dialogs and keeps them isolated fromFrame. On the base, the dialogs rendered outside the composer, so their React events never reached it. InsideFrame, 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 Escapekeydownand drag events from bubbling toFrame. 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.Attachmentsalso accepts the existingonTextPreviewoverride.AgentChatInputcalls the runtime and injects it throughProvider. Its inline options UI still reads runtime state, so it can't sit belowRuntimeProvider.RuntimeProvideris included for upcoming assemblies.Submitlabels itself Save Edit, Queue, or Send. PickingSaveEditorSubmitby mode would remount the button whenever history editing toggles. The base keeps one button instance, which preserves focus.SaveEditexists for assemblies that want it explicitly.useComposerRuntimetakesneedsSetup, whichFramereads.actions.removeAttachmentis optional, soAttachmentsshows the attachment strip only when removal is wired, as the base did.Generated by Coder Agents on behalf of @DanielleMaywood.