Skip to content

fix(core): a two-lane Toolbar wraps instead of squeezing its start lane - #12391

Closed
josephfarina wants to merge 3 commits into
mainfrom
josephfarina/toolbar-two-lane-wrap
Closed

josephfarina wants to merge 3 commits into
mainfrom
josephfarina/toolbar-two-lane-wrap

Conversation

@josephfarina

@josephfarina josephfarina commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Record change (component:Toolbar): FR2's rule is unchanged; the compatibility lines now name the two-lane layout, and FR2's verification table gains a row for the new browser spec.

Proof: the new browser spec fails on main (the title wraps to two lines at 390 px) and passes with this change; wide-screen template pages are pixel-identical before and after; the build replay set shows no suggestion changes.

User impact

A Toolbar with start and end content kept both on one line, however narrow its container. On a phone the start lane was squeezed until its title wrapped and its controls were cut. The kanban board template's header shows it at 390 px: "Sprint Board" broke onto two lines, its count badge was clipped, and the sprint selector and actions were pushed into a narrow second column.

Now the row wraps: the end lane moves to the next line, and each lane keeps its controls on one line.

Width Before After
390 px Title on two lines, count badge clipped, controls squeezed beside it Title and count on one line, controls on the next line
1280 px One line Unchanged
  • A toolbar that fits its container looks the same as before.
  • A container sized by its content no longer widens to hold a two-lane toolbar on one line; the toolbar wraps inside it instead.
  • The end lane fills the rest of its line, so its controls stay at the inline end, also on a line of their own.
  • Each lane keeps its controls on one line while it fits the toolbar's width; a lane wider than the toolbar wraps its own controls (the kanban header's end controls take two lines at 390 px).
  • A vertical toolbar is unchanged.
  • With a bottom divider, a wrapped two-lane row keeps a tab's indicator on its tab, as a wrapped three-lane row already does.

Problem and solution fit

The component record already states this for every horizontal toolbar (component:Toolbar FR2): "No lane clips or overlaps another; when the lanes do not fit one row at their minimum widths, the row wraps and the end lane moves to a following line." Only the three-lane layout did it. The two-lane layout was a no-wrap space-between row whose lanes could shrink below their content.

The fix gives the two-lane layout the rule the three-lane side lanes already follow. The row may wrap, and each lane's minimum width is its full row of controls, capped at the toolbar's width. The end lane grows to fill the rest of its line, and its controls already align to the end, so they stay at the inline end on any line. The divider's indicator check now also watches a horizontal two-lane row.

No API change and no new props. The kanban board template is not edited; it is fixed by the component.

Record

component:Toolbar keeps FR2's text. Its compatibility lines now name the two-lane layout beside the three-lane one, and a new verification row names the browser spec below. verified_by lists the spec.

Writing rubric results

R1 narration: none; the changed compatibility lines are template-required lifecycle fields and stay in the present tense.
R2 research: none.
R3 evidence: the new verification cell names the spec file and its widths, not a pull request.
R4 rejected alternatives: none recorded.
R5 change references: none.
R6 open questions: none touched.
R7 project status: none.

Tests

  • New story: Readiness: two lanes on a narrow screen (a title with a count badge, and three end actions).
  • New browser spec: ToolbarTwoLaneWrap.a11y.chromium.spec.ts. At 390 px it checks that the title stays on one line, no lane control is cut, the end lane starts below the start lane and stays inside the toolbar, and the page does not scroll sideways. On both widths it checks that the end lane's last control ends at the toolbar's inline end. At 1024 px it also checks that the row keeps one line. The 390 px case fails on main (the title takes two lines) and passes with this change.
  • The other Toolbar browser specs, the text-size wrap spec, and the Toolbar and Section unit tests pass.

Evidence

