Skip to content

app: on-device storage usage indicator on Auto Sync page (firmware 3.0.20+)#9568

Merged
mdmohsin7 merged 10 commits into
mainfrom
caleb/device-storage-indicator
Jul 14, 2026
Merged

app: on-device storage usage indicator on Auto Sync page (firmware 3.0.20+)#9568
mdmohsin7 merged 10 commits into
mainfrom
caleb/device-storage-indicator

Conversation

@mdmohsin7

@mdmohsin7 mdmohsin7 commented Jul 12, 2026

Copy link
Copy Markdown
Member

What

Adds a Device Storage usage indicator to the Auto Sync page, shown only for devices on firmware 3.0.20+ (the ring-buffer protocol). It surfaces how full the on-device audio ring is — used / total, % full, and free space — so users know when to sync before the ring overwrites unsynced audio.

The reading already existed on the wire: getRingStatus() reads the 16-byte storage status characteristic (used / unread / free / rtcValid). Today that value is read once during auto-sync detection and discarded; this PR caches it on DeviceProvider and renders it.

UI

Compact card above the STORAGE settings section: title + % full, a slim usage bar, and a used of total · free summary line. The bar shifts purple → amber (≥80%) → red (≥95%), and a "Device nearly full — sync to free space." hint appears at ≥95%. Design follows the WhatsApp/Spotify storage patterns adapted to omi's dark card style.

On firmware < 3.0.20, no paired device, or no reading available, the card is simply absent — no regression for existing users.

Changes

  • providers/device_provider.dartringStatus getter + refreshRingStorageStatus(); also caches the reading on the existing auto-sync ring path (no extra BLE read).
  • pages/conversations/widgets/device_storage_card.dart (new) — the presentational card (reuses WavBytesUtil.formatBytes, ResponsiveHelper colors).
  • pages/conversations/auto_sync_page.dartConsumer3 incl. DeviceProvider; refresh on page open; gated render via WalSyncs.isRingBufferFirmware.
  • l10n — 5 deviceStorage* keys added to the English template and translated across all 48 other locales (+ regenerated Dart).

Testing

  • test/widgets/device_storage_card_test.dart — 4 tests: normal fill (72%, purple, no hint), warning band (amber), nearly-full (red + hint), and zero-total (no divide-by-zero). All pass.
  • flutter analyze clean on the new code.
  • flutter gen-l10n — zero untranslated messages across 49 locales.

Not yet exercised: the device-connected end-to-end (real getRingStatus() → card on a physical 3.0.20+ device over BLE) — needs hardware. The widget tests cover the card's rendering/logic; the BLE→provider→UI path is unverified on-device.

Review in cubic

@kodjima33 kodjima33 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — on-device storage usage indicator. Approve-only (mobile feature, CI still running).

@mdmohsin7 mdmohsin7 merged commit 1b22731 into main Jul 14, 2026
19 checks passed
@mdmohsin7 mdmohsin7 deleted the caleb/device-storage-indicator branch July 14, 2026 13:19
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