fix(ui): F8-10 owner-feedback — persistent filters, camera, disabled visual, dropdown narrowing (#53)
Tests · UI / test (push) Has been cancelled
Tests · UI / test (pull_request) Successful in 2m53s

Polish pass after the first F8-10 walkthrough:

  - table-planets: moved the `foreign` chip to the end of the row and
    hid the race dropdown until `foreign` is on (it never made sense
    to pick a race while the bucket itself was off).
  - persistent per-table filter / sort state — extracted to
    `table-{planets,ship-groups,fleets}-state.svelte.ts` singletons so
    a row click → map → back to the table restores the prior chip /
    dropdown / sort state. Held in memory only; an F5 still resets.
  - table-ship-groups: the planet and class dropdowns now narrow to
    the slice surviving the owner checkboxes, so toggling `foreign`
    off removes planets / classes touched only by foreign rows.
  - map.svelte: camera (centre + zoom) is captured on every dispose
    path into a new `GameStateStore.lastCamera` and consumed on the
    next mount, so leaving the map for any other active view and
    coming back restores the prior pan / zoom. A pending focus from
    the tables still wins for the centre point.
  - table-ship-classes: `:disabled` now reads as disabled (muted
    colour, no hover ring, not-allowed cursor) — the click was already
    a no-op, only the visual was lying.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Ilia Denisov
2026-05-27 21:18:11 +02:00
parent 80ed11e3b6
commit 8e552f556d
12 changed files with 302 additions and 116 deletions
+11
View File
@@ -117,6 +117,17 @@ export class GameStateStore {
* `RendererHandle.setHiddenPrimitiveIds`.
*/
mapToggles: MapToggles = $state({ ...DEFAULT_MAP_TOGGLES });
/**
* lastCamera is the most recent map camera snapshot (centre + zoom)
* captured before the renderer was disposed — either because the
* map view unmounted (active-view switch) or because it remounted
* inside the same session. `map.svelte` reads it on cold mount so
* leaving the map for a table / report and coming back keeps the
* user's prior pan / zoom. Resetting to null falls back to the
* default world-centre + minScale fit. Held in memory only; an F5
* re-loads the report and the default fit takes over.
*/
lastCamera: { centerX: number; centerY: number; scale: number } | null = $state(null);
error: string | null = $state(null);
/**
* notFound is the distinct "this game is not in the player's list"