Skip to content

ui-kit: the tall voice field overflows its controls under doubled text with a body #3773

Closed

Description

@schlessera

Context

Part of #3690. Found while integrating #3699 (draft #3735).

The tall VoiceField is a fixed 136px (.bk-voice-field[data-shape="tall"], packages/ui-kit/src/tokens.css:2781). It stacks the label row, the two-line VoiceText body (clamped to 40px, packages/ui-kit/src/tokens.css:2790) and the controls row (margin-top: auto, packages/ui-kit/src/tokens.css:2786). At 1× text that fits: 16 + 4 + 40 + 44 + 20 padding = 124px.

The app's enlarged-text audit (packages/ui-react/tests/browser/conversation-controls.offline.tsx, control audit … 320x480 text 2) doubles the field's text. With any body (a held draft, the L6 refusal line, the output-muted line or a client notice) the label wraps, and the content measures 160px inside the 136px field. The controls row then paints below the field's bottom edge. The controls stay 44px and still take their own taps, but the field no longer contains them. Without a body the field fits at 2×.

#3735 records this in its 2× baselines and asserts only that every control stays reachable at 2×. At 1× it keeps the strict containment check.

Scope

  • Decide and implement how the tall field holds a body under enlarged text (WCAG 1.4.4) so its controls stay inside it.
  • Add a kit story and visual baseline of the tall field with a body at doubled text.
  • Restore the strict scrollHeight <= clientHeight containment check at 2× in conversation-controls.offline.tsx (the contained helper), and regenerate the affected app baselines.

Out of scope

Acceptance criteria

  • At 320px with doubled text, the tall field contains its label, body and controls for every L1–L8 state that carries a body. This is proven by the strict containment check in control audit … text 2 and notice with review … text 2, and the check fails on the current kit.
  • At 1× text, the field's 136px height and every existing voice baseline are unchanged, or any change is reviewed and signed off.
  • A kit story shows the tall field with a body at doubled text, with a baseline in both themes.

Verification

The ui-react-layout project for conversation-controls.offline.tsx and the kit's voice visual tests, run in the pinned container.

Contract impact

None expected (kit CSS and tests).

Decisions (maintainer, 2026-11-09)

  • R1: clamp only live draft words (the newest two lines); message bodies (refusal, output muted, client notices) are never clamped in the tall field.
  • R2: accept the upward shift under enlarged text; 1x stays exactly 136px.

The design brief (comment, 2026-11-09) is the spec.

2026-11-09: design signed off; R1 and R2 ruled.

