Repository navigation
feat(chat-core): Composer root + Voice atom; ChatPane gains dictation (P3-b) - #9787
Conversation
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify the "ChatPage behaviour unchanged" claim: What this change shipsInventory (10 items) — 6 justified, 4 harm-free ridersIntent: give Crew-Member DM threads and split panes the microphone the main chat already has (#9775), by moving dictation out of host-wired props — a FIX, delivered as one slice of a planned extraction (RFC updated in the same commit, as the docs rule mandates).
More than 10: locale strings ×14 and the capture harness + 16 screenshots are omitted — the latter follows a counted repo convention (467 sibling Depth check that carried the verdict: the fix sits at CAUSE level for the reported defect — per-host prop plumbing is what let a host ship without the feature, and the root+atom removes that class for voice. The same cause's siblings (paste, mention, slash/skills, editor/send) are counted and deferred with issue numbers (#9807, #9808, P3-c…f) in both the description and the RFC — accepted-and-deferred, not a point patch. The rewritten inbox header pin ("a second mount would silently detach the first") is removed on the pin's own stated premise (route exclusivity) no longer holding, with the pin quoted in the PR — evidence supplied, not recast as "stale". The deliberately absent [FIRST-PRINCIPLES-REVIEWED] 545e664 |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Root-cause fix with the right shape: the atom removes the "host forgot to wire it" bug class, ships no writerless flags, and updates RFC + spec in-commit. The strangler slice is proportionate (context root now, Suggestions
[DESIGN-REVIEWED] 545e664 |
UX Review (Fable 5) — ✅ PASSUX-level review of UX-Verdict: PASS Cold reader correctly identified every voice control — mic, busy-elsewhere row, chat-name jump, "Type instead", "Dictation added" — across all sixteen shots, both themes. [UX-REVIEWED] 545e664 |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Opus 4.8 Review — ✅ no blocking findingsReviewed Review detailsNo findings. The sole candidate — [OPUS-REVIEWED] 21d4bc3 Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
ac5faf5 to
2aa3700
Compare
|
self-added: yes
|
|
self-added: yes
|
|
|
|
|
|
Intent: Give Crew Members DM threads and split panes a working microphone by making dictation a |
|
self-added: yes
|
|
|
self-added: yes
|
|
self-added: yes
|
|
aaa3ad8 to
545e664
Compare
|
self-added: yes
|
|
self-added: yes
|
|
|
self-added: yes
|
… (P3-b)
Crew Members DM threads and split panes had no microphone: ChatInput
learned about dictation through 23 voice*/onVoice* props that only
ChatPage wired. Wiring them into ChatPane would close today's gap and
reopen it with the next capability.
- RFC §3 layer 4 / §4 P3: the composer becomes a `Composer` root plus
atoms that own their own state and read one small context
({ slotKey, editor onChange/inputRef, capabilities }); surfaces
compose; no atom imports the store (#8651). ChatInput becomes a
preset composition of atoms slice by slice (P3-c..f).
- chat-core/composer/Composer.tsx: root + context + Composer.Voice.
The atom runs useComposerVoice (ChatPage's dictation block, extracted
verbatim) and publishes its state into the root; ChatInput renders
the atom and reads that state with one hook; its 23 voice props are
deleted. ChatPage wraps ChatInput in the root and hands the atom only
what it cannot know (on-screen predicate, off-screen draft delivery,
auto-submit, push-to-talk, caret refs) — behaviour unchanged. ChatPane
wraps ChatInput in the root with queue:false (#8852) and gets a mic.
- One microphone across mounted composers (module-level capture owner;
other mics read it as voiceTranscribeActive, prewarm withheld).
- voiceTranscriptInbox becomes multi-subscriber: begin fans out, settle
delivers text once — to the owner, else to a subscriber that accepts
unowned text, else HELD until a composer for that session is back on
screen (redeliverPending on slot change). No unowned drop.
- VoiceDictationPanel header wraps at pane width so the device name is
readable and the keyboard hint takes its own line.
- ChatInput dictation tests migrate to the ComposerVoiceSliceOverride
seam; new tests for the root, the pane, the mutex and the inbox.
- Capture harness + before/after screenshots (temp-screenshots/).
Closes #9775
545e664 to
21d4bc3
Compare
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsFINDING -- website/src/components/ChatPane.tsx:292 -- False positive or not applicable? A repository writer can comment: |
|
… (P3-b) (kirodotdev#9787) Crew Members DM threads and split panes had no microphone: ChatInput learned about dictation through 23 voice*/onVoice* props that only ChatPage wired. Wiring them into ChatPane would close today's gap and reopen it with the next capability. - RFC §3 layer 4 / §4 P3: the composer becomes a `Composer` root plus atoms that own their own state and read one small context ({ slotKey, editor onChange/inputRef, capabilities }); surfaces compose; no atom imports the store (kirodotdev#8651). ChatInput becomes a preset composition of atoms slice by slice (P3-c..f). - chat-core/composer/Composer.tsx: root + context + Composer.Voice. The atom runs useComposerVoice (ChatPage's dictation block, extracted verbatim) and publishes its state into the root; ChatInput renders the atom and reads that state with one hook; its 23 voice props are deleted. ChatPage wraps ChatInput in the root and hands the atom only what it cannot know (on-screen predicate, off-screen draft delivery, auto-submit, push-to-talk, caret refs) — behaviour unchanged. ChatPane wraps ChatInput in the root with queue:false (kirodotdev#8852) and gets a mic. - One microphone across mounted composers (module-level capture owner; other mics read it as voiceTranscribeActive, prewarm withheld). - voiceTranscriptInbox becomes multi-subscriber: begin fans out, settle delivers text once — to the owner, else to a subscriber that accepts unowned text, else HELD until a composer for that session is back on screen (redeliverPending on slot change). No unowned drop. - VoiceDictationPanel header wraps at pane width so the device name is readable and the keyboard hint takes its own line. - ChatInput dictation tests migrate to the ComposerVoiceSliceOverride seam; new tests for the root, the pane, the mutex and the inbox. - Capture harness + before/after screenshots (temp-screenshots/). Closes kirodotdev#9775
Problem / Motivation
Crew Members DM threads and split panes have no microphone. Both mount
ChatPane, which renders the sameChatInputas the main chat, butChatInputlearns about dictation through 23voice*/onVoice*props that onlyChatPagewires. The pane wired none of them, so the mic button never rendered. User report: "the Crew Member UI is still missing features, e.g. voice input." (#9775)Why it matters
ChatInputis 4,900 lines with 110 props. Every capability is one more row of prop plumbing at every host, and a host that skips a row ships without the feature. Wiring 23 more props intoChatPanewould close today's gap and reopen it with the next capability. The panes are the main surface for Crew Members (the perpetual-agent roster); a member you can only type at is a worse member.What changed (motivation → approach → change)
Goal. Give panes dictation, and stop the class of bug: a capability must not depend on a host remembering to wire it.
Approach. The composer becomes a
Composerroot plus atoms (RFC §3 layer 4, §4 P3 — text updated in this PR). The root holds one small context a host fills in a few lines:slotKeyand the editor'sonChange+ a liveinputRef. (Acapabilitiesrecord joins it with its first writer — the ChatEmbedembeddedpreset in P3-f; a surface that wants no dictation today simply does not mount the root, and no flag ships ahead of a writer.) Each atom owns its own state and hooks and reads the context. No atom imports the Redux store (#8651).ChatInputbecomes a preset composition of atoms one slice at a time; this slice moves voice. Paste, mention, slash/skills, editor/send/attach follow in P3-c…f (#9807, #9808).Change.
chat-core/composer/Composer.tsxis the root + context +Composer.Voice. The root mounts the atom beside the host's children; the atom runsuseComposerVoice(ChatPage's ~550-line dictation block, extracted verbatim: STT config,useVoiceInputengine, caret splice, disarm flags, slot-switch teardown, setup modal) and publishes its state into the root only when a value changed.ChatInputreads that state with one hook; its 23 voice props are deleted. (The atom is deliberately not a child ofChatInput: a subscriber that renders its own publisher is a render loop — React #185 — which CI caught on this PR's second head.)ChatPagewraps itsChatInputin the root and hands the atom only what it cannot know (the draft-settlement on-screen predicate, off-screen draft delivery, endpointer auto-submit, push-to-talk ownership, its caret refs) — behaviour unchanged.ChatPanewraps itsChatInputin the root and gets a mic; its steer-not-queue rule (#8852) stays oncanSteeruntil the Send atom exists. Both hosts also disarm live streaming dictation on steer, not only on send (GPT round 2).flowchart LR subgraph Before P1[ChatPage voice block ~550 lines]:::removed -->|23 props| I1[ChatInput]:::ctx N1[ChatPane]:::ctx -.->|nothing| I1 end subgraph After R[Composer root + context]:::added --> V[Composer.Voice atom]:::added V -->|publishes on change| I2[ChatInput reads one hook]:::changed P2[ChatPage]:::changed -->|wraps| R N2[ChatPane]:::changed -->|wraps| R end classDef added fill:#DCFCE7,stroke:#16A34A,color:#14532D,stroke-width:2px classDef changed fill:#FEF3C7,stroke:#D97706,color:#78350F,stroke-width:2px classDef removed fill:#FEE2E2,stroke:#DC2626,color:#7F1D1D,stroke-dasharray:4 3 classDef ctx fill:#E0F2FE,stroke:#0284C7,color:#0C4A6E linkStyle 0,1 stroke:#DC2626,stroke-dasharray:4 3 linkStyle 2,3,4,5 stroke:#16A34A,stroke-width:2px🟩 added · 🟨 changed · 🟥 removed · 🟦 unchanged
Dictation is an atom under a root. Any host that wraps
ChatInputin the root has a mic; nobody wires voice props.Two things had to change underneath for more than one composer to dictate. One microphone. The engine is per instance, so two panes could open two captures; a module-level capture owner in
useComposerVoicemakesstartVoiceexclusive (generation-scoped latch, so a double-click during startup cannot release it early), and the other composers read it asvoiceBusyElsewhere: the mic is disabled with aMicOfficon and a visible "Microphone in use in “kirocrew”" row above the textarea — it names the chat that holds the mic when the slot list knows it, "…in another chat" otherwise (in hold mode the same status row shows above a plain disabled hold bar; the name in the status row is a button that switches to that chat, so the user can go and end the capture in one click) — its own state, not the "Transcribing" spinner. A held transcript that lands later shows "Dictation added to your message" for a few seconds, so nobody re-dictates it. Mic errors now render throughErrorNotice(AUTOSDEerrors-use-error-notice), no hand-off since the composer holds an unsaved draft. The transcript inbox is a set.voiceTranscriptInboxheld one subscriber (its own header said a second mount would silently detach the first). Composers now co-mount, sobeginfans out (every mic reads the same in-flight fact) andsettlereleases busy everywhere but delivers the text once: to the subscriber whose composer owns the session; else to one that accepts unowned text (ChatPage's draft store); else it is held — one entry per result, not a single slot, so two dictations that both settle unowned both survive — until a composer for that session is back on screen (redeliverPendingon a slot change). A pane that switched slots during the/api/sttround-trip no longer loses the utterance.UX at pane width: the dictation panel's header row now wraps, so the keyboard hint drops to its own line and the device label may take the row (no width cap) instead of reading "Fa…".
Tests
Written, not run locally (CI runs them):
chat-core/composer/Composer.test.tsx— standaloneChatInputhas no mic; under a root the sameChatInputrenders the mic with zero voice props; the host handle reachesdisarmForSend.test/ChatPane.composerParity.test.tsx— the realChatInputinsideChatPanerenders the mic; pressing it starts the shared engine.chat-core/composer/useComposerVoice.test.tsx— a second composer is refused while the first holds the mic and readsmicBusyElsewhere; release on idle, failed start, unmount;voiceTranscribeActive+ withheld prewarm on the other composer. (Fixture fixed vs the first head: oneQueryClientper hook, seeded STT config.)hooks/voiceTranscriptInbox.test.ts— multi-subscriberbegin; owner-only text delivery with busy release everywhere; unowned text only to accepting subscribers; held-until-owner +redeliverPending(GPT F2 case); several held results each landing for their own session (GPT round 4); errors surface everywhere; scoped unsubscribe.ChatInput.dictation/holdToTalk/lexical/ChatInputCoveragemigrated: the voice states they drive now arrive throughComposerVoiceSliceOverride(the test seam) instead of props. New: the held-elsewhere mic renders "Microphone in use in another chat", disabled, no spinner, plus the visible status row; it names the owning chat in quotes ("Microphone in use in “kirocrew”") when that session is a known slot, and falls back to the unnamed copy when it is not; the name in the status row is a button that switches to that chat; in hold mode the keyboard switch shows a visible "Type instead" label and stays enabled mid-capture (pressing it discards the in-flight press and hands the keyboard back); the status row wraps rather than truncates, so the name button survives a long title at pane width; the "Dictation added" cue; no notice row while idle; a real transcription still wins the label; a same-instance double-start cannot release the mic (F2 round 2).VoiceStatusBar.testfollows the error branch ontoErrorNotice.test/ChatPage.sendDuringDictation.test.tsx— a batch transcript for a slot that is not on screen lands in that slot's persisted draft, never the live composer (deliverOffScreen).test/ChatPageDrafts.test.tsx— a prefill staged for another slot is neither shown nor consumed, an unreadable prefill is discarded, and a file dragged over the page cannot navigate away.ChatPage.tsxlost ~550 lines of voice wiring here, which dropped its per-file coverage to 79.7%; these pin the paths that were left uncovered.Verified locally:
npx tsc --noEmit,npx eslinton every touched file,I18N_BASE_REF=origin/main npm run i18n:check(two new strings,components.chatInput.mic_in_use_elsewhere/mic_in_use_in/type_label, in all 13 locales plus the pseudo-locale).Manual verification
Real pods, before = a
main-based pod, after = this branch. Members page →defaultmember DM: mic present; click → STT-off setup modal (pod has no provider); with/api/config/sttanswered on by the harness, click → realMediaRecordercapture on Chromium's fake device → dictation panel; Esc discards. Split view (poddashboard.session_gridon): recording in one pane blocks the other's mic with its own label. Held transcript:/api/stt/transcribeanswered 4s late by the harness; dictate indefault, stop, switch toradarbefore it answers, switch back — the text is in the composer.Screenshots / video
main)MicOff, disabled, and a visible "Microphone in use in " row above its textarea, naming the chat that holds itdefault's DM, switched toradarbefore STT answered, came back — text landed with a "Dictation added to your message" cueMic error (permission blocked) through ErrorNotice · mic click with STT off → setup modal
Harness:
website/scripts/capture-pane-composer-parity.mjs.Related Issues
Closes #9775
Follow-ups: #9807 (P3-c Paste atom), #9808 (P3-d Mention atom).
Checklist
feat|fix|docs|refactor|perf|test|chore|ci|build|revert: ...)