Skip to content

ui-kit: let the composer host the hold-to-talk MicButton at rest and in review (D1, S1, D6) #3727

Closed

Description

@schlessera

Context

Part of #3690. #3692 shipped MicButton (packages/ui-kit/src/voice/MicButton.tsx:50) and VoiceField (packages/ui-kit/src/voice/VoiceField.tsx:52) with signed-off stories. Every story that draws the mic at rest or in review places it in a bare compact VoiceField: D1 (packages/ui-kit/stories/voice/_voice.tsx:78), D6 (_voice.tsx:100), S1 (_voice.tsx:143) and L10. That field holds only a placeholder or static words, the mic and, in D6, Send. The mockups on #3690 draw the same simplified field and caption D6 "back to a normal composer with Send".

The app's resting composer is not that field. It is the kit Composer (packages/ui-react/src/components/chat/composer-view.tsx:279), which draws the attach-menu trigger, an editable textarea, its own 28px mic IconButton (packages/ui-kit/src/chrome/Composer.tsx:332), the provider chip and hint line, and Send or Stop. Composer takes no caller-supplied control in the mic position, so MicButton cannot be placed there without a kit change. MicButton is also a 44px button with a 36px raised disc (packages/ui-kit/src/tokens.css:2832), while the composer field is drawn around 28px targets with 8px 10px padding (Composer.tsx:242). Its hint and "Talk live…" bubbles are positioned above the mic (tokens.css:2839).

No signed-off story shows MicButton inside the real composer. #3693 (hold the mic to open Start) and the D1/D6 states of #3694 cannot be wired with the components unchanged and no new visual design until this composition is designed and the kit can host it.

Scope

  • Design how MicButton sits in the resting composer beside the attach trigger, the editable textarea, the provider chip and hint line, and Send or Stop, at 320px and desktop widths in both themes. This includes the S1 hold state with its ring and the "Keep holding to talk live" hint, and the focused "Talk live…" action.
  • Design the D6 review composer: the editable dictated text with Send, and the mic ("Dictate more"). Say whether an uncertain-word mark can appear while the text stays editable, or whether D6 shows no mark in an editable field.
  • After sign-off, an additive kit Composer change that renders the caller's MicButton in the mic position, with stories and per-state visual baselines for D1, S1 and D6 in the real composer.

Out of scope

