feat(sync): wire TUI account orchestration, SyncProvider integration, and Ctrl+S keybinding

- MicrosoftAccountSyncProvider: implements SyncProvider interface with
  connect_account(), sync_account(), disconnect_account(), provider_id()
- TuiApp: inherits SyncObserver, implements thread-safe sync progress
  rendering, background sync thread, and Action::sync dispatch
- CLI: add "account disconnect <id>" and "account list" commands
- Main wiring: initialize sync infrastructure when connected accounts
  exist and a valid client ID is configured
- Screen: add sync_stage and sync_is_error fields to ScreenState,
  map Ctrl+S to Action::sync keybinding
- Fix ScreenState aggregate initializers in all construction sites
- Tests: new microsoft_sync_provider_tests.cpp, all 22 tests pass
This commit is contained in:
2026-07-22 21:49:26 +01:00
parent 74c798e7aa
commit 725e48569e
10 changed files with 1257 additions and 5 deletions

View File

@@ -30,6 +30,7 @@ nocal_sources = files(
'src/sync/desktop_oauth.cpp',
'src/sync/microsoft_account.cpp',
'src/sync/microsoft_graph.cpp',
'src/sync/microsoft_sync_provider.cpp',
'src/sync/oauth.cpp',
'src/sync/oauth_tokens.cpp',
'src/sync/secret_store.cpp',
@@ -95,6 +96,9 @@ test('microsoft-graph', microsoft_graph_tests)
microsoft_graph_security_tests = executable('microsoft-graph-security-tests',
'tests/microsoft_graph_security_tests.cpp', dependencies: nocal_dep)
test('microsoft-graph-security', microsoft_graph_security_tests)
microsoft_sync_provider_tests = executable('microsoft-sync-provider-tests',
'tests/microsoft_sync_provider_tests.cpp', dependencies: nocal_dep)
test('microsoft-sync-provider', microsoft_sync_provider_tests)
tui_tests = executable('tui-tests', 'tests/tui_tests.cpp',
dependencies: nocal_dep)
test('tui', tui_tests)