Repository navigation
Composer: extract nine hooks and five components into src/components/composer/ (#1447 pass K) - #1463
Merged
Merged
Conversation
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Called where the block stood, so its thread/toggle reset effect keeps its place in Composer's effect order. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The speech block (state, refs, dictation callbacks and its two effects) was contiguous; the hook is called at the same spot, so the speech:changed subscription and the disabled-cancel effect keep their order. The coderSpeech/coderOn/SpeechSnapshot/speechMicLabel helpers move with it. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The attachment block (per-thread chip state, add/remove/clear and its two effects) was contiguous and is called in place, so the strip-images and incoming-attachment effects keep their order. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Contiguous block (per-thread cards, expanded state, the overflow re-sync effect, add/remove/clear) called in place; the render-time pasteCardsRef write still happens at the same point in render. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The mention state sat at one spot and its four callbacks about 90 lines later, past the slash block and the thread-switch effect. The hook has no effects (only useState/useRef/useCallback), so calling it at the state's spot moves hook slots but cannot change the order any effect runs in. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The slash block has no effects, so calling it in place cannot reorder Composer's effects. lastEscAt, which sat inside the block but belongs to the Esc interrupt, stays in Composer right after the call (a ref, no effect). Co-Authored-By: Claude Opus 5.5 <[email protected]>
One window keydown effect with no inputs, called where it stood, so the listener registers in the same order relative to the Esc handler. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The document Esc effect (dictation cancel, stop run, double-Esc rewind) was one effect; it is called where it stood, so it still registers after the popover/focus effects and before the transcript shortcuts. Its escapeConsumedByChrome and DOUBLE_ESC_MS helpers move with it, and SpeechSnapshot is exported for the ref's type. Co-Authored-By: Claude Opus 5.5 <[email protected]>
A single layout effect, called where it stood: after the useModalFocus pair and before the best-of-N focus effect and the Manage return-focus layout effect, so layout-effect order is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…rPopups JSX-only components with no hooks; Composer still decides when each is open. Props keep the names of the values they carry so the bodies move unchanged apart from indentation. Co-Authored-By: Claude Opus 5.5 <[email protected]>
JSX-only, no hooks; Composer still renders it only when replyTo is set. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t.tsx JSX-only, no hooks; expanded state stays in usePasteCards. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ontrols JSX-only, no hooks; the speech state and handlers stay in useComposerSpeech. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Closed
4 tasks
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.
Round 4, pass K of #1447. This extracts nine hooks and five presentational components from the
Composercomponent intosrc/components/composer/, one commit each. The state map, candidates and reasoning are indocs/superpowers/specs/2026-10-05-composer-split.md.Hooks:
useComposerSpeech(299 lines),useSlashMenu(134),useMentionMenu(123),useEscapeInterrupt(95),useComposerAttachments(93, pluskeepList),usePasteCards(65),useOptionsPopoverPlacement(41),useTranscriptViewShortcuts(38),useComposerVim(15).Components:
AttachmentChip(moved as is),ComposerPopups(mention and command listboxes),ReplyChip,PasteCardList,SpeechControls(mic pill and download confirm).Composer.tsx: 3,531 → 2,659 lines.Stopped before the model picker. Its state is opened and closed from the slash menu, send, attach and every pill. Its 3 effects are interleaved with the mousedown effect and
useEscapeClose/useModalFocus. Moving it would reorder effects.Checked
Composerwith the new one, expanding each custom hook at its call site. Both have the same 17 effects with the same kind and opening line, in the same order.useState/useRef/useReducer). They are pure renders of their props, so the new component boundaries can't reset state.npm run typecheckandnpx vite buildare clean. Renderer suite: 2701/2701, 0 cancelled (TAP count).🤖 Generated with Claude Code