Repository navigation
refactor(site): prototype compound agent composer - #30545
Closed
DanielleMaywood wants to merge 18 commits into
Closed
DanielleMaywood wants to merge 18 commits into
DanielleMaywood wants to merge 18 commits into
Conversation
This was referenced Oct 12, 2026
Closed
This was referenced Oct 12, 2026
Closed
Closed
Closed
Collaborator
Author
|
Closing as not-planned for now |
This branch was previously deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Refactor the AgentsPage composer around Vercel's composition skill and compound-components tutorial. Replace the flat API with explicit create/loading/chat assemblies, an injectable
state/actions/metacontract, and independently arranged model/menu/planning/badge controls. History editing swaps actions without remounting the runtime or options provider.Following adversarial Opus 5.5 and state-space reviews, keep DOM interactions and preview state local to their UI owners, use additive draft/editor/file/chat contracts, and share workspace-change capabilities and MCP predicates. Remove redundant model gates, fake loading callbacks, unsupported file branches and the non-hook upload wrapper. Preserve domain controllers, uncontrolled Lexical, retained handles, upload lifetimes, OAuth continuity and all 73 composer story IDs. No new dependencies or state store. Current net growth: +1,326 lines (+568 production, +180 stories, +578 tests). The latest test cull removes 558 net test lines while retaining refactor-risk regressions; the PR is still not a net deletion win.
Experimental draft. Full AgentsPage unit suite: 2,083 passed, 2 existing skips. All 212 affected Chromium stories passed. Final format/check/full lint, TypeScript, React Compiler, circular-dependency and unused-code checks passed. Opus re-reviewed the integrated changes, and actionable findings were fixed. CI was not checked, as requested. Manual visual inspection remains unverified; browser story tests are not Pixel screenshot comparisons. Workspace dismiss controls now remain enabled when only submission is disabled.
Implementation plan and reviewed architecture decisions
Keep explicit NewAgentComposer, LoadingChatComposer, and ChatComposer assemblies rather than a generic mode-configured component. The page view accepts a composer node instead of forwarding composer props or calling a render callback. Preserve provider identity during history editing so OAuth and recording lifetimes survive; only banner/action leaves switch.
Keep the public injectable provider separate from its default implementation. Name the latter AgentComposerRuntimeProvider and inline its small implementation. Expose a destructured editor RefObject in metadata; the compiler accepts it without registration closures. Preserve the lazily delegating imperative handle across Lexical remounts.
Narrow the public contract: Frame owns drag presentation and DOM event translation, Menu owns the hidden file input, and Attachments owns image/text preview dialogs. Menu attachment does not depend on mounting Attachments. File routing is a domain action; attachment/workspace removal callbacks are actions, while attachments/maps/workspace entries are state. Isolate dialog Escape from interruption/history cancellation and cover both preview types and both actions.
Use named additive editor/draft/file/chat contracts and exported model/editor types instead of nested exclusion lists. New and Chat require complete file groups; Loading has only editor initialization, content notifications, and disabled state. Keep queue/context optional for standalone assemblies and existing visual scenarios. Do not fabricate required callbacks or alter screenshots solely to tighten types.
Share setup readiness and history-edit layout through core context instead of forwarding sibling facts. Keep send/stop/accept precedence explicit, document recording precedence, and avoid the nested submit-icon ternary.
Keep options separate from the core draft contract. Derive only the shared workspace-change capability in its provider: the caller supplies onChange and selection is not pending. Submission disablement does not prevent workspace selection or removal. Badges derive their ordered descriptors locally; Menu and Badges share MCP enablement, selection and authentication predicates. Preserve grouping, OAuth exclusion, measurement and overflow ordering. Use stable badge keys, a placement enum, and direct linked-workspace data rather than prop bags.
Let Radix own purely local MCP-group and desktop workspace-popover open state. Choose mobile workspace navigation explicitly. Workspace views read selection data from context; navigation/dismissal callbacks stay explicit. Keep OAuth/disconnect state at the Menu root so it outlives portaled content.
Derive read-only and attached-workspace presentation in ChatPageInput, removing page/story copies. Pass MCP settings as one group; gate whole-chat slash commands in ChatComposer while editing. Keep preferred-folder calculation near the page's git watcher.
Keep explicit completion focus, not a loading-transition effect. Use focusWhenEditable() only for completion sites that may run before the re-enable commit. Ordinary focus() is immediate and does not create a deferred request. Preserve readiness/remount deferral, desktop-only behavior, and one-shot consumption; do not change intervening-user-focus policy in this refactor.
Retain consolidated history snapshots and monotonic editor generations; remove the redundant generation from the expected-value ref. Lexical remains authoritative for document, selection, undo, and file references. No controlled draft mirror or new state store.
Keep discriminated upload states with correlated success/error payloads and registry snapshots. Preserve cancellation, retry, persistence warnings and absent map entries. Treat tests as refactor-risk coverage, not a coverage target: remove alternate-provider fixtures, repeated matrices, wiring trivia and broad history/focus scenarios when representative behavior remains.
Delete the AgentChatInput compatibility shim and use canonical imports. Rename test/story files to AgentComposers while retaining the story title and IDs. Avoid a wholesale directory move, optional inlining of New, or unrelated lifecycle rewrites.
Tighten state-space behavior without new effects: files cannot join a bucket during send cleanup, read-only uploads and recording starts are refused, and file drops prevent browser navigation even when attachment actions are unavailable. Empty edited Enter cannot promote the queue; Enter cannot save a streaming edit, and Escape cannot cancel a pending save. Frame ignores Escape from portaled controls rather than requiring per-dialog wrappers. Retain streaming queue promotion, deferred retries and editable voice drafting while submission is disabled.
Deliberate remaining tradeoffs:
Generated by Coder Agents on behalf of @DanielleMaywood.