Skip to content

ui-react: the graph controls column cuts off the Mode row's Maintenance pill and the Colour row's Entity pill on laptop #4092

Open

Description

@schlessera

Blocked by #4086
Blocked by #4097

Context

Found during the #4086 caller audit. On laptop, the graph controls column is 264px wide (GraphControlsColumn, packages/ui-react/src/components/graph/graph-controls-column.tsx:19-36, w-[264px] with px-4), so its Mode FilterRow (Segmented, packages/ui-react/src/components/graph/graph-form.tsx:31-47) has 232px of room. The four pills (Clusters, Discovery, Local, Maintenance) measure 62, 72, 49 and 85px plus three 6px gaps: 286px, measured in Chromium at main 05bf0d6a0. FilterRow's strip clips horizontally (const row, packages/ui-kit/src/rows/FilterRow.tsx:68-74), so about 54px of "Maintenance" is cut off and that pill cannot be read or fully reached. The Colour row has the same problem in Local and Discovery modes: Topic, Distance, Folder and Entity measure 48, 65, 54 and 50px plus three 6px gaps, 235px, so "Entity" loses about 3px. #4086 leaves horizontal clipping unchanged, so the fix is not part of it.

Scope

Implement the maintainer's 2026-11-16 ruling on the design brief:

Out of scope

