Repository navigation
[haxcms-elements] HAX UI toast: same API, new look - #1037
Merged
Merged
Conversation
Replaces the speech-bubble toast with a card in the HAX UI admin style: the person's RPG character in a tile tinted by tone with a small tone badge, the message at 14px that wraps, a close button, HAX UI buttons for anything a caller slots in, and a thin bar with the time left (a moving bar while work is in progress). Light, dark and forced colours. At 600px and narrower it is a sheet along the bottom. Same API: store.toast() / HAXStore.toast(), haxcms-toast-show and haxcms-toast-hide, and every detail field. New and optional: `tone` (info, success, warning, danger, working, assistant); otherwise worked out from what callers already send (hat "error" is danger, "construction" or walking is working, merlin is the assistant). The hax:loading spinner that "Processing" slots in is hidden, since the working tone shows it. Fixes along the way: - the timer pauses while hovered or focused (WCAG 2.2.1) - duration 0 stays until closed (it silently became 4s, closing the view-only notice before its Exit button could be used) - problems are announced as alerts, with the tone in words - Esc closes it while focus is inside - eventCallback fires once on close (it fired twice) Only haxcms-toast.js changes; rpg-character-toast, simple-toast and app-hax's toast are untouched. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PfFvVUkTpLX8DucJwVoaVk
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
A proposal to replace the HAXcms toast with a card in the HAX UI admin style. It's the same API, so every existing call keeps working, with a new look and a few long-standing fixes. Part of the HAX UI admin work in haxtheweb/issues#3180.
What changes
Look.
Tone (new, optional:
info,success,warning,danger,working,assistant). When a caller doesn't set it, it's worked out from what callers already send:hat: "error"hat: "construction"orwalkingmerlin: truehat: "save"or"good"Fixes:
duration: 0now stays until closed. Today it silently becomes 4s, so the view-only notice closes before its Exit button can be used.role="alert", assertive), with the tone spoken in words.eventCallbackfires once on close; today it fires twice.API kept
store.toast()andHAXStore.toast()keep their signatures (about 220 calls).haxcms-toast-showandhaxcms-toast-hideevents are unchanged.text,duration,hat,fire,walking,speed,slot,closeText,eventCallback,alwaysvisible,merlin,futureandawaitingMerlinInput. The character still wears the hat, catches fire and walks.classStyle,accentColoranddarkare accepted and ignored.hax:loadingspinner that "Processing" slots in is hidden, because the working tone already shows progress.What it touches
elements/haxcms-elements/lib/core/haxcms-toast.jselements/haxcms-elements/test/haxcms-toast.test.jsrpg-character-toast,simple-toastand app-hax's toast are untouched.Tested
duration: 0, pause and resume, Esc,eventCallbackfiring once, slotted actions, the working spinner, Merlin, alert vs status, and axe.Follow-ups
hax:admin-check,hax:admin-warningandhax:admin-refreshonce the admin icon family (webcomponents#1031) lands.tone: saves assuccess, recoverable problems aswarning.https://claude.ai/code/session_01PfFvVUkTpLX8DucJwVoaVk
Generated by Claude Code