Wide widths are unchanged (picture check). Screenshots of every template page that uses Toolbar were compared before and after at 768 and 1280 px, and they are pixel-identical. At 390 px only the kanban board changes. Where a toolbar fits one line, the end lane's box is now wider, but its last control ends at the same pixel as before on every page, so nothing moves.

  • Template pages that use Toolbar (AI chat, canvas editor, editor, file explorer, kanban board, settings sidebar, inbox table, tree table) at 390, 768 and 1280 px: only the kanban board at 390 px changes. Every other page is pixel-identical.
  • Kanban board header at 1280 px: pixel-identical in two themes.
  • Storybook: among the toolbar stories, only these change, all at 390 px. In the first four, a lane left the toolbar or was cut before and now wraps.
    • The new story.
    • With Tab Navigation: the "New item" button was cut off at the card edge.
    • The toolbar accessibility pattern's horizontal stories, LTR and RTL: the end lane ran past the toolbar.
    • The edge-compensation comparison story: its solid toolbar sits in a column sized by its content. Before, the column widened so both lanes fit one line; now the toolbar stays in the column and wraps "Save" onto a second line. The ghost toolbar does not change; its 4 px overhang is edge compensation on both sides of this change.
  • astryx build on a build replay set: no start, alternative or block suggestion changes.

Scope

Components: core (Toolbar), its record

  • One defect is restored.
  • Separable contradictory or unsettled tagalongs were removed or split.
  • No new public API, visual representation, default, or interaction model is hidden under the bug-fix label.
  • Public text and artifacts contain no internal Meta context.

Testing

  • prettier and eslint: clean; pnpm check:knowledge: records aligned.
  • pnpm test:a11y-contract on the new spec against Storybook builds of main and of this change: fails, then passes.

@vercel

vercel Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 17, 2026 9:26pm UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 17, 2026
@astracat-bot

astracat-bot Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 17, 2026, 9:52 PM UTC

@github-actions github-actions Bot added the needs:design-review Affects visuals — Design should review label Nov 17, 2026
@github-actions github-actions Bot added the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 695b6bd

Storybook · Sandbox · built from this PR's head

Current run: The current CI run concluded cancelled. Current analysis is unavailable.


Generated by PR Enrichment workflow | View current CI run

@astracat-bot astracat-bot Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested: the two-lane row now wraps as the Toolbar record's FR2 requires, but a wrapped end lane does not stay at the inline end.

  • On its own line the end lane's controls sit at the inline start: edgeCompSlot.inset(...) at Toolbar.tsx:492 comes after styles.twoLaneEnd and replaces its marginInlineStart: 'auto', so the description's "The end lane stays at the inline end, also on its own line" and the comment at Toolbar.tsx:124 are not true at this head.

To fix it, give the two-lane end lane flexGrow: 1 so endSlot's justifyContent: 'flex-end' holds its controls at the inline end (as sideLane does), or apply twoLaneEnd after the inset, and assert in ToolbarTwoLaneWrap.a11y.chromium.spec.ts that the end lane's last control ends at the toolbar's inline end. Everything else checked out: the new story fails on main and passes here at 390 px, fitting toolbars are pixel-identical, and no public API changed. CI has not run on this head yet.

Claims and files checked

Review mode: full; reason: no-earlier-review

Claims (changeset and description):

  • A two-lane toolbar that does not fit wraps, the end content moving to the next line instead of squeezing the title and cutting the badge: verified (new story at 390 px on main and at this head).
  • Each lane keeps its controls on one line, and a lane wider than the toolbar wraps its own controls: verified (390 px and 240 px).
  • A toolbar that fits looks the same as before: verified (fitting stories identical at 390 and 1280 px).
  • A wrapped end lane stays at the inline end: false (Toolbar.tsx:125-127, :492; end lane at 24-248 in a 28-362 toolbar at 390 px).
  • A vertical toolbar is unchanged: verified (vertical toolbar story identical).
  • With a bottom divider, a wrapped two-lane row keeps the tab indicator on its tab: verified (Toolbar.tsx:342-355; indicator offset unset only while wrapped).
  • The two-lane lanes follow the three-lane side-lane rule: partly; the minimum width matches, but the three-lane end lane grows and aligns its controls to the end, and the two-lane one does not.
  • The record keeps FR2's text and changes only its compatibility lines, one verification row and verified_by: verified (record diff).
  • No API change and no new props: verified (API surface comparison: 0 rows).
  • The kanban board template is not edited: verified (file list).
  • The new spec fails on main and passes with this change at 390 px: verified by reproducing its assertions in Chromium; the spec file itself was not run.
  • The Toolbar and Section unit tests pass: verified (71 tests passed); the browser specs were not run.
  • Among toolbar stories only Tab Navigation, the toolbar pattern (LTR and RTL) and the edge-compensation comparison change at 390 px: verified for the 16 stories captured.
  • The kanban board header now fits a phone, and other template pages are unchanged: not checked (template pages not rendered).

