Skip to content

fix(toggle-button): long labels truncate instead of pushing the suffix out of the box - #564

Merged
lorant-one merged 3 commits into
fix/setting-control-collapsed-sliderfrom
fix/toggle-button-long-label
Nov 20, 2026
Merged

lorant-one merged 3 commits into
fix/setting-control-collapsed-sliderfrom
fix/toggle-button-long-label

Conversation

@lorant-one

Copy link
Copy Markdown
Member

Stacked on #560 (which now carries #561), so it ships in the same weekend 3.0.x patch. No release on its own.

Lorant's report: a long label runs out of the ToggleButton, and a suffix goes out of the box with it. Seen in the docs sidebar as "Design system for AI coding ag", clipped at the column edge.

Cause

  • The label area kept its content width (min-width: auto). A long string label overflowed the button, and the suffix icon was pushed past it.
  • The docs sidebar put its title in a Row with text-overflow: ellipsis. That has no effect on a flex container, so the title was clipped and no ellipsis showed.

Fix (core)

  • truncate now defaults to true: a string label ends in an ellipsis. truncate={false} keeps the old full-width label.
  • The label area gets min-width: 0, so node labels can shrink and truncate too.
  • Prefix and suffix icons get flex-shrink: 0.
  • A fillWidth button gets min-width: 0, so it can shrink with its parent.
  • AI spec regenerated for the truncate doc comment; the bundle budget tests pass.

Fix (docs)

  • The sidebar title is now a truncating Text.
  • Its availability Tag keeps its size.

Checks

  • Toggle button, SegmentedControl and AI tests: 778 passed. New cases cover the ellipsis by default, a node label shrinking, the icons keeping their size, and the truncate={false} opt-out.
  • Rendered before and after in a 224px column:
    • a plain long label
    • a long label with a suffix chevron
    • a selected long label
    • a title next to a tag
    • fit-width buttons in a row, which are unchanged
  • Apps scan: no app passes truncate={false}.
    • Aveiro's Sidebar1 already uses Text truncate, so it picks the fix up.
    • Stack's DocsNavList copies the docs sidebar's ellipsis Row. It needs the same small markup change once Stack is on 3.0.x.
  • Layout note: with ellipsis on, a fill-width column that its parent row squeezes can now shrink below its longest label. A sidebar gets a fixed width or minWidth, as the docs one does.

Generated by Claude Code

…x out of the box

A label too long for the button ran out of it: the label area kept its content
width, so a long title overflowed and took the suffix icon (or a tag) with it, as
in the docs sidebar's "Design system for AI coding agents". Now:

- labels end in an ellipsis by default (`truncate` defaults to true; `false` keeps
  the old full-width label)
- the label area can shrink (min-width 0) for node labels too
- prefix and suffix icons keep their size (flex-shrink 0)
- a fillWidth button may shrink with its parent

The docs sidebar puts its title in a truncating Text, so the ellipsis shows and the
availability tag stays whole.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk
…s parent

The visual check showed the always-on default squeezing fit-width pills in
scrolling strips ("Today" to "Tod…") and SegmentedControl options to an equal
share ("Categorical" to "Categori…") where they fit. Left out, `truncate` now
follows `fillWidth`: a sidebar row truncates, a pill keeps its full label.
SegmentedControl passes `truncate={false}`, as it shares and truncates its
options itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk

Copy link
Copy Markdown
Member Author

The visual check flagged 7 demos, and they were real regressions, not intended changes. With truncate always on, fit-width pills in scrolling strips shrank ("Today" to "Tod…", "Following" to "Followi…", "Monthly" to "Month…"). SegmentedControl options were also squeezed to an equal share where they fit ("Categorical" to "Categori…", "Appearance" to "Appearan…").

Fixed in 48bba6f:

  • When truncate is left out, it now follows fillWidth: a sidebar row truncates, and a pill keeps its full label as before.
  • SegmentedControl passes truncate={false}, because it already shares and truncates its options itself.
  • Tests updated, and the AI spec regenerated.

I'm leaving the visual-change label off so the rerun shows whether any diffs remain.


Generated by Claude Code

Letting a fill-width button shrink below its content made SegmentedControl's
shared options split the row evenly instead of by their labels (the second
visual check). A sidebar row truncates without it: its column fixes its width.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk
@lorant-one
lorant-one merged commit 8621e7c into fix/setting-control-collapsed-slider Nov 20, 2026
9 checks passed
@lorant-one
lorant-one deleted the fix/toggle-button-long-label branch November 21, 2026 11:17
lorant-one added a commit that referenced this pull request Nov 23, 2026
#560)

* fix(setting): let the control area grow so sliders and inputs keep their width

Since 3.0.0 the labelled Setting row capped its control area with a CSS
max-width and nothing else, so the area was only as wide as its content. A
control that fills its parent (Slider, Input, a fill-width SegmentedControl)
had no width to fill and collapsed: a Slider showed only its thumb next to
its value. The area now grows into the free space up to controlWidth.
Wrapping is still decided by content size, and horizontal="end" keeps a
button at the trailing edge.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtz72GNFGSy7czLGPrC

* docs(changelog): Setting control area fix

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtz72GNFGSy7czLGPrC

* fix(segmented-control): rail corners nest round the options at every size, padding and border style (#561)

The rail took its corners from the `-nest-4` tokens, and a `compact` rail always
took "l": 16px round 8px options in playful (Frametic's feature switches), and in
conservative the nest tokens add 2px for 4px of padding. The rail now computes its
radius from the options' own token: radius + padding (2px compact, 4px otherwise) +
the 1px border. Options without a size follow the density in CSS. Large tokens on
short buttons clamp to a pill on both, so they still nest.


Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk

Co-authored-by: Claude <[email protected]>

* fix(toggle-button): long labels truncate instead of pushing the suffix out of the box (#564)

* fix(toggle-button): long labels truncate instead of pushing the suffix out of the box

A label too long for the button ran out of it: the label area kept its content
width, so a long title overflowed and took the suffix icon (or a tag) with it, as
in the docs sidebar's "Design system for AI coding agents". Now:

- labels end in an ellipsis by default (`truncate` defaults to true; `false` keeps
  the old full-width label)
- the label area can shrink (min-width 0) for node labels too
- prefix and suffix icons keep their size (flex-shrink 0)
- a fillWidth button may shrink with its parent

The docs sidebar puts its title in a truncating Text, so the ellipsis shows and the
availability tag stays whole.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk

* fix(toggle-button): truncate by default only when the button fills its parent

The visual check showed the always-on default squeezing fit-width pills in
scrolling strips ("Today" to "Tod…") and SegmentedControl options to an equal
share ("Categorical" to "Categori…") where they fit. Left out, `truncate` now
follows `fillWidth`: a sidebar row truncates, a pill keeps its full label.
SegmentedControl passes `truncate={false}`, as it shares and truncates its
options itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk

* fix(toggle-button): leave a fill-width button's own min-width alone

Letting a fill-width button shrink below its content made SegmentedControl's
shared options split the row evenly instead of by their labels (the second
visual check). A sidebar row truncates without it: its column fixes its width.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk

---------

Co-authored-by: Claude <[email protected]>

* fix(option): danger option's label carries the contrast, its icon the colour (#567)

A danger option drew label and icon in the saturated danger tone, so on dark
the label read dimmer than the rows around it. The label now takes
danger-on-background-medium and the prefix icon danger-on-background-weak,
the same quiet-icon, strong-label order as a plain option.


Claude-Session: https://claude.ai/code/session_016gNJtwQuhoLQdpygLCVEyk

Co-authored-by: Claude <[email protected]>

---------

Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants