AOSSIE-Org / AOSSIE-Org/OrgExplorer

Refactor: Centralize localStorage Operations in a Storage Utility

未關閉
#194 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
enhancement
主要語言
JavaScript
星號
34
分支
92
平均合併
8 天 7 小時
30 天內合併 PR
12

描述

## 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

貢獻指南

開啟貢獻指南

研究方向

Start by reading src/context/AppContext.jsx to locate the PAT, rate-limit, and recent-search localStorage operations, then inspect the surrounding src/utils structure. Use the issue's expected results as the checklist: storage access and keys are centralized in src/utils/storage.js, AppContext.jsx has no direct localStorage calls, and existing behavior remains unchanged.

由索引模型根據 Issue 內容生成。

評估

技術堆疊
javascript
領域
frontend
Issue 類型
重構
難度
3/5
預估耗時
1-2 天
活躍度
活躍
描述清晰度
描述清楚
新手友好度
76/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。