Acceptance criteria

  • All four Mode pills and all four Colour pills are fully visible and fully clickable in the 264px laptop column at the pinned fonts, proven by a browser test measuring each pill inside the strip.
  • Under a coarse pointer every Mode and Colour pill still owns all four edges of its 44px target (hit-reach.ts probe), with no neighbour theft.
  • The laptop Mode and Colour rows render 2×2 at equal width. The phone sheet's Colour strip is unchanged (its 320px scene still expects no clipping).
  • The coarse-pointer gap between Direction and Colour in Local mode is probed explicitly with no neighbour theft.
  • Keyboard behaviour is unchanged: Tab lands on the selected pill, → from Discovery activates Local, Home/End work, a second Tab leaves the row, and ↑/↓ are unbound.
  • fix(ui-kit, ui-react): interactive FilterRow pills reach 44px by default (#4086) #4096's graph scene passes tabsReach with no clipped list for these rows.

Verification

The browser test above in the rail-fine, rail-coarse and rail-mixed projects; bun run check:pr --base origin/main.

Contract impact

None expected (ui-react layout only).

Refs #4086

The #4086 browser scene is currently proposed in open draft #4096, inspected at 219714eaab7b5c69bb17e9506c3ce86f9a6a1510: tabsReach and the graph scope (packages/ui-react/tests/browser/hit-reach.app.pointer.tsx:50-64, :92-102) explicitly retain the existing clipped Maintenance/Entity exceptions. It is not delivered in inspected main 05bf0d6a02. Once that owned runtime/test output lands, update its expectation in this fix; do not weaken the edge probes or preserve a permanent clipping exception.

2026-11-16: added the Colour row's "Entity", found by the #4086 browser scene.

Design inputs and prerequisite — 2026-11-16

The later #4086 maintainer ruling selects at least 44px paint width for every interactive FilterRow pill under a coarse pointer, with centred labels; fine-pointer paint is unchanged. It supersedes the earlier 38px-minimum alternatives where applicable. Consume this alongside the default-reach record in docs/decisions/design-kit/components-and-interactions.md and the existing D6 graph form, rather than designing a new reach policy here.

#4086 is an actual output prerequisite for the coarse-pointer acceptance: this issue excludes its shared reach/clipping behavior, and its graph regression scene currently exists only in that draft. The design can be prepared independently, but completion must use the delivered runtime and update the owned exception assertions. Closing design-record task #3531 alone does not satisfy that output.

Keep standalone: this task restores a laptop product control, outside the phone-specific #2596 outcome and the browser-fixture-only #2753 outcome. Wanted unscheduled work is p2; no milestone is invented. This pass verified the cited main source and draft regression, and added the self-contained design prompt below; it ran no new browser layout qualification.

2026-11-16: maintainer ruled D1–D6 (two equal columns; columns?: 2; phone unchanged; ↑/↓ unbound; kit prop split to #4097 with design sign-off on its stories). Scope and acceptance now point at that branch, and the issue is blocked by #4097 as well as #4086.

Activity

  1. added
    type: fix
    area: ui-react
    on Nov 16, 2026
  2. changed the title [-]ui-react: the graph controls column cuts off the Mode row's Maintenance pill on laptop[/-] [+]ui-react: the graph controls column cuts off the Mode row's Maintenance pill and the Colour row's Entity pill on laptop[/+] on Nov 16, 2026
  3. added
    priority: p2
    needs: design
    blocked
    on Nov 16, 2026
  4. schlessera commented on Nov 16, 2026

    @schlessera
    OwnerAuthor

    Design needed — graph controls in the 264px laptop column (2026-11-16). The four Mode choices, four Colour choices, fixed column and keyboard behavior already exist. Choosing their visible labels, row layout and coarse-pointer spacing is still a design judgment; source inspection cannot select that presentation. Wrapping is the recommendation below, not an approved layout.

    Design the Mode and Colour control fit for https://github.com/schlessera/brain-kit/issues/4092. It has no parent epic; #4086 owns the required shared FilterRow reach runtime.
    
    Read first:
    - This issue's scope/acceptance and #4086's 2026-11-16 maintainer ruling: https://github.com/schlessera/brain-kit/issues/4086#issuecomment-6918644612 . Interactive pills paint at least 44px wide under any-pointer: coarse, labels centred; fine-pointer paint remains unchanged. No reach opt-in prop is approved.
    - GraphControlsColumn (packages/ui-react/src/components/graph/graph-controls-column.tsx:19-36): the existing 264px laptop column and 16px padding leave 232px for each control.
    - Segmented (packages/ui-react/src/components/graph/graph-form.tsx:31-47), ColourControls (packages/ui-react/src/components/graph/graph-controls.tsx:84-93), and FilterRow's strip (const row, packages/ui-kit/src/rows/FilterRow.tsx:68-74). These source anchors were checked at main 05bf0d6a02. FilterRow has no wrap prop; do not assume one exists.
    - docs/decisions/design-feedback.md, "The graph caption — CONFIRMED, and entity joins the modes", and docs/decisions/design-kit/navigation.md D38: the caption/legend tracks the actual colouring, including Entity. docs/decisions/design-kit/components-and-interactions.md, "FilterRow pills reach by default; dismissal reasons take the kit pill", plus the later #4086 ruling above. docs/decisions/design-kit/foundations.md and storybook-accessibility.md bind tokens, themes, readable text, focus and pointer targets. ROADMAP.md and docs/extending/README.md bind scope and seams.
    - Draft #4096's graph scope and tabsReach test, inspected at 219714eaab7b5c69bb17e9506c3ce86f9a6a1510 (packages/ui-react/tests/browser/hit-reach.app.pointer.tsx:50-64, :92-102). It currently expects the existing clipped pills; this is draft regression evidence, not a merged fix.
    
    Problem:
    The #4086 Chromium audit at main 05bf0d6a02 measured Mode as 286px in 232px: Clusters, Discovery, Local, Maintenance, including three 6px gaps. About 54px of Maintenance is cut off. Colour in Local/Discovery totals 235px: Topic, Distance, Folder, Entity, so Entity loses about 3px. Horizontal clipping hides both labels and usable target area. #4086 deliberately does not fix this laptop layout.
    
    Settled:
    Keep all four choices in each row, their underlying values/order, the 264px column, the graph caption/legend semantics and automatic arrow activation/one roving tab stop. This issue does not redesign the phone sheet or change FilterRow paint/reach/clipping policy. The current phone presentation only changes if the same overflow is demonstrated.
    
    Design:
    1. Compare shorter visible labels, wrapping, and an existing alternative control that can preserve the keyboard contract. Recommend wrapping with full labels if it fits without overlap; explain any different recommendation. Do not silently widen the column, remove a choice or abbreviate it without readable/accessibility copy.
    2. Specify exact labels, row arrangement, alignment and spacing for both Mode and Colour. Draw the resulting 232px content area inside a 264px column at a 1280px laptop viewport. Show selected/unselected/disabled or unavailable states only where the current control actually has them.
    3. For wrapped rows, calculate coarse-pointer vertical gaps from actual pill paint and facing reaches, so every target owns all four edges with no neighbour theft. Preserve the new 44px minimum paint width, focus ring and accessible full label; fine-pointer paint follows the existing rule. Cover long labels and increased text size without clipping.
    4. Preserve Tab/Shift-Tab, arrows and Home/End automatic activation across the selected layout. Define focus retention on mode/colour change and responsive reflow. No new keyboard pattern is approved by drawing a different control.
    5. Show a 320px phone regression mock using the existing sheet; distinguish any proven shared overflow from an unsolicited phone redesign. Include paper/dark themes and any motion without introducing animation.
    6. State the concrete consumer/kit implementation boundary. If the selected layout cannot be expressed through existing APIs, identify the exact additional API and contract question before assuming it is approved. Do not duplicate #4086 or introduce a generic control framework.
    
    Deliverable:
    A reviewable proposal with exact copy, ASCII mocks at 264px-column/1280px laptop and 320px phone, selected-state/focus/reflow rules, measured gap arithmetic and implementation/browser criteria. Tests must prove full pill containment/clickability and four-edge ownership in rail-fine, rail-coarse and rail-mixed, preserve keyboard behavior, and remove only the resolved draft clipping exceptions. Use Odysseus and 2026-07-12 for fixture content. Post the design for review; a smaller layout using existing controls is acceptable, while leaving a choice clipped is not. No proposal here approves a new shared API or changes the existing reach policy.
    
  5. schlessera commented on Nov 16, 2026

    @schlessera
    OwnerAuthor

    Design brief: Mode and Colour in the 264px column (2026-11-16)

    Checked against main 05bf0d6a02 (FilterRow.tsx, graph-form.tsx, graph-controls.tsx, graph-controls-column.tsx), draft #4096 at 219714ea (hit-reach.app.pointer.tsx) and the #4086 ruling. I did not run a new browser measurement. All widths below are the #4086 audit numbers.

    1. Candidates

    Candidate Result Verdict
    Shorter labels For Mode to fit in 232px, Maintenance would need to be ≤ 31px of paint (232 − 62 − 72 − 49 − 18). That means renaming a mode the design records use, or abbreviating it so the visible text and the accessible name differ. Colour could fit by renaming Distance, but that breaks the D38 caption/legend wording. At larger text sizes it clips again either way. Rejected
    Natural wrap (pills stay content-sized and wrap when full) Mode: Clusters Discovery Local / Maintenance. Colour: Topic Distance Folder / Entity. Each row leaves one pill alone on the second line, and the line breaks shift whenever a label changes. Fallback
    Another existing control (ValueRow cycling, a select) Changes the keyboard contract (one-step cycling, no arrow activation) and hides three of the four choices. Rejected
    Two equal columns (2 × 2, wrapping further when needed) Every pill is 113px wide with its label centred, with room left at default text size. Both rows get the same shape. It falls back to one column at larger text sizes without clipping. Recommended

    2. Layout (laptop, 1280px viewport)

    Copy, values and order are unchanged: Clusters · Discovery · Local · Maintenance and Topic · Distance · Folder · Entity. The accessible name is the visible label.

     rail 208 │◄──────── column 264 (px-4) ────────►│ canvas
              │  Graph                              │
              │                                     │
              │  MODE                               │
              │  ┌───────────────┐ ┌───────────────┐│
              │  │   Clusters    │ │ ▓ Discovery ▓ ││  ← selected = amber chip
              │  └───────────────┘ └───────────────┘│
              │  ┌───────────────┐ ┌───────────────┐│
              │  │     Local     │ │  Maintenance  ││
              │  └───────────────┘ └───────────────┘│
              │   ◄──── 113 ────► 6 ◄──── 113 ────► │  = 232
              │                                     │
              │  [⌕ Highlight in graph…           ] │
              │  ROOT  [⌕ voyage/odysseus.md      ] │
              │  MAX DEPTH: 3   ──●───────          │
              │                                     │
              │  COLOUR                             │
              │  ┌───────────────┐ ┌───────────────┐│
              │  │ ▓   Topic   ▓ │ │   Distance    ││
              │  └───────────────┘ └───────────────┘│
              │  ┌───────────────┐ ┌───────────────┐│
              │  │    Folder     │ │    Entity     ││
              │  └───────────────┘ └───────────────┘│
    
    • Cell width = (232 − 6) / 2 = 113px. The widest label is Maintenance at 85px, so it has 28px to spare. Labels are centred.
    • Column gap: 6px (the existing strip gap).
    • Row gap: 6px under a fine pointer and 24px under any-pointer: coarse (rail-coarse and rail-mixed). The arithmetic is in §3.
    • Pill paint (20.5px height, padding, border, chip tint, inset focus ring) is the current kit paint plus ui-kit, ui-react: interactive FilterRow pills reach 44px by default, and the viewer and dismissal chips stop drawing a 44px pill #4086's coarse 44px minimum width. At 113px that minimum never applies here.
    • States: selected and unselected only. Neither row has a disabled or unavailable pill today, and none is added.
    • Block height: fine 20.5 + 6 + 20.5 = 47px; coarse 20.5 + 24 + 20.5 = 65px. The column already scrolls vertically (overflow-y-auto), so the extra 18–36px per row is absorbed.

    3. Coarse-pointer reach arithmetic

    • The target is 44px. The paint is 20.5 × 113. Horizontally the paint is already ≥ 44px, so there is no horizontal reach, and the 6px column gap cannot be crossed.
    • Vertically the reach is (44 − 20.5) / 2 = 11.75px per side. Two facing reaches between rows: 11.75 + 11.75 = 23.5px ≤ 24px row gap. That leaves 0.5px of clearance, so nothing is stolen and each pill owns all four edges.
    • The outer edges of the 2 × 2 block are shared with:
      • Above: the Label (not interactive).
      • Below the Mode block: 16px (gap-4) to the scene search field, which has no reach, so 11.75 < 16.
      • Above Colour in Local: the Direction pills' bottom reach (11.75) plus the Colour pills' top reach (11.75) must fit in the space of gap-4 + label + mb-1.5, about 35px. That is ≥ 23.5, but the probe must confirm it.
      • Above Colour in Discovery: the range input, which has no reach.
    • For a general rule, use row gap ≥ 44 − paint height. The fixed 24px covers any paint ≥ 20px, so larger text (taller paint) only adds clearance.
    • Vertical reach outside the strip's top and bottom behaves exactly like today's single row. It is ui-kit, ui-react: interactive FilterRow pills reach 44px by default, and the viewer and dismissal chips stop drawing a 44px pill #4086's mechanism and is not redesigned here.

    4. Larger text and reflow

    • Each pill is flex: 1 0 calc(50% − 3px) on a wrapping strip. Its minimum width is its content width (nowrap label), so a pill never shrinks below its label. If two pills don't fit on a line, the second one wraps and each takes the full line.
    • At 200% text size (column still 264px), Maintenance is about 150px and Clusters + Discovery is about 234px, so both rows become one column of four full-width pills. Nothing clips.
    • Page zoom drops below laptop: (900px) and gets the phone sheet, so it never reaches this column.
    • Above about 350% text, a single label could exceed 232px. That is beyond the 1.4.4 target and is noted, not designed.
    • Reflow changes no DOM order and moves no focus.

    5. Keyboard and focus (unchanged)

    • There is still one tab stop, landing on the selected pill. ←/→ move in DOM (reading) order and wrap across the visual lines (Discovery → → → Local). Home/End go to the first and last pill. Activation follows focus.
    • ↑/↓ stay unbound, as today. No grid navigation pattern is introduced (see question D4).
    • Focus after a change stays on the activated pill. A Mode change re-renders only ControlsBody below it. A Colour row that survives a Local ↔ Discovery switch keeps its mounted slot.

    6. Phone, 320px (regression only)

    The phone sheet has no Mode row, and the sheet's Colour strip (235px in about 288px) is not clipped: #4096's 320px scene expects []. The phone keeps the single strip. The two-column layout is passed only from GraphControlsColumn. In the sheet, the same wrapping strip still prevents clipping at larger text, but by natural wrap rather than in pairs.

    ┌ Graph options ─────────────── ✕ ┐
    │ [⌕ Highlight in graph…        ] │
    │ DIRECTION                       │
    │ (In) (Out) (▓Both▓)             │
    │ COLOUR                          │
    │ (▓Topic▓) (Distance) (Folder) (Entity)
    └─────────────────────────────────┘   unchanged
    

    Themes: no new tokens or colours. Paper and dark use the existing chip ramp. Motion: none added, and reflow is instant.

    7. Implementation boundary

    FilterRow has no wrap API, so this layout needs one new kit prop (question D2):

    • ui-kit FilterRow: columns?: 2. Leaving it unset gives the current nowrap strip, byte-for-byte. With columns: 2 the strip gets flexWrap: wrap, columnGap: 6, a row gap of 6, or 24 under (any-pointer: coarse) via the kit's existing live CSS media query, and pills at flex: 1 0 calc(50% − 3px) with centred labels. Paint, reach, roving and the role are untouched. The prop is additive and gated, following the D27 general rule. This is not a generic layout framework.
    • ui-react: Segmented forwards columns. GraphControlsColumn passes columns={2} for Mode and passes it through ControlsBody for Colour. The phone sheet passes nothing.

    8. Stories and tests

    ui-kit stories at 232px strip, 320px, and desktop, in paper and dark:

    • TwoColumns with each end selected
    • TwoColumnsCoarse (row gap 24 plus an edge-ownership probe)
    • TwoColumnsLargeText (200%, single column, no overflowing())
    • StripUnchanged (no columns prop)
    • reduced motion (nothing changes)
    • focus ring on each corner pill

    ui-react browser tests in rail-fine, rail-coarse and rail-mixed:

    • Every Mode and Colour pill's box lies inside its strip, and elementFromPoint at its centre returns the pill.
    • tabsReach passes with no clipped list. Remove only ["Maintenance"] and ["Maintenance", "Entity"] from fix(ui-kit, ui-react): interactive FilterRow pills reach 44px by default (#4086) #4096's graph scene.
    • Probe the gap above Colour in Local mode explicitly.
    • Keyboard: Tab lands on the selected pill; → from Discovery activates Local; Home/End; a second Tab leaves the row.

    Then run bun run check:pr --base origin/main.

    Open questions for the maintainer

    • D1: Two equal columns (recommended), or natural wrap with the lone pill on the second line?
    • D2: Approve the additive FilterRow prop columns?: 2, or name a different shape? No shared API is assumed approved.
    • D3: Keep the phone sheet on the single strip (pairs only in the laptop column)?
    • D4: Keep ↑/↓ unbound in the 2 × 2 layout, so the keyboard contract stays exactly as it is?
    • D5: Per the Storybook-first rule, split out a ui-kit issue (area: ui-kit + area: ui-react) for the prop and stories, and make it a prerequisite of this issue alongside ui-kit, ui-react: interactive FilterRow pills reach 44px by default, and the viewer and dismissal chips stop drawing a 44px pill #4086?
    • D6: Design sign-off on the resulting stories.
  6. added
    needs: decision
    and removed
    needs: design
    on Nov 16, 2026
  7. schlessera commented on Nov 16, 2026

    @schlessera
    OwnerAuthor

    Decision (maintainer, 2026-11-16) on the design brief:

    The body now points its scope and acceptance at this branch. needs: decision is removed. The issue stays blocked until #4086 and #4097 land.

  8. added
    agent-ready
    area: ui-kit
    and removed
    needs: decision
    on Nov 16, 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-readyarea: ui-kitarea: ui-reactblockedpriority: p2type: fix

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions