feat(ui): error & state UX — error surface, view states, map selection, sheet gestures (F4)
Tests · UI / test (push) Waiting to run
Tests · UI / test (pull_request) Failing after 7m13s

- lib/error/: classify any caught error into a stable ErrorKind from the
  transport signal (HTTP status / Connect Code / fetch TypeError /
  navigator.onLine); map to translated error.* messages via reportError
  (sticky Retry toast for retryable kinds) or errorMessageKey (inline).
  Mail compose now surfaces the translated 403/error inline.
- lib/ui/view-state.svelte: shared loading/empty/error placeholder with
  the right live-region role + optional action; entity tables
  (races/sciences/ship-classes) migrated, rest adopt incrementally.
- map/selection-ring.ts: accent ring around the selected planet, fed into
  the map buildExtras alongside the reach circles.
- lib/ui/sheet-dismiss.ts: tap-outside + drag-handle swipe-down dismissal
  for the planet/ship-group bottom-sheets (hand-rolled pointer events).

Tests: error, view-state, selection-ring, sheet-dismiss (761 total).
Docs: ui/docs/error-state-ux.md (+ index); F4 marked done.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Ilia Denisov
2026-05-22 13:29:11 +02:00
parent 87d524fb89
commit 8dcaf1c6c6
22 changed files with 788 additions and 37 deletions
+12 -1
View File
@@ -91,7 +91,18 @@ Acceptance: no untranslated visible strings; missing-translation test is
green; locale persists. Tests: Vitest i18n bundle-structure +
missing-key detection.
## F4 — Error & state UX
## F4 — Error & state UX — done
Central error surface `src/lib/error/` (classify any error into a stable
`ErrorKind` from the transport signal; map to translated `error.*`
messages via `reportError` toast — sticky + Retry for retryable kinds —
or `errorMessageKey` for inline). Shared `ViewState` placeholder
(loading/empty/error with a11y roles), adopted by the entity tables.
Selected-planet ring on the map (`map/selection-ring.ts`, fed into
`buildExtras`). Bottom-sheet tap-outside + swipe-down dismissal
(`lib/ui/sheet-dismiss.ts`, hand-rolled pointer events). Error-surface
and `ViewState` adoption continue incrementally across the remaining
views. Docs: `ui/docs/error-state-ux.md`.
(From Phase 35, plus the deferred Phase 13/35 items.) Goal: consistent,
actionable feedback everywhere.