Repository navigation
refactor(site/src/pages/AgentsPage): extract the composer runtime from AgentChatInput - #30632
Closed
DanielleMaywood wants to merge 1 commit into
Closed
DanielleMaywood wants to merge 1 commit into
DanielleMaywood wants to merge 1 commit into
Conversation
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 4 of the stack that splits #30545 into small mergeable PRs. Depends on #30629.
Moves the composer runtime out of
AgentChatInput.tsxintocomponents/AgentComposer/:context.ts: the bindings types and the publicstate/actions/metacontract.useComposerRuntime.ts: submission coordination, derived send/stop state, and send shortcut labels.useComposerEditor.ts: the delegatinginputRefhandle, prompt history session, and speech input.composerFiles.ts: a plain function for file routing and upload readiness.AgentChatInputkeeps its exact public props, callsuseComposerRuntime, and reads state and actions from it. The UI (options menu, badges, frame, mobile dropdown geometry, Escape handling) stays inAgentChatInputfor later PRs.There is no intended behavior change. The existing
AgentChatInputtests and stories pass unmodified, and this PR adds no tests.Key decisions
hasModelOptionsstill gates sending. File routing keeps the current workspace-required and unsupported-type branches and toasts. An empty Enter still promotes the first queued message while editing history. Speech start has no new guard. Escape handling is unchanged. File bindings keep their current optional fields, so the upload-union and requiredworkspaceUploadschanges stay in their own PRs.remountKey. A remount now ends the session by derivation, which replaces the old reset effect and its refs. Arrow and Escape navigation produce the same results.focus(), notfocusWhenEditable()).ComposerContextanduseAgentComposerare deferred to the compound UI PR. Nothing would consume them yet, and knip rejects unused exports. Only the contract types that have consumers are exported.AgentChatInputdestructuresmetabefore rendering.metaholds the editor ref, so the React Compiler refs lint rejectsmeta.xreads in JSX.AgentChatInputcombinesstate.showSendButton/state.showStopButtonwith its ownreadOnlyNoticecheck, which keeps that concept out of the runtime.Generated by Coder Agents on behalf of @DanielleMaywood.