Offline tab as Files view, automatic background sync, sync notifications
Build APK / build (push) Successful in 5m27s

- Offline tab is now FilesView(offline: true) over a FolderBrowser interface
  (FilesController / OfflineController) sharing controls, tiles, thumbnails
- Synced files follow the Files Cache rule (default: refresh every 15 min):
  per-account WorkManager jobs, in-app timer, resume and pull triggers;
  root-etag shortcut skips full walks when nothing changed
- Single sync at a time (shared lock); logging out stops that account's sync
- Sync safety: PROPFIND failures skip the path instead of deleting local files
- Mirror empty folders and remove deleted ones; drop synced paths deleted on
  the server; missing local files are re-downloaded
- Notifications: silent per-account sync notifications, "Background sync
  notifications" setting, audible upload/download completion
- Files refresh in place (no spinner flash); retry after network returns
- Fix sync badges not updating (shared native status stream), "Sync off" on
  launch (eager providers), Files Cache section moved under Device Sync

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
2026-09-21 18:06:55 -04:00
co-authored by Claude Sonnet 5
parent 49ae712f5e
commit f2bba2914e
38 changed files with 3133 additions and 741 deletions
+20
View File
@@ -20,6 +20,7 @@ class AccountStore {
static const _prefAccountsList = 'accounts_list';
static const _prefActiveAccountId = 'active_account_id';
static const _prefMigrationDone = 'account_migration_v1_done';
static const _prefSignedOutAccounts = 'signed_out_account_ids';
/// The per-account browsing prefs that get namespaced under
/// `acct_<id>_<key>` on migration/save - everything else (theme, tab
@@ -38,6 +39,7 @@ class AccountStore {
'ui_cache_policy',
'ui_cache_interval_minutes',
'ui_synced_folders',
'ui_synced_folder_types',
'ui_sync_everything',
];
@@ -129,6 +131,24 @@ class AccountStore {
}
}
/// Accounts the user explicitly logged out of. They stay saved (password
/// and prefs intact, resumable from the login screen) but are treated as
/// signed out - notably, they don't sync in the background. Cleared again
/// the moment the account is activated.
Set<String> loadSignedOut(SharedPreferences prefs) =>
(prefs.getStringList(_prefSignedOutAccounts) ?? const []).toSet();
Future<void> setSignedOut(
SharedPreferences prefs,
String accountId,
bool signedOut,
) async {
final current = loadSignedOut(prefs);
final changed = signedOut ? current.add(accountId) : current.remove(accountId);
if (!changed) return;
await prefs.setStringList(_prefSignedOutAccounts, current.toList());
}
Future<String?> readPassword(String accountId) =>
_storage.read(key: '$_passwordKeyPrefix$accountId');