Error toast redesign: dedupe repeats and anchor above the station menu - #97
Open
rodrigohpalmeirim wants to merge 1 commit into
Open
Error toast redesign: dedupe repeats and anchor above the station menu#97rodrigohpalmeirim wants to merge 1 commit into
rodrigohpalmeirim wants to merge 1 commit into
Conversation
Repeated error messages (e.g. from retried requests) now refresh the existing toast and show a xN counter instead of stacking duplicates. Toasts move from the bottom of the screen, where they covered the station menu's bike list, to just above the sheet's top edge. The anchor tracks the sheet's predicted height as soon as a station is tapped (the skeleton list is sized from the station's bike count), so toasts don't wait for bike info to load, and a short transition glides them to the settled position. During trips, and while no sheet is open, they fall back to the bottom, which is free then. Also adds giraDebug console hooks (dev only) to fake a login, inject stations, and spawn toasts without a real account.
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
Error toasts had two problems: they were anchored bottom-center, right on top of the station menu's bike list, and repeated messages (e.g. from retried requests) stacked up as duplicates, eating screen space.
Dedupe with counter
Re-adding a message that's already visible now refreshes its timer and bumps a ×N badge on the existing toast instead of stacking a duplicate (
ui.svelte.ts).New look and placement
Toasts keep the warning-orange palette but get the rounded card shape with a warning icon, and anchor just above the station sheet's top edge instead of the screen bottom, so they never cover the bike list or its unlock buttons.
Anchor tracking
The sheet reports a new
anchorTopbinding: its predicted top edge, computed from the skeleton list height (known from the station's bike count the moment a station is tapped) rather than a rect measurement, so it's correct while bike info is still loading and while the resize animation is in flight. The toast container transitionsbottomover 300ms, so anchor changes glide instead of snapping. While dragging, the last anchor is held; during trips and with no sheet open, toasts fall back to the bottom, which is free then.The existing
posTopbinding (used by the location button, which intentionally hides while the sheet loads) is unchanged.Dev tooling
giraDebugconsole hooks (dev builds only):fakeLogin(),fakeStations(),selectStation(), andaddError()allow exercising the map UI and toasts without a real account.Testing
svelte-check: 0 errors, 0 warnings; eslint clean on changed files; 45/45 vitest tests pass.