Repository navigation
feat(ui): let visitors swap the welcome survey storage live - #16
Merged
arnaud-zg merged 1 commit intoSep 2, 2026
Merged
Conversation
arnaud-zg
force-pushed
the
feat/dev-settings-storage-switch
branch
from
September 2, 2026 09:58
5657fdd to
541bbfa
Compare
The repo already had three interchangeable WelcomeStorageRepository implementations (Local Storage, TanStack Store, Zustand), but picking one meant editing storage.config.ts and rebuilding. That's the only real Strategy-pattern swap point in the app right now: CourierPolicy, TaxPolicy and GoldSilverCopperFormatter each have a single implementation, and theme and locale are already user-facing. Added a gear icon in the header that opens a settings modal to pick the implementation live, no rebuild. useWelcomeModalSurvey now resolves its repository from a small DevSettingsContext instead of a hardcoded import, recreating it (and resubscribing) whenever the selection changes. Splitting storage.config.ts's key/type/default from its actual factories (new welcomeSurveyStorageKeys.ts) and lazy-loading the modal itself keeps DevSettingsProvider, which now wraps every route via the root layout, from pulling zustand, TanStack Store and zod into the home page's bundle just to hold a string in state. ## Test plan - pnpm typecheck - pnpm check - pnpm lint:md - pnpm test:coverage, 25 files, 128 tests, thresholds pass - pnpm build, confirmed the home page bundle no longer references the storage.config chunk (dev settings modal loads it lazily on demand) - pnpm test:e2e - new specs cover: the context's default/persist/read-back behavior, the modal's radio list, and switching live between Local Storage and TanStack Store (same data, since both read the same key) versus Zustand (its own persist-middleware envelope, provably a different format) Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014BcGPRc3sgUJYKihGRXh5g
arnaud-zg
force-pushed
the
feat/dev-settings-storage-switch
branch
from
September 2, 2026 18:42
541bbfa to
7b278c2
Compare
This was referenced Sep 2, 2026
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.
Stacked on #15.
Summary
survey's storage, with three interchangeable implementations (Local Storage, TanStack
Store, Zustand) already sitting behind
WelcomeStorageRepository. Everything else(
CourierPolicy,TaxPolicy, the currency formatter) has a single implementation,and theme/locale are already user-facing switches
rebuild needed
useWelcomeModalSurveynow resolves its repository from a smallDevSettingsContextinstead of a hardcoded import, recreating it whenever the selection changes
storage.config.ts's key/type/default out into its own file and lazy-load thesettings modal, so the provider (which now wraps every route) doesn't drag zustand,
TanStack Store and zod into the home page's bundle just to hold a string
Test plan
pnpm typecheckpnpm checkpnpm lint:mdpnpm test:coverage, 25 files, 128 tests, thresholds passpnpm build, confirmed the home page no longer references the storage.configchunk (the modal loads it lazily on demand)
pnpm test:e2eswitch test (Local Storage keeps TanStack Store's data since both read the same key,
Zustand persists through its own envelope, provably a different format)
🤖 Generated with Claude Code
https://claude.ai/code/session_014BcGPRc3sgUJYKihGRXh5g