Files:

  • .changeset/toolbar-two-lane-wrap.md: clear.
  • apps/storybook/stories/Toolbar.stories.tsx: clear.
  • docs/specs/components/Toolbar/Toolbar.spec.md: clear.
  • packages/core/src/Toolbar/Toolbar.tsx: finding, twoLaneEnd overridden (:125-127, :492).
  • packages/core/src/Toolbar/__tests__/ToolbarTwoLaneWrap.a11y.chromium.spec.ts: finding, no end-alignment assertion (:71).

Automated review (maintainer link)

Comment thread packages/core/src/Toolbar/Toolbar.tsx Resolved
@josephfarina
josephfarina marked this pull request as ready for review November 17, 2026 19:39
@josephfarina

Copy link
Copy Markdown
Contributor Author

Owner decision (engineering owner, covering this pull request): a two-lane Toolbar wraps its lanes onto separate rows when they do not fit, instead of squeezing its start lane, so a toolbar header stays usable on a phone. Wide layouts are unchanged. The Toolbar record's compatibility and verification lines state this, and a Chromium spec covers it.

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 5450967

@github-actions github-actions Bot removed the needs:spec-owner-review Current knowledge records await owner approval label Nov 17, 2026
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 3f46b2c

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. The follow-up fixes the end-lane placement, so a wrapped end lane now keeps its controls at the inline end, but two claims in the release note and the description still misstate what changes; no code change is needed.

  • Miss: .changeset/toolbar-two-lane-wrap.md:5 says "Each side keeps its controls on one line", but a lane wider than the toolbar wraps its own controls (the new story at 240 px, and the kanban header's end controls at 390 px), so please qualify it, for example "while it fits the toolbar's width".
  • Miss: the description says the edge-compensation comparison story's end lane "ran 4 px past the toolbar" and now wraps, but that 4 px is edge compensation on both base and head and the Ghost toolbar does not wrap; what changes is that the Solid toolbar, which fit on one line by widening its 1fr column, now wraps Save onto a second line, so please correct that entry and add to User impact that a container sized by its content no longer widens for a two-lane toolbar.
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none
  • Claim, changeset: a two-lane toolbar moves its end content to the next line instead of squeezing the start content: verified (browser measurement at 390 px; the new spec passes)
  • Claim, changeset: each side keeps its controls on one line: false (240 px story; kanban header at 390 px)
  • Claim, changeset and description: a toolbar that fits looks the same as before: verified in fixed-width containers (pixel-identical stories and template pages); not true in a content-sized container (comparison story)
  • Claim, changeset: the kanban header now fits a phone: verified (390 px: title and count on one line, nothing clipped, no sideways scroll)
  • Claim: before, both lanes stayed on one line however narrow, and the kanban header broke its title and clipped its badge at 390 px: verified (base code; browser measurements of main)
  • Claim: the end lane fills the rest of its line and keeps its controls at the inline end: verified (Toolbar.tsx:126-128; browser measurements at 390 px in LTR and RTL)
  • Claim: a lane wider than the toolbar wraps its own controls: verified (browser measurement at 240 px)
  • Claim: a vertical toolbar is unchanged: verified (pixel-identical vertical story)
  • Claim: with a bottom divider a wrapped two-lane row keeps the indicator on its tab: verified (Toolbar.tsx:343-356; Tab Navigation measurement; text-size spec passes)
  • Claim: the record's FR2 already states the wrap and only the three-lane layout did it: verified (record FR2; base Toolbar.tsx)
  • Claim: no API change and no new props; the kanban template is not edited: verified (the API report finds no change; changed-file list)
  • Claim: the record keeps FR2, names the two-lane layout in its compatibility lines, and adds a verification row and the spec to verified_by: verified (record diff)
  • Claim: the new story and spec check what the description lists, and the 390 px case fails on main and passes here: verified (spec lines 67-83; main measurement; spec passes on the head Storybook)
  • Claim: the other Toolbar browser specs, the text-size spec, and the Toolbar and Section unit tests pass: verified (43, 6 and 71 tests passed)
  • Claim: template pages that use Toolbar change only for the kanban header at 390 px: verified for seven of eight pages at 390, 768 and 1280 px
  • Claim: among the Toolbar stories only the listed ones change, at 390 px: verified for the set; false for the comparison story's explanation
  • Claim: prettier, eslint and the knowledge check are clean: verified (Lint workflow; knowledge check run)
  • Claim: a build replay set shows no suggestion changes: not verified here
  • File .changeset/toolbar-two-lane-wrap.md: finding (line 5)
  • File apps/storybook/stories/Toolbar.stories.tsx: clear
  • File docs/specs/components/Toolbar/Toolbar.spec.md: clear
  • File packages/core/src/Toolbar/Toolbar.tsx: clear
  • File packages/core/src/Toolbar/__tests__/ToolbarTwoLaneWrap.a11y.chromium.spec.ts: clear

Automated review (maintainer link)

Comment thread .changeset/toolbar-two-lane-wrap.md Resolved
@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 695b6bd

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet, because its run found no room under the CI ceiling and cancelled the heavy jobs, so it needs a re-run before merge.

The narrowed release note and the corrected description now match what the change does, and the two-lane wrap holds in the new Chromium spec, which fails on main and passes here.

  • Non-blocking: the description says the ghost toolbar in the edge-compensation comparison story "does not change"; it keeps one line and its 4 px overhang, but at 390 px it is 10 px wider because the solid column no longer takes that width, so "keeps one line; its column is 10 px wider" would be exact.
Claims and files checked

Review mode: incremental; reason: none

  • Changed rules (0): none
  • Claim, changeset: a two-lane toolbar moves its end content to the next line instead of squeezing the start content until its title wraps and its badge is cut: verified (390 px probes on main and head; the new spec fails on main and passes here)
  • Claim, changeset: each side keeps its controls on one line while it fits the toolbar's width: verified (390 px one row; at 240 px the end lane wraps its controls only once wider than the toolbar)
  • Claim, changeset and description: a toolbar that fits its container looks the same as before: verified (40 of 46 Toolbar stories at 390 px, the new story at 1024 px and the kanban header at 768 and 1280 px are pixel-identical)
  • Claim, changeset: the kanban board template header now fits a phone: verified (390 px: title and count on one line, nothing clipped, no sideways scroll)
  • Claim: before, both lanes stayed on one line however narrow, and the kanban header broke its title, clipped its badge and squeezed its controls at 390 px: verified (base code; 390 px probes of main)
  • Claim: a container sized by its content no longer widens to hold a two-lane toolbar on one line: verified (comparison story at 390 px)
  • Claim: the end lane fills the rest of its line and keeps its controls at the inline end: verified (Toolbar.tsx:124-128; 390 px probes in LTR and RTL)
  • Claim: a lane wider than the toolbar wraps its own controls, and the kanban header's end controls take two lines at 390 px: verified (240 px story; kanban 390 px)
  • Claim: a vertical toolbar is unchanged: verified (pixel-identical vertical story; Toolbar.tsx:79-83, :473-475)
  • Claim: with a bottom divider a wrapped two-lane row keeps the tab indicator on its tab: verified (Toolbar.tsx:343-356; Tab Navigation probe; text-size spec passes)
  • Claim: the record's FR2 already requires the wrap and only the three-lane layout did it: verified (record FR2; base Toolbar.tsx)
  • Claim: the two-lane lanes take the three-lane side-lane rule and the divider check watches the two-lane row: verified (Toolbar.tsx:106-128, :343-346)
  • Claim: no API change and no new props; the kanban template is not edited: verified (the API report finds no change; changed-file list)
  • Claim: the record keeps FR2's text, names the two-lane layout in its compatibility lines, and adds a verification row and the spec to verified_by: verified (record diff)
  • Claim: writing rubric results: verified against the record diff (present tense, no narration or status)
  • Claim: the new story and spec check what the description lists, and the 390 px case fails on main and passes here: verified (spec lines 67-83; run on both)
  • Claim: the other Toolbar browser specs, the text-size spec, and the Toolbar and Section unit tests pass: verified (13, 6 and 71 tests passed)
  • Claim: template pages that use Toolbar change only for the kanban header at 390 px: verified for the kanban page; the other pages not re-rendered here
  • Claim: where a toolbar fits one line its last control ends at the same pixel as before: verified (Tab Navigation at 1280 px; fitting stories pixel-identical)
  • Claim: the kanban header at 1280 px is pixel-identical: verified in the default theme
  • Claim: among the Toolbar stories only the listed ones change, all at 390 px: verified (exactly those five stories change)
  • Claim: in the comparison story the solid toolbar now wraps Save, and the ghost toolbar does not change apart from its edge-compensation overhang: verified for its layout and overhang; its box is 10 px wider (non-blocking note)
  • Claim: a build replay set shows no suggestion changes: not verified here
  • Claim: prettier, eslint and the knowledge check are clean: verified (Lint workflow at this head; knowledge check run)
  • File .changeset/toolbar-two-lane-wrap.md: clear
  • File apps/storybook/stories/Toolbar.stories.tsx: clear
  • File docs/specs/components/Toolbar/Toolbar.spec.md: clear
  • File packages/core/src/Toolbar/Toolbar.tsx: clear
  • File packages/core/src/Toolbar/__tests__/ToolbarTwoLaneWrap.a11y.chromium.spec.ts: clear

Automated review (maintainer link)

@josephfarina

Copy link
Copy Markdown
Contributor Author

/approve-spec 695b6bd

josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
josephfarina added a commit that referenced this pull request Nov 19, 2026
- #12680 perf(cli): a template's component line resolves its names in one pass, not one full lookup per name
  Author: Joey <[email protected]>
- #12180 fix(core): Calendar weekday names widen their column instead of overlapping
  Author: Joey <[email protected]>
- #12159 feat(cli): make an icon set inside your own app
  Author: Joey Farina <[email protected]>
- #12383 fix(Grid): a responsive column shrinks to a container narrower than minWidth
  Author: Joey Farina <[email protected]>
- #12374 [fix] Icon: a glyph given as name renders and warns, instead of crashing
  Author: Joey Farina <[email protected]>
- #12453 fix(charts): line, area and band default to straight segments
  Author: josephfarina <[email protected]>
- #12296 fix(core): a neutral Badge in a primary or destructive Button meets 4.5:1 on its fill
  Author: Joey Farina <[email protected]>
- #12395 fix(CodeBlock): without a code string, CodeBlock names the prop and the fix in development
  Author: Joey Farina <[email protected]>
- #12260 fix(cli): `astryx component Flex` names Stack first
  Author: Joey Farina <[email protected]>
- #12391 fix(core): a two-lane Toolbar wraps instead of squeezing its start lane
  Author: Joey Farina <[email protected]>
- #12427 fix(core): checkbox and radio marks keep their share of the box a theme sizes
  Author: josephfarina <[email protected]>
- #12725 [experimental] cli: with no icon set, experimental icon names the discover search where it lists packs
  Author: Joey Farina <[email protected]>
@josephfarina

Copy link
Copy Markdown
Contributor Author

Landed in #12738.

@github-actions
github-actions Bot deleted the josephfarina/toolbar-two-lane-wrap branch November 19, 2026 06:04

This branch was successfully deployed

1 active deployment
Preview — 695b6bd2 Deployed Nov 17, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot. needs:design-review Affects visuals — Design should review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant