feat(ui): single-URL game app-shell (in-memory screens/views) #35
Reference in New Issue
Block a user
Delete Branch "feature/ui-app-shell"
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?
Collapses the whole game UI into a single stable URL (
/game/) with allscreen/view state held in memory — the address bar never changes.
What changed
+page.svelte) acts as a screen dispatcher;login / lobby / lobby-create / game are in-memory screens, in-game
views (map / table / report / battle / mail / designer-science) are
in-memory views. The
games/[id]/**,login/,lobby/route treesare gone; their components moved to
src/lib/screens/&src/lib/game/.src/lib/app-nav.svelte.ts(appScreen+activeViewrune singletons), persisted to
sessionStorage. The auth gate is nowstate-based (no
gotoredirects).pushState/page.state): browser Back from a game → lobby, the URL stays/game/,in-game view switches add no history.
sessionStorage, with boot-time validationof the restored game (cancelled/removed → lobby + toast). Re-entering a
game from the lobby starts at the map (only an in-place refresh restores).
activeView.select.Mobile fix
.game-shellwasmin-height: 100vh, so sub-pixel overflow made thedocument scrollable; on mobile that toggles the dynamic toolbar and
resizes the
position: fixedoverlays mid-gesture, breaking taps on thebottom-tabs / map menu / planet sheet. Pinned with
position: fixed; inset: 0on the mobile breakpoint (desktop unchanged).Compatibility
Standalone targets in
ui/PLAN.md(Wails / Capacitor / gomobile) load asingle bundled
index.html— the app-shell is the natural fit. PLAN.mdPhase 10 carries a supersede note.
Tests / docs
pnpm checkclean; full e2e green on all four browser projects; mobilesuite 82/82 after the fix.
window.__galaxyNav.enterGame(...); unittests mock
$lib/app-nav.svelte.ui/docs/{navigation,order-composer,auth-flow,pwa-strategy, game-state,...},ui/README.md,ui/PLAN.md.🤖 Generated with Claude Code
- A restored game that no longer exists (cancelled/removed/revoked) drops to the lobby with a toast instead of the in-game error state: game-state exposes a `notFound` flag and the shell redirects via appScreen.go("lobby"). - Add a visible "return to lobby" control to the in-game header. - Push/toast deep-links use activeView.select(...) (no URL); fix a latent visibility-listener double-install on in-place game switches. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>The single-URL restore replays the saved screen/view on an in-place refresh only. Re-entering a game from the lobby resets activeView to the map (lobby calls activeView.reset() before appScreen.go("game")), and browser Back / the return-to-lobby control exit to the lobby. Spell this out so the refresh-restore is not mistaken for a per-re-enter restore. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>