Skip to content

DX: add a dev:reset script that clears local storage - #1576

Merged
Baskarayelu merged 4 commits into
Remitwise-Org:mainfrom
1nonlypiece:dx/1500-dev-reset-script
Jul 30, 2026
Merged

DX: add a dev:reset script that clears local storage#1576
Baskarayelu merged 4 commits into
Remitwise-Org:mainfrom
1nonlypiece:dx/1500-dev-reset-script

Conversation

@1nonlypiece

Copy link
Copy Markdown
Contributor

Summary

npm run dev:reset prints the URL (http://localhost:<port>/?dev-reset) that clears the app's localStorage. A Node script can't reach into a running browser's storage directly, so the actual clearing happens client-side: a new DevResetHandler (mounted in Providers.tsx, same Suspense-wrapped useSearchParams pattern as the existing DevRequestIdDisplay) watches for the ?dev-reset param, clears every key in the new DEV_RESET_LOCAL_STORAGE_KEYS registry (theme preference, display density, "what's new" seen-state, dev mode), then strips the param so a refresh doesn't re-clear.

Testing

  • node scripts/dev-reset.mjs -- prints the expected URL
  • node node_modules/vitest/vitest.mjs run ... tests/unit/dev/resetLocalStorage.test.ts -- 3/3 pass
  • npm run test:unit:vitest -- 300 passing (was 297 on main), zero regressions
  • npx eslint on all touched files -- clean
  • npx tsc --noEmit -- no new errors in any touched file

Closes #1500

@Baskarayelu
Baskarayelu merged commit acaccbe into Remitwise-Org:main Jul 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DX: add a dev:reset script that clears local storage

2 participants