Filters persist across sessions; stats airport tiles fixed; "Save everything" ZIP backup - #25
Merged
Merged
Conversation
- 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).
…iles The JSON export already embeds photos (base64), but a giant single file is unwieldy and the images aren't browsable. Add a complete, portable archive: - New "Save everything (.zip)" export → a dependency-free ZIP (store method — photos are already compressed) holding a compact JSON manifest plus every photo as a real, openable file under photos/. The manifest is the canonical portable file with each photo's data URL swapped for a "zip:photos/…" ref, so the JSON stays small and readable. - Import now understands the .zip (detected by magic bytes): it re-inlines the referenced image files back into data URLs and restores through the SAME validated JSON path (Constitution VI — data stays inert). A missing image file drops that photo rather than breaking the restore. - Tiny CRC-32 + zip reader/writer in lib/backup/zip.ts (no new dependency). Verified: zip codec round-trip incl. a known CRC-32 vector; archive→import restores photos byte-identically; existing JSON/CSV import unaffected.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Three fixes from a feedback batch.
Filters persist fully across sessions
Only status/minPop/sort/mode used to survive a reload. Now every filter value persists (date, folder, category, country, continent, and the growth flags), stored in one JSON blob and validated field-by-field on load. The map and the lists both reopen exactly as you left them. (
listOnlystays session-scoped — it's a scope mode, not a value.)Stats "airport" tiles open airports
The airport KPI and the counter-strip airport tile opened the generic "visited" list. They now open Places narrowed to your visited airports via a new
airportsview. World-level stat tiles also clear any country drill-down before opening, so they never stay stuck on the last country a card opened (relevant now that the country filter persists)."Save everything" — a ZIP backup with photos as real files
The JSON export already embeds photos as base64, but a single giant file is unwieldy and the images aren't browsable. New "Save everything (.zip)" export writes a dependency-free ZIP (store method — photos are already compressed) holding a compact JSON manifest plus every photo as a real, openable file under
photos/. Import understands the.zip(detected by magic bytes), re-inlines the images, and restores through the same validated JSON path (data stays inert). A tiny CRC-32 + zip reader/writer lives inlib/backup/zip.ts— no new dependency.Gate:
tsc --noEmitclean · 451 unit tests (added filter-persistence + zip-archive round-trip incl. a known CRC-32 vector) · e2e green — a11y (axe WCAG 2.1 AA), filter-panel, airports, stats-drill, smoke, import-csv, import-security, durability.🤖 Generated with Claude Code
https://claude.ai/code/session_014W6tgHRgLEugCsbKC9ccST
Generated by Claude Code