fix(a11y): pair Toast variant background with a severity icon (WCAG 1.4.1)#3449
Open
bilal-karim wants to merge 2 commits into
Open
fix(a11y): pair Toast variant background with a severity icon (WCAG 1.4.1)#3449bilal-karim wants to merge 2 commits into
bilal-karim wants to merge 2 commits into
Conversation
….4.1) Toast variants (success/error/info/warning) previously distinguished severity exclusively by background color. Sighted users with color-vision differences (deuteranopia, protanopia, achromatopsia) could not tell a success toast from an error toast on the surface itself. Add a leading Icon keyed to the variant: success/error/info/ warning each render their named icon; the neutral 'primary' variant (no severity) renders no icon. Icon names match the existing alert.svelte pattern and resolve to confirmed entries in the IconName set. The accessible announcement is unchanged -- Toaster's role="log" still carries the message text via the slot, and the new icon is purely decorative. Affects every toaster.push consumer including cancel/terminate/ reset/signal/pause confirmations, batch actions, deployment edits, and file upload flows. Single primitive-level change; no consumer migration required. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
temporal-cicd flagged a TS warning on the conditional Icon render:
the expression variantIcon[variant] is typed IconName|null but
Icon's name prop expects IconName. Svelte template doesn't narrow
the type through the {#if} guard.
Extract the lookup into a reactive `$: icon = variantIcon[variant]`
in the script so the {#if icon} guard narrows icon to IconName
(non-null) for the Icon prop. Pure type refactor -- runtime
behavior identical.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Toast variants (
success/error/info/warning) previously distinguished severity exclusively by background color. Sighted users with color-vision differences (deuteranopia, protanopia, achromatopsia) could not distinguish a success toast from an error toast on the surface itself — onlybg-successversusbg-danger.This PR adds a leading
Iconkeyed to the variant via avariantIconlookup. The neutralprimaryvariant (no severity intent) renders no icon. Icon names mirror the establishedalert.sveltepattern.Before / After
success,error,info,warningeach gain a leading severity icon. The neutralprimaryvariant renders no icon (no severity intent). Background colors and message text are unchanged.The accessible announcement is unchanged — Toaster's
role="log"still carries the message text via the slot. The new icon is purely decorative.Audit context
audit-output/issues/1.4.1-toast-severity-icon.md(part of the Wave 2 Holocene severity-primitive bundle — Toast is the first of four; Badge / Chip / Banner ship as separate PRs).Affected callsites (all benefit automatically)
Every
toaster.push({ variant, message })consumer inherits the fix. No per-consumer change required. Includes activity-options-update, activity reset/cancel/terminate confirmations, all workflow client-actions (batch cancel/terminate/reset, pause/unpause, signal, update), event-history import, deployment edits, and file upload.Test plan
toaster.stories.svelte— all 5 variants render correctly;primaryshows no icon.role="log"; the decorative icon does not double-announce.Out of scope
role="log"→role="alert"for error toasts (that's SC 4.1.3 Status Messages).🤖 Generated with Claude Code