Skip to content

fix(webkit): stop wrapped toast titles overlapping and pin the glyph to line one - #900

Merged
isaque-bock-azion merged 5 commits into
mainfrom
fix/toast-multiline-title
Sep 9, 2026
Merged

isaque-bock-azion merged 5 commits into
mainfrom
fix/toast-multiline-title

Conversation

@gabriel-lisboa-azion

Copy link
Copy Markdown
Contributor

Summary

  • Stacked on fix(webkit): align a toast's leading icon to its title, not to the whole row #892 (base is fix/toast-item-alignment, not main) — it continues that work rather than competing with it. GitHub will retarget this to main once fix(webkit): align a toast's leading icon to its title, not to the whole row #892 merges.
  • ToastTitle carried leading-none, pinning the line box to the font size (14px) while the glyphs need 18px, so every wrapped title overlapped its own next line by 4px. text-label-md already carries the token leading (1.5). The single-line case is unchanged.
  • The leading glyph now gets the title's line box — h-[1lh] on a box carrying text-label-md resolves to exactly the leading ToastTitle uses — so it sits on the first line at any card height. The loading Spinner shares that wrapper instead of keeping self-center, which centred it on the whole card.

How to test

  1. cd packages/webkit && npx vitest run src/components/feedback/toast → 23 passed.
  2. pnpm storybook:dev → Components/Feedback/Toast. Give a toast a long message so the title wraps: before, consecutive title lines overlap by ~4px; now they are cleanly spaced. The severity icon (and the loading spinner) sits on the title's first line, not the middle of the block.
  3. One-line toasts are unchanged from fix(webkit): align a toast's leading icon to its title, not to the whole row #892.

Notes

…ole row

The icon and the content column now sit in an inner items-start group, so the
typed glyph aligns to the title's line — its only line on a one-line toast, the
first line on a multi-line one — instead of to the outer row, which the 28px
action/close control stretched. The trailing region takes a negative block margin
so that control no longer inflates a one-line card, and a negative inline-end
margin so a text action's label ends optically flush with the card's padding
instead of inset by the button's own.
…to line one

Two defects that only appear once a toast wraps, which it does routinely — an
icon and a trailing action together leave the title barely half of the 356px
region.

`ToastTitle` carried `leading-none`, pinning the line box to the font size
(14px) while the glyphs need 18px, so every wrapped title overlapped its own
next line by 4px. `text-label-md` already carries the token leading (1.5), which
is what a multi-line title needs; the single-line case is unchanged.

The leading glyph was centred on the whole card (`items-center` plus
`self-center`), which put it beside the middle of a wrapped message, pointing at
nothing. It now gets the title's line box — `h-[1lh]` on a box carrying
`text-label-md` resolves to exactly the leading `ToastTitle` uses — so it sits on
the first line whether the card is one line or four. The trailing action moves to
the same row for the same reason.
Base automatically changed from fix/toast-item-alignment to main August 21, 2026 14:27
gabriel-lisboa-azion added a commit that referenced this pull request Aug 26, 2026
Brings in the 17 commits main has since 2026-08-17 — the webkit
documentation category (#919), the shared leading column for Select /
MultiSelect / Dropdown (#935), resizable-panel (#902), the copy-button
tooltip and card-box header inset (#936), --container-site (#923), the
page-enter / content-enter arrivals (#896), the colored-icon currentColor
fix (#930) and the skills that landed with them.

Conflict resolution, all fifteen:

Demo wins where it already carries work that is still an OPEN PR on main
and main's side is the older shape that PR rewrote — toast-item (#900's
`h-[1lh]` line box over #892's `self-center`), use-placement and
popover.test (#932's translate anchoring over #891's prose), and the
theme animation tokens, where the entry-count canary confirms every
main entry survived alongside demo's.

Main wins where its side is a superset or the corrected form — DESIGN.md
(gains `text-body-prose-md` and `.layout-column-docs`), package.json
(keeping demo's footer block would have duplicated the four keys main
already merged in above it), and resizable-panel.test, whose named
imports are the form that keeps CodeQL from reading a compiler-generated
`.vue` default export as undefined.

Both sides where each added something: .size-limit.json keeps demo's
ratcheted 1.1 KB footer-root budget and takes main's fourteen doc-*
entries; the ui-craft skill and the CLI plan keep demo's microcopy
routing without duplicating main's entry.

Generated artifacts were rebuilt rather than hand-resolved — theme dist
via build:tokens, catalog.json via catalog:build — and both carry each
side's tokens and all 258 exports.
@isaque-bock-azion
isaque-bock-azion merged commit 80568d2 into main Sep 9, 2026
23 checks passed
@isaque-bock-azion
isaque-bock-azion deleted the fix/toast-multiline-title branch September 9, 2026 17:27
@github-actions github-actions Bot mentioned this pull request Sep 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants