feat(ui): error & state UX (F4) #29
Reference in New Issue
Block a user
Delete Branch "feature/ui-finalize-f4-error-ux"
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?
F4 — Error & state UX
From
ui/PLAN-finalize.mdF4. Consistent, actionable feedback forfailures and for loading / empty / error states, plus the deferred
selected-planet marker and bottom-sheet dismissal.
What changed
src/lib/error/):classifyErrorcollapsesany caught value into a stable
ErrorKindfrom the reliable transportsignal — HTTP status (
AuthError), ConnectCode, fetchTypeError,navigator.onLine— sinceresult_codeis opaque per ARCHITECTURE.reportError(err, { onRetry? })raises a translated toast (sticky witha Retry action for retryable kinds; auto-dismiss otherwise);
errorMessageKey(err)returns the key for inline use.error.*messages added (en + ru). Mail compose now shows the translated 403
inline.
ViewState(src/lib/ui/view-state.svelte):loading/empty/error placeholder with a spinner, optional action, and
the right live-region role; the entity tables (races / sciences /
ship-classes) use it. Remaining views adopt it incrementally.
src/map/selection-ring.ts): an accent ringaround the selected planet, fed into the map's
buildExtras.src/lib/ui/sheet-dismiss.ts): tap-outsideon pointer events (no dependency).
Tests / docs
New unit tests:
error,view-state,selection-ring,sheet-dismiss.pnpm check0/0;pnpm test761 passing; the a11y axe + keyboardspecs still pass (12/12, chromium-desktop). Docs:
ui/docs/error-state-ux.md(+ index); F4 marked done.🤖 Generated with Claude Code