Repository navigation
feat(sync): sync page redesign — quiet card, filter chips, sync→conversation copy - #7404
Conversation
…ryCount Single source of truth for how a recording's sync state is shown to the user: syncing / synced / waiting / retrying / failed / corrupted. Lets the UI render an explicit label per recording so a not-yet-synced item is never visually identical to a failed one.
displaySortedWals, per-state counts, walsForDisplayFilter() and the WalDisplayFilter enum. Purely additive — the legacy WalStatusFilter / pendingWals / syncedWals API is untouched so the older SyncPage is zero-risk.
- Always-visible status header (All backed up / Backing up N / N waiting / N need attention) — synced work is no longer hidden behind a tab, and the all-synced state is persistent completion feedback. - Replace binary Pending/Synced tabs with one unified list + an All/Pending/Synced/Issues filter (default All). - Every row carries an explicit status icon + colored label, so waiting, retrying, failed, corrupted and synced are visually distinct. - Per-row Retry action on failed recordings; localize the previously-hardcoded 'Sync in progress' string.
13 new keys: status header summaries, per-row sync status labels, filter chip labels, empty state. Non-English locales fall back to English until translations land (follow-up).
flutter gen-l10n output. Non-English locales currently English-fallback for the 13 new keys; native translations are a tracked follow-up.
The unified list renders all recordings in a single Column; two Wals can share id (device_timerStart) across storage copies, producing duplicate keys -> 'Duplicate keys found' assertion and a cascade of layout errors. Suffix the key with the row index to guarantee uniqueness.
The client now uploads audio, marks the recording 'uploaded', and reconciles it against the job_id later (out of the upload critical path). A 24h TTL covers the common once-a-day app-open pattern so the app can learn a job already succeeded and fetch conversation ids instead of re-uploading. Efficiency window only — client retains the local file until synced, so an expired job is a safe re-upload (server dedups by timestamp). STALE_THRESHOLD left at 600s (separate in-flight liveness guard).
New 'uploaded' state = audio safely received by the server (HTTP 202), job processing in the background, NOT yet confirmed and NOT deletable. jobId/uploadedAt persist so a background reconciler can resolve the job across navigation and app-kill. Backward compatible (defaults null/0).
Adds the WalSyncDisplayState.uploaded case to _rowVisual (keeps the exhaustive switch valid): 'Uploaded · processing on Omi', cloud-sync icon, neutral blue — visually distinct from waiting/synced/failed.
…chSyncJobStatus) uploadLocalFilesV2 returns at the 202 (jobId) or the 200 fast-path (finished result) — no polling. fetchSyncJobStatus does a single GET and classifies the outcome (ok / notFound=expired-or-unknown / transient) so the reconciler can own the polling cadence and the re-upload fallback. Old polling syncLocalFilesV2 kept until callers migrate (Steps 3 & 6).
…ssing) syncAll/syncWal now POST and return at the 202 (or 200 fast-path) instead of polling each batch to terminal before the next. On 202: stamp the shared jobId + uploadedAt and set status=uploaded; the reconciler resolves the job out of the critical path. On 200 fast-path: mark synced + surface results as before. On upload failure: stay 'miss' (retryable next sync). Also fixes two latent bugs in the original loop: - corrupted WALs in an otherwise-successful batch were wrongly marked synced (post-loop iterated the whole [left,right] range); now only WALs that actually became files are mutated. - single syncWal could throw LateInitializationError on a missing file (late File walFile never assigned); now guarded with an early return. Cancel no longer reverts already-'uploaded' WALs (safe on server).
Groups uploaded WALs by shared jobId, polls each job (bounded concurrency): completed -> synced + surface conversation ids; partial/failed -> revert to miss + retry++ (server dedups already-done segments); 404/expired -> re-upload if local file kept, else corrupted; transient -> leave for next pass. Idempotent; only touches 'uploaded' WALs so it never contends with the upload loop (which only touches 'miss').
…mer) Drives reconcileUploadedWals off the critical path: on-demand poke (startup/screen/after-upload), debounced, with a 20s->2m backoff timer while any recording is still 'uploaded'. Scheduling only; conversation surfacing goes through an injected callback so services never import providers. Survives app-kill via persisted WAL state.
Attach reconciler on init (poke resumes uploaded WALs from a prior session); incremental conversation surfacing as jobs finish without disturbing an active sync; poke after a sync/cancel. pendingWals now includes 'uploaded' so it stays visible in the legacy page/counts; add uploadedWals getter. cancelSync already preserved status, so 'uploaded' WALs keep reconciling.
Per the approved plan and user feedback ('messy, too many things, the
backing-up message is unnecessary'): drop the status banner and the
All/Pending/Synced/Issues chips. One unified list with a quiet
'Recordings N' header; every row already states its own status
explicitly. Poke the reconciler while the screen is open.
Auto-sync / orphan-recovery now upload (202) and let the reconciler finish the job instead of polling to terminal with an in-method 5/10/20s retry loop. 200 fast-path -> synced; 202 -> uploaded+jobId + poke reconciler; offline -> retry later (no retryCount++); real failure -> retryCount++ for orphan recovery / next sync.
…back All three callers migrated to uploadLocalFilesV2 + the reconciler. No dead band-aid left behind.
A WAL in 'uploaded' state still has the only copy of the audio locally
until the server job is confirmed. Deleting it mid-processing is
unrecoverable, so the swipe-to-delete confirm now explains the risk
('Still processing … Delete anyway?') instead of the generic prompt.
… locales New keys (syncStatusUploaded, processing, syncStatus*, noRecordingsYet, syncInProgress, deleteWhileProcessing*) translated natively into all 48 non-English locales. Removed the now-dead banner/filter keys (allRecordingsBackedUp, backingUpRecordingsCount, recordingsWaitingCount, recordingsNeedAttentionCount, filterIssues) after the UI declutter.
A recording in WalSyncDisplayState.retrying (retryCount 1-2) is auto- retried on the next sync trigger (app relaunch picks up pending phone WALs via _scheduleAutoUploadPendingPhoneFiles). The Retry pill now also appears here so the user can force the retry now instead of waiting.
…, FA icons, restrained color budget - Drop the 3-tier pipeline card and per-row colored circle in favor of a type-first layout: one quiet card at top, one icon-free line per row. - Multi-line status card on progress states so 'Downloading from Omi' and '4 of 12' sit on their own lines without crowding the Cancel pill. - Local All / Pending / Synced filter chips above the recordings list. - On-device WALs surface their transfer state (Waiting on Omi / Downloading from Omi) instead of the misleading 'Waiting to sync'. - Synced rows say 'Conversation created' so the row tells the user the actual outcome instead of an implementation detail. - Drop purple from row subtitles; purple is now reserved for spinner + pill buttons. Failed/retrying stay text-only amber/red. - Replace Material info_outline / more_horiz / check / error_outline with their FontAwesome equivalents to match the rest of the app. - Rewrite the 'How syncing works' sheet around the sync→conversation model: 'Your recording is sent to Omi's server' / 'Omi turns the audio into a conversation' / 'Find it under Conversations'. - Newest-first hint next to the section header. - Page header count now follows the active filter. - Confirmation copy when deleting an in-flight uploaded recording. - Net -149 lines after removing verbose history-explaining comments.
The existing 'conversation' getter throws StateError when the parent list has mutated under us (deleted / day-group emptied). When that throw fires from inside a Consumer.builder in the AppBar, the trailing slot is left half-built and Flutter cascades 'infinite size during layout' errors that mask the real cause. Add a sibling 'conversationOrNull' getter that performs the same lookup but returns null instead of throwing. Build paths use this; gesture/async handlers can keep using the throwing variant as a 'cannot-be-null' assertion.
…ersation is unresolved If conversationOrNull is null at build time the page can't render meaningfully — every descendant reads provider.conversation. Schedule Navigator.pop on the next frame and return an empty Scaffold for this build so the AppBar's trailing slot never sees the throw.
- Drop 'back up / backed up' framing; emphasize that recordings are synced to Omi's server and the result is a Conversation. - New keys for the status card states (uploading/downloading title, X-of-Y progress, all synced, ready to sync count, needs attention, processing on Omi, waiting for internet). - Info-sheet rewrite: Sync → Transcribe → Conversation ready. - New row subtitles: Conversation created, Waiting on Omi, Downloading from Omi. - 'Newest first' hint and 'No synced recordings yet' empty state for the filter UI.
Translations match the EN reframe (sync→conversation, no 'backup' language) and adopt the locale's existing word for the 'Conversations' section so the info-sheet pointer matches the in-app section name (de Gespräche, fr Conversations, ja 会話, ko 대화, ar المحادثات, zh 对话, etc.). Full CLDR plural categories applied where the language requires them (ar zero/one/two/few/many/other; ru/uk/pl/be/lt one/few/many/other; sl one/two/few/other; lv zero/one/other). CJK locales use a single 'other' arm (no grammatical number). Pre-commit hook reformatted ARBs to 4-space JSON indent — most of the diff is whitespace; substantive changes are the new keys plus the reframed values.
|
@greptile-apps review |
Greptile SummaryThis PR redesigns the auto-sync page (quieter status card, filter chips, "Conversation created" copy, FontAwesome icons), refactors the WAL upload pipeline from poll-to-terminal to fire-and-forget (HTTP 202 →
Confidence Score: 5/5Safe to merge; the upload pipeline refactor is well-structured and the two findings are edge-case quality nits. The fire-and-forget upload with persisted job_id and debounced background reconciler is architecturally sound. The conversation detail guard correctly gates the pop on _providerInitialized. The two new findings are unlikely to surface in typical usage. app/lib/services/wals/local_wal_sync.dart (reconcileUploadedWals notFound branch) and app/lib/pages/conversations/auto_sync_page.dart (_monthName) Important Files Changed
Reviews (3): Last reviewed commit: "fix(conversation-detail): gate the build..." | Re-trigger Greptile |
… intro
The 'How syncing works' intro previously skipped the device→phone transfer
half of the flow and said 'uploaded to Omi' (the brand) instead of
'Omi's server' (the cloud target). Rewrite to cover both halves
explicitly so the prose matches step 1 ('Your recording is sent to
Omi's server').
…Omi's server' (48 locales) Match the EN reframe. Each locale uses its native word for 'transferred' and 'server', preserves the Omi brand literally, and adopts the locale's existing terminology for 'recordings' (consistent with the rest of the sync strings).
Greptile flagged it as dead code. The redesigned page renders only three chips (All / Pending / Synced); failed/retrying/corrupted recordings ride inside Pending and are surfaced by their per-row amber/red status.
The Pending list/section includes uploaded WALs (their server job is still processing), but deleteAllPendingWals can't touch them — the local audio is required until the reconciler confirms 'synced'. So the manage-storage sheet showed 'Pending: 5', the user tapped Clear, got a success snackbar, and the uploaded recordings stayed in the list. Add pendingDeletableWals (miss + corrupted, not isSyncing) — the subset deleteAllPendingWals actually deletes. The manage-storage sheets in both the redesigned and legacy pages now use this count.
Pending count in the redesigned page's manage-storage sheet now reflects the WALs that 'Clear Pending' will actually delete. Total used for the 'Clear All' visibility excludes uploaded WALs for the same reason.
|
@greptile-apps re-review |
| if (detailProvider.conversationOrNull == null) { | ||
| WidgetsBinding.instance.addPostFrameCallback((_) { | ||
| if (!mounted) return; | ||
| if (Navigator.of(context).canPop()) { | ||
| Navigator.of(context).pop(); | ||
| } | ||
| }); | ||
| return Scaffold(backgroundColor: Theme.of(context).colorScheme.primary); |
There was a problem hiding this comment.
Build guard may prematurely pop on first navigation
When ConversationDetailPage is opened for the very first time after app start (i.e., _cachedConversation is null in the provider) and today's conversation group is empty (all conversations are from previous days), conversationOrNull returns null on the first build. This queues the pop callback. The initState post-frame callback fires first and calls setCachedConversation(widget.conversation), which schedules a rebuild — but the pop callback from this build fires immediately after in the same post-frame batch, popping the route before the rebuild can show the conversation. The result is that navigating to an old conversation auto-pops back to the list.
A simple fix is to track whether the provider has been initialized and skip the pop until after that step, or use an _initialized flag in the widget state.
Greptile P1: the previous build guard popped the route on the FIRST build whenever the conversation wasn't in today's group, before initState's post-frame setCachedConversation could populate the provider. Both callbacks live in the same post-frame batch and the guard's pop fired before the init callback's notifyListeners could trigger a rebuild. Add _providerInitialized, set it inside the init callback right after setCachedConversation, and only pop when the flag is true. The first build still renders an empty shell (no throw from descendants), but the route stays mounted long enough for init to land the conversation.
|
@greptile-apps re-review |
… fix 'stuck' processing perception (#7449) ## Why The auto-sync page was redesigned in #7404 (merged). Manual sync (`sync_page.dart`) — still used by **Limitless** — was left behind, and users reported it looking **stuck**: the moment uploads finished and the phase flipped to processing-on-server, the determinate progress bar froze at 100% (its value source stops updating) while nothing animated. This brings manual sync up to the same visual language and fixes the perception. ## Changes **Status card** (replaces the heavy phase-icon + percentage + progress-bar card) - Quiet multi-line card. Download/upload: spinner + `Downloading from Omi` / `Uploading to Omi` + `X of Y · 320 KB/s` sub-line + Cancel pill. - **Processing: live spinner + `Processing on Omi…` + "this continues in the background — you can leave this screen."** No frozen bar. This is the core fix. - Idle with pending: `N recordings ready to sync` + a Sync pill (preserves the SD-card warning / Fast-Transfer suggestion / WiFi-connection-sheet flows behind `_handleSyncWals`). - Waiting-for-internet and error states reuse the restrained amber/red treatment; error card matches auto-sync's red-tint + Retry pill. **WAL rows** (type-first) - Dropped the leading device image. Title = `time · duration · source`; status is a restrained colored subtitle; trailing = spinner / Retry pill / FA chevron. - Source (SD card / Limitless / From SD) shown as quiet grey text instead of colored pills. - BLE per-row download progress bar **kept** (it's real progress and genuinely useful for slow transfers), recolored to the purple accent. **Chrome** - Segmented Pending/Synced filter (matches auto-sync's chip style). - iOS-style settings rows: right-aligned status text (`Fast`/`BLE`, `On`/`Off`) + FA chevron, no colored pills. - 4-color budget throughout (purple / grey / amber / red). ## i18n - `syncProcessingBackgroundHint` (new) — the background-processing reassurance line. - `syncStatusBackingUp`: `Backing up…` → `Syncing…` (drops the last bit of "backup" framing; this key is shared with the auto-sync row, so that page benefits too). - Everything else reuses keys already added in #7404 (`syncCardDownloadingTitle`, `syncCardUploadingTitle`, `syncCardProgressOf`, `syncCardProcessing`, `syncCardReadyCount`, `syncCardWaitingInternet`, `syncCardAllBackedUp`, `syncStatusConversationCreated`, …). - Both keys translated across all 48 non-English locales; `flutter gen-l10n` emits zero untranslated warnings. ## Verification - `flutter analyze` on `sync_page.dart` and `auto_sync_page.dart` → no issues. - `flutter gen-l10n` → zero untranslated. - All manual-sync flows preserved: SD-card warning dialog, Fast-Transfer suggestion, WiFi connection sheet, cancel, retry, manage-storage sheet (deletable-pending count), per-WAL delete-while-processing guard. Opened as draft for the standard checks before merge. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
What
A focused redesign of the auto-sync page that drops the heavy 3-tier pipeline card, the per-row colored circle, and the "back up" language model in favor of a quieter, type-first layout grounded in what the product actually does — sync recordings to Omi so a Conversation is created.
UI changes
Status card
Downloading from Omiand4 of 12sit on their own lines instead of crowding the Cancel pill.Recordings list
Settings rows
On/Offtext + FA chevron; no green/grey pill chips.Info sheet ("How syncing works")
Icons
info_outline,more_horiz,check,error_outline→ FontAwesomecircleInfo,ellipsis,check,circleExclamationto match the rest of the app.Reliability fix bundled in this PR
ConversationDetailProvider.conversationused to throwStateError("No valid conversation found")from a property getter. When that throw fired from insideConsumer.builderin the AppBar, Flutter cascaded a chain of "given an infinite size during layout" errors that masked the root cause. Added:ConversationDetailProvider.conversationOrNull— non-throwing sibling that performs the same lookup but returns null instead of raising._ConversationDetailPageState.builddefensive guard — if the conversation can't be resolved, pop the route on the next frame and render an emptyScaffoldso the AppBar trailing slot never sees the throw.The throwing
conversationaccessor is preserved as a thin wrapper so non-build call sites (gestures, async handlers) still loudly fail on impossible states.i18n
flutter gen-l10nemits zerountranslated message(s)warnings.Verification
flutter analyze app/lib/pages/conversations/auto_sync_page.dart→ clean.flutter gen-l10n→ zero untranslated.Commits in this PR
feat(sync): redesign sync page — multi-line status card, filter chips, FA icons, restrained color budgetfix(conversation-detail): add non-throwingconversationOrNullgetterfix(conversation-detail): pop the route instead of crashing when conversation is unresolvedi18n(sync): EN — reframe sync copy to sync→conversation modeli18n(sync): translate new + reframed sync strings across 48 localeschore(l10n): regenerate AppLocalizations for sync redesign keys🤖 Generated with Claude Code