Skip to content

feat(pwa): #32 offline-queue storage-quota warning (util + QueueStatusPill)#134

Merged
TortoiseWolfe merged 1 commit into
mainfrom
feat/offline-storage-quota-32
Jun 5, 2026
Merged

feat(pwa): #32 offline-queue storage-quota warning (util + QueueStatusPill)#134
TortoiseWolfe merged 1 commit into
mainfrom
feat/offline-storage-quota-32

Conversation

@TortoiseWolfe

Copy link
Copy Markdown
Owner

Advances #32 (020 PWA Background Sync) — the storage-quota-warning slice.

What

  • src/lib/offline-queue/storage-quota.ts — wraps navigator.storage.estimate() with an 80% 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. Plus isStorageNearQuota() + formatStorageUsage().
  • src/components/molecular/QueueStatusPill/ (5-file) — composes the atomic QueueStatusIndicator with a storage-warning alert, so users learn the offline queue may stop persisting before it silently fails on a full device.

Verification

  • ✅ 14 tests (8 util incl. divide-by-zero guard + fail-open paths; 4 component; 2 accessibility, 0 axe violations)
  • ✅ type-check clean, lint clean, component-structure validator 108/108

Scope

This is the blockedOn: nothing sub-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

…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>
@TortoiseWolfe TortoiseWolfe merged commit ce4549e into main Jun 5, 2026
3 checks passed
@TortoiseWolfe TortoiseWolfe deleted the feat/offline-storage-quota-32 branch June 5, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants