Skip to content

feat(webkit)!: reshape Message onto slot-first copy with label and size - #833

Merged
robsongajunior merged 4 commits into
mainfrom
feat/message-label-slot-api
Jul 29, 2026
Merged

feat(webkit)!: reshape Message onto slot-first copy with label and size#833
robsongajunior merged 4 commits into
mainfrom
feat/message-label-slot-api

Conversation

@gabriel-lisboa-azion

Copy link
Copy Markdown
Collaborator

Summary

Message presented a title + description stack, so copy carrying an inline link had no home — the only escape was the default slot, which replaced the icon and the entire layout along with it. This reshapes the banner onto a single line of copy in one content region that keeps the leading icon and styles anchors with the .text-link token, and adds a size token driving the height floor, inline padding, copy scale, and the trailing control sizes.

Breaking: title (required) and description are gone. Pass the copy as label, or in the default slot when it needs inline markup.

<!-- before -->
<Message severity="warning" title="Once confirmed, this action can't be reversed." />

<!-- after -->
<Message severity="warning" label="Once confirmed, this action can't be reversed." />

<!-- copy with inline links -->
<Message severity="warning">
  Your plan is close to its request limit.
  <a href="https://github.com/billing">Upgrade the plan</a>
  to avoid throttling.
</Message>

A description second line has no replacement — fold it into the single copy line. The __title / __description testids are replaced by one __content testid.

Notes

  • Sizes. small — 32px floor, 8px inline padding, .text-label-sm; medium (default) — 36px, 12px, .text-label-md. Block padding is 6px in both. A trailing action or close control tightens the end edge to 8px and lets the banner grow past the floor.
  • Trailing controls track size. The built-in action is now a secondary Button (was text) so it reads as a control rather than body copy; both it and the close IconButton take small (28px) / medium (32px) with the banner.
  • Leading icon is a fixed 14px (size-3.5 box, .text-label-md glyph). It previously used text-[length:inherit], which made the glyph inherit the host page's font-size rather than a token.
  • Call sites updated: the DeleteDomainDialog template story, and the titlelabel usages in the shipped webkit-form, webkit-ui-states, and webkit-ui-verify skills. Those skill edits ride along because they would otherwise document a prop that no longer exists.
  • Tests: 33 assertions in Vitest browser mode (Chromium) cover the content region, the size mapping, the data-trailing flag, severity/role normalization, the action and close controls, and axe. All pass.
  • Visual baselines are regenerated in a follow-up commit on this branch — the 24 existing Message snapshots are stale, and the new Sizes / WithLinks stories need new ones.

Known gaps, not addressed here

  • The action/close sizes are type-checked but not behaviourally tested: Button and IconButton expose no data-size, and .claude/rules/testing.md forbids class-string assertions. Adding data-size to those two legacy components is the real fix.
  • The spec's a11y section claims "touch target ≥40×40 px"; the trailing controls are 28/32px. Pre-existing (the close was already 28px), and it clears WCAG 2.2's 24px AA minimum, but the claim and the implementation should be reconciled — a design call.
  • On size="small" the 12px gap now exceeds the 8px inline padding, so the icon sits closer to the banner edge than to the copy. Left as-is; data-[size=small]:gap-[var(--spacing-xs)] would even it out.

Message presented a title/description stack, so copy carrying an inline link
had no home: the only escape was the default slot, which replaced the icon
and the entire layout along with it. The banner is now a single line of copy
in one content region that keeps the leading icon and styles anchors with the
.text-link token, and it gains a size token driving the height floor, inline
padding, and copy scale.

- title + description replaced by an optional label, with the default slot as
  the primary path for copy that needs inline markup
- size ('small' | 'medium') added; root and content region expose data-size
- data-trailing tightens the end inset when an action or close control brings
  its own padding
- spec, tests (33 passing in browser mode), and the Message and
  DeleteDomainDialog stories moved onto the new surface, along with the
  title -> label call sites in the shipped webkit-form, webkit-ui-states, and
  webkit-ui-verify skills

BREAKING CHANGE: Message no longer accepts title or description. Pass the copy
as label, or in the default slot when it needs inline links: severity="warning"
title="..." becomes severity="warning" label="...". A second description line
has no replacement — fold it into the single copy line. The __title and
__description testids are replaced by one __content testid.
…ze its controls

The reshaped banner left its trailing controls on fixed sizes and its copy on
the body type scale, so a small banner still carried a medium action and the
icon rendered at whatever font-size the host page happened to set.

- the built-in action is a `secondary` Button instead of `text`, so it reads as
  a control rather than as body copy on the tinted surface
- both trailing controls take the banner's size: `small` -> Button/IconButton
  `small` (28px), `medium` -> `medium` (32px)
- message copy moves to the label type scale (`.text-label-sm` 12px /
  `.text-label-md` 14px), replacing the body steps at the same pixel sizes
- the leading icon is a fixed 14px (`size-3.5` box, `.text-label-md` glyph),
  replacing `size-4` plus `text-[length:inherit]`, which had the glyph
  inheriting the host page's font-size instead of a token

Spec token table records the resolved values (gap 12px, inline padding 8/12px,
icon 14px) and a theme gap for the missing icon-size scale.
Generated on ubuntu-latest via the Storybook Regenerate Baseline workflow
(run 30483122954) — 24 updated for the new copy scale, 14px icon, and resized
trailing controls, plus 12 new for the Sizes and WithLinks stories.
@robsongajunior
robsongajunior merged commit 792d880 into main Jul 29, 2026
23 checks passed
@robsongajunior
robsongajunior deleted the feat/message-label-slot-api branch July 29, 2026 20:02
gabriel-lisboa-azion added a commit that referenced this pull request Jul 30, 2026
…prop

Upstream #833 reshaped Message onto slot-first copy and removed the `title`
and `description` props. Vue forwards unknown props through $attrs, so all 15
usages in this app silently stopped rendering their copy — `title` landed as a
native browser tooltip instead.

Rename them to `label`, collapsing the eight title+description pairs into a
single string, since the reshaped banner renders one copy paragraph rather than
a title/description stack. No copy was dropped.
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