Problem
AppContext.jsx currently contains direct localStorage operations for:
- PAT (
oe_pat)
- Rate limit (
oe_rate_limit)
- Recent searches (
oe_recent)
This couples storage logic with application state and makes it harder to maintain.
Proposed Solution
Create a reusable storage utility at:
src/utils/storage.js
The utility should:
- Centralize
localStorage access
- Define storage keys using
STORAGE_KEYS
- Provide
get, set, and remove methods
Then update src/context/AppContext.jsx to use the storage utility instead of accessing localStorage directly.
Expected Result
- No direct
localStorage calls in AppContext.jsx
- Storage keys have a single source of truth
- Existing PAT, rate-limit, and recent-search behaviour remains unchanged
Type: Code Quality Improvement
Problem
AppContext.jsxcurrently contains directlocalStorageoperations for:oe_pat)oe_rate_limit)oe_recent)This couples storage logic with application state and makes it harder to maintain.
Proposed Solution
Create a reusable storage utility at:
src/utils/storage.jsThe utility should:
localStorageaccessSTORAGE_KEYSget,set, andremovemethodsThen update
src/context/AppContext.jsxto use the storage utility instead of accessinglocalStoragedirectly.Expected Result
localStoragecalls inAppContext.jsxType: Code Quality Improvement