The current storage layout (src/lib/config.ts) packs every user-defined function into a single functions key of chrome.storage.sync. storage.sync enforces QUOTA_BYTES_PER_ITEM = 8192, so users hit write failures once their function list grows past a handful of medium-sized functions.
Goals:
- Split storage so a single function's size, not the total list size, governs the per-item limit (e.g. one item per function under a stable key like
fn:<id>, plus an index).
- Reconsider the storage area itself —
storage.sync has tight quotas; storage.local has 10 MB and is a candidate if cross-device sync is not essential, or a hybrid (index in sync, bodies in local) is possible.
- Provide a one-time migration from the old single-key layout.
- Surface quota errors to the UI instead of silently failing.
This work pairs naturally with #178 (cross-browser support) — if storage access goes through a small interface, the same redesign can land on Firefox/Safari without further changes.
The current storage layout (src/lib/config.ts) packs every user-defined function into a single
functionskey ofchrome.storage.sync.storage.syncenforcesQUOTA_BYTES_PER_ITEM = 8192, so users hit write failures once their function list grows past a handful of medium-sized functions.Goals:
fn:<id>, plus an index).storage.synchas tight quotas;storage.localhas 10 MB and is a candidate if cross-device sync is not essential, or a hybrid (index in sync, bodies in local) is possible.This work pairs naturally with #178 (cross-browser support) — if storage access goes through a small interface, the same redesign can land on Firefox/Safari without further changes.