feat(pwa): #32 offline-queue storage-quota warning (util + QueueStatusPill)#134
Merged
Merged
Conversation
…sPill) Adds the storage-warning slice of #32 (020 PWA Background Sync): - src/lib/offline-queue/storage-quota.ts — wraps navigator.storage.estimate() with an 80% warning threshold (STORAGE_WARNING_THRESHOLD). Fails open: missing StorageManager API (older Safari / non-secure contexts), zero/invalid quota, or a throwing estimate() all degrade to 'unknown / no warning' rather than throwing. Plus isStorageNearQuota() + formatStorageUsage() helpers. - src/components/molecular/QueueStatusPill/ (5-file) — composes the atomic QueueStatusIndicator (queued/syncing/failed/offline) with a storage-quota warning alert shown when usage is near quota, so users learn the offline queue may stop persisting before it silently fails. Tests: 14 (8 util — threshold, divide-by-zero guard, fail-open, formatting; 4 component — warning shown/hidden, usage figure present/omitted; 2 a11y, 0 axe violations). type-check + lint clean; structure validator 108/108. Scope note: this is the storage-warning sub-slice the triage flagged as blockedOn:nothing. The broader Firefox/Safari background-sync fallback + retry-UI parts of #20 remain; not closing #32 outright — advancing it. Advances #32. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Advances #32 (020 PWA Background Sync) — the storage-quota-warning slice.
What
src/lib/offline-queue/storage-quota.ts— wrapsnavigator.storage.estimate()with an 80% warning threshold. Fails open: missing StorageManager API (older Safari / non-secure contexts), zero/invalid quota, or a throwingestimate()all degrade to unknown / no warning. PlusisStorageNearQuota()+formatStorageUsage().src/components/molecular/QueueStatusPill/(5-file) — composes the atomicQueueStatusIndicatorwith a storage-warning alert, so users learn the offline queue may stop persisting before it silently fails on a full device.Verification
Scope
This is the
blockedOn: nothingsub-slice from triage. The broader #20 work (Firefox/Safari background-sync fallback + retry UI) remains — so this advances #32 rather than closing it.Part of the #115 Tier-1 backlog sweep. 🤖 Generated with Claude Code