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
+13
View File
@@ -10,10 +10,23 @@ const ru: Record<keyof typeof en, string> = {
"common.loading": "загрузка…",
"common.dismiss": "закрыть",
"common.skip_to_content": "к основному содержимому",
"common.retry": "повторить",
"common.browser_not_supported_title": "браузер не поддерживается",
"common.browser_not_supported_body":
"Galaxy требует поддержки Ed25519 в WebCrypto. См. список поддерживаемых браузеров.",
"error.offline":
"Похоже, вы офлайн. Проверьте соединение и повторите попытку.",
"error.network": "Не удалось связаться с сервером. Повторите попытку.",
"error.auth": "Сессия истекла. Войдите снова.",
"error.forbidden": "Недостаточно прав для этого действия.",
"error.conflict":
"Данные изменились с момента загрузки. Обновите и повторите.",
"error.not_found": "Не найдено — возможно, удалено.",
"error.rate_limit": "Слишком много запросов. Подождите немного и повторите.",
"error.server": "На сервере произошла ошибка. Повторите попытку.",
"error.unknown": "Что-то пошло не так.",
"game.events.turn_ready.message": "ход {turn} готов",
"game.events.turn_ready.action": "открыть",
"game.events.signature_failed": "подпись повреждена, переподключение…",