2.3 KiB
2.3 KiB
Tasks & Issues
1. Critical Issues
-
1.1 Fix missing
delimport in store/index.js ✅ COMPLETE- Line 3 now imports
get, set, delfrom idb-keyval - Used in removeItem function on line 13
- No more ReferenceError
- Line 3 now imports
-
1.2 Fix hydration flag initialization ✅ COMPLETE
- Implemented Option A: Initialize
_hydrated: trueby default - Removed problematic
onRehydrateStoragecallback - App now loads immediately without hanging on "loading..."
- Persistence happens in background automatically
- Implemented Option A: Initialize
-
1.3 Consolidate duplicate storage implementation ✅ COMPLETE
- Single storage implementation in
store/index.js - Uses idb-keyval directly with createJSONStorage
- Clean, simple approach without extra middleware files
- Single storage implementation in
2. Architectural Improvements
-
2.1 Add error handling ✅ COMPLETE
- Added try/catch blocks around all IndexedDB operations (getItem, setItem, removeItem)
- Implemented fallback: returns null on getItem error, silently fails on setItem/removeItem
- Added error state to store with auto-clear after 3 seconds
- Added validation in addItem and removeItem actions
- Created error-toast component with slide-in animation
- Toast shows error messages and allows manual dismissal
-
2.2 Add partialize option to persist middleware ✅ COMPLETE
- Added partialize to exclude
_hydratedflag from persistence - Only persists: user, items, and route
- Prevents unnecessary data in IndexedDB
- Added partialize to exclude
-
2.3 Add basic CSS reset to index.html
- No base styles, margins, or font settings currently
- Consider adding minimal reset or normalize.css
-
2.4 Add loading states for async operations
- No loading indicators for add/remove item operations
- Consider adding optimistic updates
3. Nice to Have
-
3.1 Add TypeScript types (optional)
- JSDoc comments for better IDE support
- Or migrate to .ts files with no-build setup
-
3.2 Add cross-tab synchronization
- README mentions optional
sync.jsmiddleware - Implement BroadcastChannel for cross-tab state sync
- README mentions optional
-
3.3 Add route history management
- Integrate with browser history API
- Support back/forward navigation
-
3.4 Add unit tests
- Test store actions and selectors
- Test component rendering
- Test persistence layer