Replace every blocking alert() with a light toast, fix a mobile grid bug #12
Loading…
Reference in a new issue
No description provided.
Delete branch "feature/toast-notifications"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
toast.ts/toast.css: a light, auto-dismissing toast notification, styled afterPlayer.css's existing.requestBannerbut generalized to work from any page (position: fixedagainst the viewport, self-mounting singleton - no Shell.ts wiring needed).alert()in the client (10 call sites: the host-handoff notice inPlayer.ts, plus every "couldn't start/join a party" error acrossPlayer/MusicBar/tiles.ts's sharedwireTileButtons/Home/Series/Playlist/Artist/Album) withshowToast(message, { variant }).info(default - the host-handoff message) anderror(every migrated failure) - the only visual difference is a plainborder-leftaccent, deliberately not a red banner/fill, matching this app's existing restraint elsewhere.minmax(160px, 1fr)floor left no room for a second column on an ordinary ~360-393px-wide phone once.mainContent's padding is subtracted - unlike the sidebar/music bar, this grid never got a narrow-screen treatment at all. Fixed with a fluidclamp(100px, 28vw, 160px)floor instead of a fixed breakpoint.Context
Asked for directly ("rework the messages sent to the client, especially when becoming host - show a light toast"). Once looking at that one call site, every other
alert()turned out to be the exact same pattern, so all of them moved together rather than leaving a half-migrated mix of toasts and blocking alerts. The grid fix was a separate, concrete bug report from a real device that came in mid-task; small and unrelated enough in cause to not need its own branch, but reported and fixed in the same sitting.Verification
typecheck/build(client only).alert(calls remain inclient/src(only comments mentioning the word).requestAnimationFrametrick (needed so the transition isn't coalesced with the element's own insert) checked against a real element in a real browser.<iframe>(its own independent viewport forvwunits - this sandbox'sresize_windowemulation has been unreliable all session). Every phone width from 320-393px now gets 2 columns (was 1), 430px gets 3, and 768/1200px match the old fixed-160px behavior exactly - confirmed empirically, not just computed by hand.Test plan
🤖 Generated with Claude Code