Skills: TypeScript · React · localStorage
Time: ~30 minutes
Good for: Quick win · first-PR
Difficulty: Beginner-friendly
Context
The search palette's type-filter chips (People · Planets · Ships · …) reset on close. Power users who consistently filter by, say, "people only" have to re-toggle every time they open search.
Goal
Persist typeFilter to localStorage with key holocron:search_filter. Restore on palette open. Clear on click of the existing "Clear" button.
Where to start
components/explorer/SearchPalette.tsx
typeFilter state initializer reads from localStorage (with a try/catch for SSR / disabled-storage)
- A
useEffect([typeFilter]) writes back
Acceptance criteria
- Filter survives palette close/reopen
- Filter survives full page reload
- Filter cleared on "Clear" button + on
localStorage clear
- Doesn't break SSR (storage access is client-only)
npx tsc --noEmit exits 0
Context
The search palette's type-filter chips (
People · Planets · Ships · …) reset on close. Power users who consistently filter by, say, "people only" have to re-toggle every time they open search.Goal
Persist
typeFiltertolocalStoragewith keyholocron:search_filter. Restore on palette open. Clear on click of the existing "Clear" button.Where to start
components/explorer/SearchPalette.tsxtypeFilterstate initializer reads fromlocalStorage(with a try/catch for SSR / disabled-storage)useEffect([typeFilter])writes backAcceptance criteria
localStorageclearnpx tsc --noEmitexits 0