Activity

  1. schlessera commented on Nov 9, 2026

    @schlessera
    OwnerAuthor

    Design needed. The tall field's 136px height and its one-message body are signed off (#3699). What is left is how that fixed field behaves when text is doubled and a body is present: today the controls row overflows its bottom edge. The code cannot pick between growing the field, shortening the body or reflowing the label, because each choice changes the signed-off rhythm.

    Read first
    - This issue, epic #3690 and the #3699 sign-off (state table and budget).
    - packages/ui-kit/src/voice/VoiceField.tsx (tall shape), packages/ui-kit/src/tokens.css:2781-2801
      (field height, body, text clamp, controls, label and meta).
    - packages/ui-kit/stories/voice/_voice.tsx (`live()` builders: L1d, L4d, L6, L1o, L8r).
    - packages/ui-react/tests/browser/conversation-controls.offline.tsx (`contained`, the text-2 audit).
    
    The problem
    At 320px with doubled text, the label row wraps and the body keeps two lines. The content
    measures 160px in the 136px field, so the controls paint below the field.
    
    Design
    1. With doubled text and a body, does the field grow, does the body drop to one line, or does the
       label's meta hide first? Name the order in which things give way.
    2. Does the answer differ for the five-control L4 + draft row?
    3. How does it behave at desktop width?
    
    Requirements to hold
    - 44px targets, and every control inside the field at 1× and 2× text.
    - 1× text keeps 136px and the 264px transcript at 320 × 568 (wire.md, unchanged).
    - Never colour alone; reduced motion as in the kit. No change to which message the body shows.
    
    Deliverable
    ASCII mocks at 320px and desktop, at 1× and 2× text, for L1 + draft, L4 + draft and L6.
    
  2. added
    type: fixSomething is broken and must behave the way it is documented.
    area: ui-kitThe presentational design kit: components, tokens, Storybook, visual baselines.
    needs: designBlocked on a design drop or a visual answer.
    on Nov 9, 2026
  3. uploads-sh commented on Nov 9, 2026

    @uploads-sh

    3773-tall-field-2x.png
    Tall VoiceField at 1x (136px, unchanged) and 2x text (grows, controls contained): L1+draft, L4+draft, L6 · after

    View on uploads.sh

    uploads put <file> --issue 3773 · docs

  4. schlessera commented on Nov 9, 2026

    @schlessera
    OwnerAuthor

    Design brief: tall voice field under enlarged text

    3773-tall-field-2x.png

    ui-kit components: VoiceField (tall) is extended with CSS only: no new prop or component. VoiceStateLabel, VoiceText and VoiceControlButton are reused unchanged in markup, with the CSS changes below. New stories are listed at the end.

    Rule: the field grows, and nothing gives way

    Under enlarged text no content is hidden, shortened or cut. Every piece of the field carries state that a binding decision relies on:

    • the meta is state, not decoration (Draft · not sent yet, Reply audio off, mic off);
    • the body is the L6 refusal sentence (voice-permission.md) or the output-muted line (live-conversation.md);
    • the controls stay 44px.

    So the answer to "which gives way first" is height. At 1× text nothing changes, because the content is 124px, which is below the 136px minimum.

    CSS (kit, tokens.css:2781-2801)

    - .bk-voice-field[data-shape="tall"] { height: 136px; padding: 10px 10px 10px 16px; }
    + .bk-voice-field[data-shape="tall"] { min-height: 136px; padding: 10px 10px 10px 16px; }
    
    + /* The label wraps instead of cutting the meta off with an ellipsis. */
    + .bk-voice-field[data-shape="tall"] .bk-voice-label { flex-wrap: wrap; row-gap: 0; }
    + .bk-voice-field[data-shape="tall"] .bk-voice-label-meta { max-width: 100%; }
    
    + /* Two whole lines at any text size, never a fixed 40px. */
    + .bk-voice-field[data-shape="tall"] .bk-voice-text { max-height: 2lh; }
    • min-height: at 1× the field is still exactly 136px (16 + 4 + 40 + 44 + 20 = 124 ≤ 136), so every existing 1× baseline should be pixel-identical.
    • Label wrap: the word stays first. The meta keeps margin-left: auto, so it sits on the right while it fits, and moves under the word when it doesn't. It is never ellipsised in the tall field.
    • 2lh clamp: today's 40px clamp shows about 1.3 lines at the audit's 24px/1.3 text, which cuts a line through the middle. 2lh is 40px at 1× (20px line height), so it is unchanged there, and two whole lines at any larger size. Draft words still keep the newest two lines (bottom-aligned, as now).
    • The compact and card shapes are unchanged (the selectors are scoped to tall).

    Order and placement

    1. The label wraps (the meta moves to its own line).
    2. The field grows to fit. It is bottom-anchored above the composer slot, so it grows upward. The controls row keeps margin-top: auto, so it stays pinned to the field's bottom edge and the targets do not move between states. The transcript above gives up the height.
    3. There is no scroll inside the field and no max-height. The height has a bound (at most two label lines, the body and the 44px row), so a cap is not needed.

    L4 + draft (five controls)

    The rule is the same. The controls are 44px icon buttons that do not scale with text, so the row (5 × 44 + 4 × 12) is the same width at 1× and 2×, and it does not wrap at 320. Only the label and body grow, exactly as for L1.

    Desktop

    The rule is the same. In the 720px column the label usually stays on one line at 2×, so the field grows less (about 161px for L1 + draft). At 1× it is 136px, as today.

    Mocks

    1× text · 320 (unchanged, 136px)

    ╭ L1 + draft ──────────────────────────╮  ╭ L6 ───────────────────────────────────╮
    │ ● Listening     Draft · not sent yet │  │ ✋ Needs your tap Ithaca steward · 0:12 │
    │ Ask Calypso when the axe is back and │  │ Tap Allow or Deny on the card. Voice   │
    │ add it to the tally.                 │  │ can’t approve or refuse with this …    │
    │               (🎙) (⌫) (↑) (✕)        │  │                    (🎙) (■) (✕)        │
    ╰──────────────────────────────── 136 ─╯  ╰──────────────────────────────── 136 ──╯
    L4 + draft: the same field, with a teal ◗ Speaking label and (🎙)(■)(⌫)(↑)(✕).
    

    2× text · 320 (grows; controls inside)

    today (fails)                 L1 + draft                L4 + draft                L6
    ╭───────────────────╮         ╭───────────────────╮     ╭───────────────────╮     ╭───────────────────╮
    │ ● Listening       │         │ ● Listening       │     │ ◗ Speaking        │     │ ✋ Needs your tap  │
    │ Draft · not sen…  │         │ Draft · not sent  │     │ Draft · not sent  │     │ Ithaca steward ·  │
    │ ̶a̶x̶e̶ ̶i̶s̶ ̶b̶a̶c̶k̶…        │         │   yet             │     │   yet             │     │   0:12            │
    ╰─(🎙)─(⌫)─(↑)─(✕)──╯ 136     │ axe is back and   │     │ axe is back and   │     │ Tap Allow or Deny │
      ↑ controls paint below      │ add it to the     │     │ add it to the     │     │ on the card. …    │
                                  │ tally.            │     │ tally.            │     │ (see R1)          │
                                  │  (🎙)(⌫)(↑)(✕)     │     │ (🎙)(■)(⌫)(↑)(✕)   │     │     (🎙)(■)(✕)     │
                                  ╰──────────── ≈192 ─╯     ╰──────────── ≈192 ─╯     ╰──────────── ≥192 ─╯
    

    Desktop (720 column)

    1×  ╭ ● Listening ─────────────────────────────────────────────── Draft · not sent yet ╮
        │ Ask Calypso when the axe is back and add it to the tally.                        │
        │                                                         (🎙) (⌫) (↑) (✕)          │
        ╰─────────────────────────────────────────────────────────────────────────── 136 ─╯
    2×  ╭ ● Listening ──────────────────────────────────── Draft · not sent yet ╮
        │ Ask Calypso when the axe is back and add it to                        │
        │ the tally.                                                            │
        │                                                  (🎙) (⌫) (↑) (✕)      │
        ╰──────────────────────────────────────────────────────────────── ≈161 ─╯
    

    Requirements check

    • 1×: 136px, and the 264px transcript at 320 × 568 (wire.md) is unchanged, because min-height equals today's height.
    • 2×: every control is inside the field, and the strict contained check (scrollHeight <= clientHeight) can be restored in control audit … text 2 and notice with review … text 2. It fails on the current kit (fixed 136px).
    • Colour: never colour alone. The word and icon carry the state, as before.
    • Motion: none. The height change is not animated, so reduced motion needs nothing new.

    Stories (ui-kit, this issue)

    Voice/Live/Tall field · enlarged text, at 320 and 1280, light and dark, with 200% text applied the same way as the app audit:

    • L1 + draft
    • L4 + draft (five controls)
    • L6 (refusal line)
    • Output muted (Reply audio off + Recover reply audio)
    • L1 without a body (the control: stays 136px if the content fits)

    Assert in each one: the field contains its controls, nothing is ellipsised in the label, and the body shows whole lines.

    Open questions (needs: decision)

    • R1 · Message bodies at 2×. With 2lh, the L6 refusal sentence (and the longer client notices) can still cut at two lines when text is enlarged. Drafts are fine, since they intentionally show the newest words. Recommended: clamp only live draft words. A message body (refusal, output muted, client notice) is never clamped in the tall field, so at 2× L6 shows the whole sentence (≈ 254px at 320). This needs the kit to tell the two apart: either VoiceText with text/partial is clamped while children is not, or a data- attribute is set from the existing props. The alternative is to accept a two-line cut of the refusal at 2×.
    • R2 · Height jump between states at 2×. When a body appears or goes away under enlarged text, the field's top edge moves, so the transcript shifts by up to about 60px. The controls do not move. Recommended: accept it. The alternative is to reserve the enlarged height in every state, which costs transcript height even when nothing is showing.
  5. added
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    and removed
    needs: designBlocked on a design drop or a visual answer.
    on Nov 9, 2026
  6. schlessera commented on Nov 9, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-09):

    • R1: clamp only live draft words (the newest two lines). Message bodies are never clamped in the tall field: the refusal line, the output-muted line and client notices. At 2× the L6 refusal sentence shows whole. The kit tells the two apart from existing props (for example, VoiceText with text/partial is clamped while children is not, or a data- attribute set from those props), with no new design.
    • R2: accept the shift. Under enlarged text the field's height follows its content, growing upward with the controls pinned. At 1× it stays exactly 136px.

    The design brief above is signed off with these branches. This issue is now agent-ready.

  7. added
    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.
    priority: p2Wanted, not scheduled. Pulled in when a milestone has room.
    and removed
    needs: decisionBlocked on a maintainer or designer ruling, not on code.
    on Nov 9, 2026
  8. added this to the 0.45.0 milestone on Nov 9, 2026
  9. self-assigned this
    on Nov 9, 2026
  10. schlessera commented on Nov 9, 2026

    @schlessera
    OwnerAuthor

    Claiming this (token c3773-t3a8). Branch: fix/3773-tall-voice-enlarged-text. Implementing the signed-off brief with R1/R2: tall field min-height, wrapping label, 2lh clamp on live draft words only, and the enlarged-text stories and baselines. Concurrent work in the same files: #3764, #3735.

  11. schlessera commented on Nov 9, 2026

    @schlessera
    OwnerAuthor

    Kit fix in #3779 (Refs). The tall field now grows under enlarged text, and the enlarged-text stories and baselines are in. #3773 stays open for the app side: restoring the strict contained check at 2× in #3735's control audit … text 2 and notice with review … text 2, which also needs its message bodies passed as VoiceText children (R1). The steps are on #3735.

    A design observation outside the brief, for whoever reviews: at 2× the tall label row is taller than the meter's 28px solid top fade, and the reduced-motion level line can cross the body. The text reads over the meter on its glyph halo alone. The 1× fade check is not applied to the enlarged stories.

  12. schlessera commented on Nov 9, 2026

    @schlessera
    OwnerAuthor

    Kit fix merged: #3779 as 9c7eb2582 (milestone 0.45.0). The candidate proof run 42633113995 passed in every job (unit, browser, layout, captures, runtime, pack, endurance, verify).

    What landed:

    • At 1× text the tall field is still exactly 136px, and no existing voice baseline changed.
    • Under enlarged text the field grows upward with its controls pinned to the bottom. The label wraps instead of cutting off its meta. Draft words keep two whole lines, and message bodies are never clamped (R1, R2).
    • The Voice/Live/Tall field · enlarged text stories and their 20 baselines.

    Still open: the first acceptance criterion needs the strict 2× contained check restored in #3735's control audit … text 2 and notice with review … text 2, with message bodies passed as VoiceText children. The steps are on #3735. Close this issue once that lands.

  13. removed their assignment
    on Nov 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyContext and acceptance criteria are complete enough for an agent to take this unattended.area: ui-kitThe presentational design kit: components, tokens, Storybook, visual baselines.priority: p2Wanted, not scheduled. Pulled in when a milestone has room.type: fixSomething is broken and must behave the way it is documented.

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions