Repository navigation
Closed
Description
Problem
The application is local-first and stores the canonical corpus in IndexedDB, with additional data in Cache Storage and attachment stores. Browser-managed origin storage is generally best-effort and may be evicted under storage pressure. The current storage reporting covers the embedding-model cache, but does not give users a complete view of origin quota or persistent-storage status.
Scope
Extend Settings → Storage with a reliable, privacy-preserving storage health panel.
Requirements
- Use
navigator.storage.estimate()when available and display estimated origin usage and quota. - Use
navigator.storage.persisted()to report whether persistent storage has been granted. - Provide an explicit user action to request persistence through
navigator.storage.persist(); explain that the browser may decline. - Show graceful unsupported/unavailable states for browsers that do not implement the APIs or reject calls.
- Distinguish measured values from estimates. Do not imply that Cache Storage content-length sums represent exact disk usage.
- Include known application-owned stores where safely measurable: canonical corpus, attachments, semantic cache/model cache and recovery data. Avoid expensive full scans on every settings render.
- Surface last successful backup time/status if this is already available from backup metadata; otherwise link to backup settings without inventing a timestamp.
- Warn when the origin is approaching its reported quota, using a documented threshold and conservative copy.
- Keep diagnostics local; do not transmit storage metrics.
Acceptance criteria
- Storage panel reports usage/quota when supported.
- Persistent-storage status and request action work in Chromium and gracefully degrade elsewhere.
- API failures never crash Settings.
- Tests cover unsupported APIs, rejected promises, null estimates and browser denial.
- E2E verifies the request action and status rendering.
- UI clearly explains that persistence is not a backup and cannot prevent manual site-data deletion or device loss.
- Existing model-cache clearing behavior remains unchanged.
References
- https://developer.mozilla.org/en-US/docs/Web/API/Storage_API/Storage_quotas_and_eviction_criteria
- https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/estimate
- https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/persist
- https://developer.mozilla.org/en-US/docs/Web/API/StorageManager/persisted
Metadata
Metadata
Assignees
Labels
No labels
Activity
d-oit commentedon Nov 19, 2026
Implemented in #1178 (90246d1).
reportStorageHealth()+storage-reportslice compute quota/persistence/durability diagnostics (storage estimate, IndexedDB envelope health, recovery metadata) with the shareddks-corestorage contracts (packages/dks-core/src/io.tsport contract unchanged by review).e2e/storage-health.spec.ts.