fix(Collapsible): let the trigger label fill the row - #5933
Conversation
The trigger is a `space-between` flex row, but its label span had no `flex-grow`, so the free space collected between the label and the chevron. A composed trigger — an `HStack` with a date, a count or a status on its right — had that element parked against the label with the gap stranded after it, unable to reach the edge that `space-between` implies. `flexGrow: 1` on the label is the whole change. A plain text trigger does not move: the label was already flush to the start edge and the chevron to the end, and the box that grew is one the text does not fill. The flex floor is deliberately left at `auto`, so no label can now be squeezed narrower than its own content and start overlapping the chevron. Co-authored-by: Cursor <cursoragent@cursor.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
The scoped audit reports zero failures for Collapsible but a coverage gap, because nothing had ever written down *why* it is not applicable. It is not: the trigger is a space-between flex row with no physical side anywhere in it, and the chevron turns on the one axis that does not mirror. Co-authored-by: Cursor <cursoragent@cursor.com>
PR Analysis Report📚 Storybook PreviewView Storybook for this PR 🧪 Sandbox PreviewView Sandbox for this PR Modified ComponentsCollapsible (@astryxdesign/core) · View in Storybook
Bundle Size Summary
Accessibility AuditStatus: No accessibility violations detected. Visual Regression12 added · 0 removed. View the report A repository maintainer can accept these exact frames: Generated by PR Enrichment workflow | Storybook | Sandbox | View full report |
|
Visual gate, for the record: no shot changed against the baseline. The twelve entries are all under Added — Accepting to record the new baselines. /accept-visual |
|
/accept-visual 33680104028/1 No frame changed against the baseline — the report lists all twelve shots under Added, not Changed. |
|
Visual acceptance refused: the reason must explain why the pixels are correct (12–500 characters). |
|
/accept-visual 33680104028/1 No frame changed against the baseline: the report lists all twelve shots under Added, not Changed. core-collapsible--single-mode had no baseline before this run, so these record new coverage rather than waving through a diff. Every Collapsible story that does have a baseline came back identical, which is what a label growing into space the text does not fill should do. |
|
/accept-visual Reviewed the report: no changed or removed baselines, only 12 added shots for |
|
Visual acceptance refused: copy the exact maintainer-only |
|
/accept-visual 33680104028/1 No frame changed against the baseline. The report lists all twelve shots under Added and has no Changed or Removed section: core-collapsible--single-mode had no prior baseline, so this run records new coverage rather than a regression. The twelve are that one story across six themes in light and dark, and each shows the intended effect of this PR — the trigger label filling the row so the chevron sits at the far right — with no clipping and no label/chevron overlap in any theme. |
|
Visual changes accepted for |



What
Collapsible's trigger is aspace-betweenflex row, but its label span had noflex-grow. So the free space collected between the label and the chevron, and a composed trigger — anHStackcarrying a date, a count or a status on its right — had that element parked against the label with the gap stranded after it, unable to reach the edge thatspace-betweenimplies.flexGrow: 1on the label is the whole change.Before / after
Shot on the case that found it: a mail thread whose message headers put a timestamp out by the chevron. Same markup in both, only the
flex-growdiffers.Before — the dates trail the addresses, 583px short of the chevron:
After — they sit where the trigger's own
space-betweensays they should:Why it is safe
A plain text trigger does not move. The label was already flush to the start edge and the chevron to the end; the box that grew is one the text does not fill, so nothing repaints differently.
The flex floor is deliberately left at
autorather than dropped to0. That is the part worth reviewing: withmin-width: 0a long label could be squeezed narrower than its own content and start overlapping the chevron. Leaving the floor alone means the label can grow but never shrink belowmin-content, so no trigger that fits today stops fitting.Test plan
vitest run packages/core/src/Collapsible— 70 passed, no changes needed.Collapsibleand aCollapsibleGroupat every density for movement. None.Changeset included.
Made with Cursor