From 199c1b3b3ca40909bc964f4a363294c8d84ecc66 Mon Sep 17 00:00:00 2001 From: David <60177543+davd-gzl@users.noreply.github.com> Date: Wed, 22 Jul 2026 19:17:37 +0000 Subject: [PATCH 1/2] Filters persist fully across sessions; stats airport tiles open airports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Every filter VALUE now persists to localStorage, not just status/minPop/sort/ mode: date, folder, category, country, continent and the growth flags ride in one JSON blob, restored + validated field-by-field. The map and the lists both reopen exactly as you left them. (listOnly stays session-scoped — it's a mode, not a value.) - Stats "airports" tiles (the KPI and the counter strip) opened the generic "visited" list; they now open Places narrowed to your visited AIRPORTS via a new "airports" view. - World-level stats tiles clear any country drill-down before opening, so they never stay stuck on the last country a card opened (matters now that the country filter persists). --- .../src/features/stats/StatStrip.tsx | 10 ++- .../src/features/stats/StatsView.tsx | 18 +++-- .../src/features/visits/PlacesScreen.tsx | 4 ++ apps/postcards/src/lib/store/useFilters.ts | 65 ++++++++++++++++++- apps/postcards/src/lib/store/useUi.ts | 1 + apps/postcards/tests/unit/filterState.spec.ts | 29 +++++++++ 6 files changed, 117 insertions(+), 10 deletions(-) diff --git a/apps/postcards/src/features/stats/StatStrip.tsx b/apps/postcards/src/features/stats/StatStrip.tsx index e362165..e3e84d6 100644 --- a/apps/postcards/src/features/stats/StatStrip.tsx +++ b/apps/postcards/src/features/stats/StatStrip.tsx @@ -2,6 +2,7 @@ import { useMemo } from "react"; import { useVisits } from "../../lib/store/useVisits"; import { useSettings } from "../../lib/store/useSettings"; import { useUi, type PlacesView } from "../../lib/store/useUi"; +import { useFilters } from "../../lib/store/useFilters"; import { getReferenceData } from "../../lib/reference/referenceData"; import { computeCoverage } from "./computeStats"; import { formatInt, formatPercent } from "../../lib/format/format"; @@ -64,7 +65,12 @@ export function StatStrip() { +