feat(U6): show sync status indicator in email list app bar #29

Merged
guettlibot merged 1 commits from task/u6-connection-status into main 2026-05-14 02:23:08 +00:00
guettlibot commented 2026-05-14 02:20:13 +00:00 (Migrated from codeberg.org)

Replaces the static sync icon with a live status widget in the email list app bar:

  • Syncing: animated CircularProgressIndicator replaces the sync icon while a sync cycle is running; tap is disabled to prevent double-sync
  • Error: red sync_problem icon when syncLastErrorProvider reports a failure
  • Idle: regular sync icon (tapping triggers a manual sync as before)

Changes

lib/core/sync/account_sync_manager.dart

  • Added _syncPhaseCtrl broadcast StreamController<(String, bool)>
  • watchSyncing(accountId) exposes a filtered Stream<bool> per account
  • Both _AccountSync and _JmapAccountSync now accept onSyncStart/onSyncEnd VoidCallback parameters and fire them at the top of each loop iteration

lib/di.dart

  • Added isSyncingProviderStreamProvider.autoDispose.family<bool, String> backed by AccountSyncManager.watchSyncing

lib/ui/screens/email_list_screen.dart

  • Extracted _buildSyncButton that watches both isSyncingProvider and syncLastErrorProvider to derive the icon state

🤖 Generated with Claude Code

Replaces the static sync icon with a live status widget in the email list app bar: - **Syncing**: animated `CircularProgressIndicator` replaces the sync icon while a sync cycle is running; tap is disabled to prevent double-sync - **Error**: red `sync_problem` icon when `syncLastErrorProvider` reports a failure - **Idle**: regular `sync` icon (tapping triggers a manual sync as before) ## Changes **`lib/core/sync/account_sync_manager.dart`** - Added `_syncPhaseCtrl` broadcast `StreamController<(String, bool)>` - `watchSyncing(accountId)` exposes a filtered `Stream<bool>` per account - Both `_AccountSync` and `_JmapAccountSync` now accept `onSyncStart`/`onSyncEnd` VoidCallback parameters and fire them at the top of each loop iteration **`lib/di.dart`** - Added `isSyncingProvider` — `StreamProvider.autoDispose.family<bool, String>` backed by `AccountSyncManager.watchSyncing` **`lib/ui/screens/email_list_screen.dart`** - Extracted `_buildSyncButton` that watches both `isSyncingProvider` and `syncLastErrorProvider` to derive the icon state 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Sign in to join this conversation.