Acceptance criteria

  • A design ruling is recorded on this issue, with drawings at 320px and desktop, covering D1, S1, the focused "Talk live…" action and D6 in the real composer, including the local-recording mic ("Record on this device", ui-react: open the microphone for local recording without a server voice session #1012).
  • The kit Composer can render a caller-supplied mic control. Without one, it renders exactly as before, proven by unchanged existing baselines.
  • Stories and baselines exist for the resting composer with MicButton (idle, holding with hint, focused "Talk live…") and for D6 review, in both themes at 320px and desktop.
  • The package-api contract component and the API report record the new prop.

Verification

Visual baselines from the pinned container. A story play test proves the composer row does not overflow at 320px with the hint showing.

Contract impact

Additive: one new optional kit Composer prop, recorded in the package-api contract component in the same commit.

Design prompt

Read first:
- Epic #3690 (direction 3a, rulings V1-V5) and #3692 (the signed-off voice components).
- packages/ui-kit/src/voice/MicButton.tsx:50 and packages/ui-kit/src/tokens.css:2831-2843 (44px mic, 36px disc, hint and Talk live positions).
- packages/ui-kit/stories/voice/_voice.tsx:78 (D1), :100 (D6), :143 (S1): the mic only ever appears in a bare VoiceField.
- packages/ui-kit/src/chrome/Composer.tsx:230-243 (field box) and :332 (today's 28px mic IconButton).
- packages/ui-react/src/components/chat/composer-view.tsx:279 (the real composer: attach menu, textarea, provider chip, hint line, send/stop).
- docs/decisions/design-kit/navigation.md (D37: the composer is kit-owned; capture is a menu behind the paperclip).
- docs/decisions/live-conversation.md and docs/decisions/voice-permission.md (nothing is captured during a hold; approvals are never by voice).

Problem: the signed-off voice stories draw the resting composer as "Message + mic". The real composer also has an attach trigger, an editable multi-line textarea, a provider chip and hint line, and Send or Stop. The 44px raised MicButton has never been drawn inside it.

Design:
1. Where MicButton sits in the composer field, and whether the field grows from today's height to fit a 44px target or the mic sits outside the field. Draw it at 320px and desktop.
2. Where the "Keep holding to talk live" hint and the focused "Talk live…" action appear when the provider chip and hint line are present.
3. D6 review: the dictated words are editable in the textarea. Decide whether an uncertain word is marked in an editable field, or whether D6 shows no mark there.
4. The local-recording mic ("Record on this device", used when the host is unreachable): does it use MicButton with no hold, or keep today's control?

Requirements to hold: no change to MicButton's own visuals unless ruled here; 320px with no horizontal overflow; 44px touch targets; accessible names "Dictate" and "Talk live…"; amber is you and your mic, teal is brain; no capture during a hold.

Deliverable: ASCII or image mocks at 320px and desktop for D1, S1, focused Talk live and D6 in the real composer, and the kit prop shape. The hold ring itself is settled (V1, V4) and stays.

Decisions (maintainer, 2026-11-08)

  • M1: the offline "Record on this device" mic has no hold. It is a MicButton with no hint and no "Talk live…", and a hold acts as a tap. V4 (the ring fills, then explains) applies only while the host is reachable.
  • M2: D6 shows no honesty cue in the editable composer: no uncertain-word mark and no hint line. The dictated words appear as plain editable text, with "Dictate more" and Send. Drop the brief's dictated · check the words, then send hint.

2026-11-08: open decision questions answered by the maintainer and recorded above.

Activity

  1. added
    type: feat
    area: ui-kit
    priority: p2
    needs: design
    on Nov 8, 2026
  2. schlessera commented on Nov 8, 2026

    @schlessera
    OwnerAuthor

    Design needed. Already settled: the MicButton's own look, the 0.6 s hold (V1), the ring filling even when live conversation is unavailable (V4), and the D1–D8 and S1–S5 states as bare-field stories (#3692). Still open: how the 44px MicButton, its hint and its "Talk live…" action sit inside the real composer, next to the attach menu, the editable textarea, the provider chip, the hint line and Send. The code cannot decide this because no signed-off drawing shows them together. It blocks #3693 and the D1/D6 states of #3694. A self-contained prompt follows.

    Read first:
    - Epic #3690 (direction 3a, rulings V1-V5) and #3692 (the signed-off voice components).
    - packages/ui-kit/src/voice/MicButton.tsx:50 and packages/ui-kit/src/tokens.css:2831-2843 (44px mic, 36px disc, hint and Talk live positions).
    - packages/ui-kit/stories/voice/_voice.tsx:78 (D1), :100 (D6), :143 (S1): the mic only ever appears in a bare VoiceField.
    - packages/ui-kit/src/chrome/Composer.tsx:230-243 (field box) and :332 (today's 28px mic IconButton).
    - packages/ui-react/src/components/chat/composer-view.tsx:279 (the real composer: attach menu, textarea, provider chip, hint line, send/stop).
    - docs/decisions/design-kit/navigation.md (D37: the composer is kit-owned; capture is a menu behind the paperclip).
    - docs/decisions/live-conversation.md and docs/decisions/voice-permission.md (nothing is captured during a hold; approvals are never by voice).
    
    Problem: the signed-off voice stories draw the resting composer as "Message + mic". The real composer also has an attach trigger, an editable multi-line textarea, a provider chip and hint line, and Send or Stop. The 44px raised MicButton has never been drawn inside it.
    
    Design:
    1. Where MicButton sits in the composer field, and whether the field grows from today's height to fit a 44px target or the mic sits outside the field. Draw it at 320px and desktop.
    2. Where the "Keep holding to talk live" hint and the focused "Talk live…" action appear when the provider chip and hint line are present.
    3. D6 review: the dictated words are editable in the textarea. Decide whether an uncertain word is marked in an editable field, or whether D6 shows no mark there.
    4. The local-recording mic ("Record on this device", used when the host is unreachable): does it use MicButton with no hold, or keep today's control?
    
    Requirements to hold: no change to MicButton's own visuals unless ruled here; 320px with no horizontal overflow; 44px touch targets; accessible names "Dictate" and "Talk live…"; amber is you and your mic, teal is brain; no capture during a hold.
    
    Deliverable: ASCII or image mocks at 320px and desktop for D1, S1, focused Talk live and D6 in the real composer, and the kit prop shape. The hold ring itself is settled (V1, V4) and stays.
    
  3. schlessera commented on Nov 8, 2026

    @schlessera
    OwnerAuthor

    Design brief: MicButton in the real composer (D1, S1, Talk live…, D6)

    3727-mic-in-composer.png

    ui-kit components: Composer is extended with one optional prop. MicButton is reused unchanged. Nothing new.

    1. Placement and height

    The MicButton takes today's mic slot inside the field. Row order stays attach · text · mic · send (D37).

    • The field padding stays 8px 10px. The mic slot is MicButton's 44×44 box with margin-block: -4px, so its layout height is 36px. That makes the field 46 → 54px instead of 62px. The 44px target stays inside the border with 4px to spare.
    • With a caller mic, the field's controls become align-items: flex-end. On a multi-line draft, attach, mic and Send sit on the last line, and attach and Send get margin-bottom: 8px. A plain single-line field looks centred anyway.
    • At 320px: field 292 − padding 20 − attach 28 − mic 44 − send 28 − 3 gaps × 8 = 148px of text. The placeholder clips as it does today. There is no overflow.
    • Attach and Send keep their current targets. The provider chip and hint line stay below the field, unchanged.
    320px · D1                                    (field 54px)
    ╭──────────────────────────────────────────╮
    │ 📎  Ask your brain anyth…   ( 🎙 )   (↑) │
    ╰──────────────────────────────────────────╯
     [Sonnet 4.5]
    

    2. Hint and "Talk live…"

    Both use MicButton's own absolute positions, above the field and right-aligned to the mic (their right edge sits 4px inside the mic). They overlay the last transcript line or the recall chips. They never move the layout and never touch the hint line.

    S1 · holding                       ┌──────────────────────────┐
                                       │ 🔊 Keep holding to talk live │
                                       └──────────────────────────┘
    ╭──────────────────────────────────────────╮
    │ 📎  Ask your brain anyth…   (◔🎙)   (↑)  │   ring 0.6, amber disc
    ╰──────────────────────────────────────────╯
    
    • Only one of the two shows at a time: the hint while held, "Talk live…" while focused.
    • Tab order is Attach → text → Talk live… → Dictate → Send → model chip. This follows MicButton's DOM order, with "Talk live…" before the mic.
    • Names: "Dictate", "Talk live…". Nothing is captured during a hold.

    3. D6 review: no mark in an editable field

    D6 is the ordinary editable composer, with the dictated words in the textarea, focus in the text and the caret at the end. No uncertain-word mark. A textarea cannot hold styled runs, and once the text is edited the confidence no longer matches it. The mic is named "Dictate more" and Send is live.

    The honesty cue moves to the hint line: hint="dictated · check the words, then send". It shows until the first edit or Send.

    ╭──────────────────────────────────────────╮
    │     Ask Calypso about the axe and         │
    │ 📎  the sail cloth.▍          ( 🎙 )  (↑) │
    ╰──────────────────────────────────────────╯
     [Sonnet 4.5]  dictated · check the words, then send
    

    4. Local recording ("Record on this device", #1012)

    This uses MicButton with no hold: name="Record on this device", no onTalkLive, no hint, and the phase stays idle, so a hold acts as a tap. Live needs the host, so a ring that cannot lead anywhere would teach the wrong gesture. V4 (the ring fills when live is unavailable) applies to a reachable host only.

    Kit prop

    /** A caller-drawn mic in the mic slot (MicButton). When set, `mic`,
     *  `onMic` and `micLabel` are ignored, the slot gets margin-block -4px,
     *  and the field aligns its controls to the last line. */
    micControl?: ReactNode;

    Without the prop, the composer renders exactly as before, and the existing baselines stay unchanged.

    Stories (320 + desktop, light + dark)

    Composer/With MicButton: Idle · Holding + hint · Talk live focused · D6 review (one line, three lines) · Offline local recording. Play test: no row overflow at 320 with the hint showing.

    Open questions (needs: decision)

    • M1 Local recording has no hold (recommended), rather than V4 applying offline too.
    • M2 The D6 hint-line copy "dictated · check the words, then send", and whether it shows always or only when the result carried uncertain words (recommended: always; it claims nothing about confidence).
  4. added
    needs: decision
    needs: design
    and removed
    needs: design
    needs: decision
    on Nov 8, 2026
  5. schlessera commented on Nov 8, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-08):

    • M1: the offline "Record on this device" mic has no hold. It is a MicButton with no hint and no "Talk live…", and a hold acts as a tap. V4 (the ring fills, then explains) applies only while the host is reachable.
    • M2: D6 shows no honesty cue in the editable composer: no uncertain-word mark and no hint line. The dictated words appear as plain editable text, with "Dictate more" and Send. Drop the brief's dictated · check the words, then send hint.

    The design brief above is otherwise unchanged. Its sign-off is still pending, so this issue now carries needs: design instead of needs: decision.

  6. schlessera commented on Nov 8, 2026

    @schlessera
    OwnerAuthor

    Design sign-off: MicButton in the real composer (final, M1 and M2 folded in)

    3727-mic-in-composer-v2.png

    Signed off. This comment is the complete spec. It replaces the brief above where they differ. Only D6 changed (M2).

    ui-kit components: Composer is extended with micControl?: ReactNode. MicButton is reused unchanged.

    Geometry (all states)

    • The row stays attach · text · mic · send (D37). Field padding stays 8px 10px.
    • The mic slot is MicButton's 44×44 box with margin-block: -4px, so the field is 54px (46 today).
    • With micControl set, the field uses align-items: flex-end, and attach and Send get margin-bottom: 8px, so they sit on the last line of a multi-line draft.
    • At 320px the text gets 148px and the placeholder clips as today. There is no overflow.
    • The provider chip and hint line are unchanged below the field.

    States

    D1  rest
    ╭──────────────────────────────────────────╮
    │ 📎  Ask your brain anyth…   ( 🎙 )   (↑) │
    ╰──────────────────────────────────────────╯
     [Sonnet 4.5]
    
    S1  holding                        ┌────────────────────────────┐
                                       │ 🔊 Keep holding to talk live │
                                       └────────────────────────────┘
    ╭──────────────────────────────────────────╮
    │ 📎  Ask your brain anyth…   (◔🎙)   (↑)  │
    ╰──────────────────────────────────────────╯
    
    S1  "Talk live…" focused           ┌────────────┐
                                       │ 🔊 Talk live… │  (focus ring)
                                       └────────────┘
    ╭──────────────────────────────────────────╮
    │ 📎  Ask your brain anyth…   ( 🎙 )   (↑) │
    ╰──────────────────────────────────────────╯
    
    D6  review: plain editable text (M2)
    ╭──────────────────────────────────────────╮
    │     Ask Calypso about the axe and         │
    │ 📎  the sail cloth.▍          ( 🎙 )  (↑) │
    ╰──────────────────────────────────────────╯
     [Sonnet 4.5]
    
    Offline: Record on this device (M1)
    ╭──────────────────────────────────────────╮
    │ 📎  The host is unreachable  ( 🎙 )  (↑)░ │
    ╰──────────────────────────────────────────╯
                  needs the host · your draft is kept
    
    • Hint and "Talk live…": these use MicButton's own absolute positions, above the field with the right edge 4px inside the mic. They overlay the transcript or the recall chips and never move the layout. Only one shows at a time.
    • Tab order: Attach → text → Talk live… → Dictate → Send → model chip.
    • D6 (M2): the dictated words are plain editable text, with focus in the field and the caret at the end. The mic is named "Dictate more" and Send is live. There is no uncertain-word mark and no hint-line cue, and the hint line shows the normal ready content.
    • Offline (M1): a MicButton named "Record on this device", with no onTalkLive, no hint, and the phase always idle, so a hold acts as a tap. V4 applies only while the host is reachable.

    Kit prop

    /** A caller-drawn mic (MicButton) in the mic slot. When set, `mic`, `onMic`
     *  and `micLabel` are ignored; the slot gets margin-block -4px and the
     *  field aligns its controls to the last line. Absent = today, pixel for pixel. */
    micControl?: ReactNode;

    Stories and baselines (320 + desktop, light + dark, reduced motion)

    Composer/With MicButton: Idle · Holding + hint · Talk live focused · D6 one line · D6 three lines · Offline local recording. Play test: no row overflow at 320 with the hint showing. The existing Composer baselines stay unchanged.

    No open questions remain.

  7. added
    agent-ready
    and removed
    needs: design
    on Nov 8, 2026
  8. self-assigned this
    on Nov 8, 2026
  9. added this to the 0.45.0 milestone on Nov 8, 2026
  10. schlessera commented on Nov 8, 2026

    @schlessera
    OwnerAuthor

    Claimed (claim wi-3727-c1), branch feat/3727-composer-mic-control, building to the 2026-11-08 21:35Z design sign-off (M1 and M2 folded in). Readiness: the acceptance criteria are checkable and every design question is ruled, so agent-ready is added and the milestone is 0.45.0.

    Collision noted: #3724 (open, ready) also edits the props of packages/ui-kit/src/chrome/Composer.tsx (micTip and a disabled mic). The two changes are additive and independent, and whichever lands second rebases.

  11. schlessera commented on Nov 8, 2026

    @schlessera
    OwnerAuthor

    Implementation in #3742. I applied one number differently from the sign-off, and the change is recorded there.

    With micControl the field is align-items: flex-end, and the mic slot is 36px of layout (44 − 2 × 4). In Chromium, the spec's margin-bottom: 8px on Attach and Send puts them 4px above the mic disc's centre. A single line of text in the same field sits 8.2px below it. That is neither the drawing (everything centred on one line) nor "sit on the last line". The PR uses (36 − 28) / 2 = 4px for Attach and Send (and Stop, which holds Send's place) and (36 − 19.575) / 2 = 8.2125px for the text. The field is still 54px. The stories assert the centring at rest and on a three-line D6 draft.

    Smaller measured facts:

    • The hint and "Talk live…" keep MicButton's own position, as ruled. Their right edge is flush with the 44px target, 4px outside the 36px disc.
    • The text gets 146px at 320px, because the field's border wasn't counted in the 148px.
  12. schlessera commented on Nov 9, 2026

    @schlessera
    OwnerAuthor

    Delivered in #3742, squashed to main as fb999b8b (milestone 0.45.0). Confirmation passed in candidate run https://github.com/schlessera/brain-kit/actions/runs/42577219825, at head ccf20041 on base edce87b2.

    • Composer gains micControl?: ReactNode. When it is set, the kit mic's props are ignored, the field is 54px, and the controls sit on the last line. Without it, the composer is unchanged, and the full visual project ran with no existing baseline changing.
    • Stories and pinned-container baselines cover D1, S1 holding, S1 "Talk live…", D6 on one line and on three lines, and the offline mic, at 320px and desktop in both themes. A play test checks that the 320px row does not overflow while the hint shows.
    • The package-api contract component and api-report/ui-kit.txt record the prop.
    • The one geometry deviation (4px and 8.2125px instead of 8px) is explained in the comment above and in the PR.

    #3693 can now wire the hold onto the real composer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent-readyarea: ui-kitpriority: p2type: feat

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions