Skip to content

feat: iCloud sync for connections, tags, settings, and templates#45

Draft
datlechin wants to merge 1 commit intomainfrom
feature/icloud-sync
Draft

feat: iCloud sync for connections, tags, settings, and templates#45
datlechin wants to merge 1 commit intomainfrom
feature/icloud-sync

Conversation

@datlechin
Copy link
Owner

Summary

  • Add opt-in iCloud sync (Settings > General) using NSUbiquitousKeyValueStore with a protocol-based SyncEngine architecture
  • Sync connections (metadata only), tags, all 5 settings domains, and table templates across Macs — passwords stay in local Keychain
  • Three-way conflict detection with a SwiftUI conflict resolution sheet (keep local / keep remote)
  • Password badge indicator on synced connections that need local password entry
  • triggeredBySync parameter on storage save methods to prevent sync feedback loops

New Files

File Purpose
Core/Sync/SyncEngine.swift Protocol + SyncEnvelope + SyncDataType + SyncError
Core/Sync/ICloudSyncEngine.swift NSUbiquitousKeyValueStore implementation
Core/Sync/SyncCoordinator.swift Central coordinator (storage ↔ iCloud)
Core/Sync/SyncConflict.swift Conflict model + ConflictResolution enum
Views/Sync/SyncConflictResolutionView.swift Conflict resolution UI
TablePro.entitlements iCloud KV store entitlement

Modified Files

  • AppSettings.swift — added iCloudSyncEnabled to GeneralSettings
  • ConnectionStorage.swift / TagStorage.swift / TableTemplateStorage.swift — sync hooks with triggeredBySync guard
  • AppSettingsManager.swift — sync hooks on all 5 settings domains
  • GeneralSettingsView.swift — iCloud Sync UI section
  • WelcomeWindowView.swift — password key badge for synced connections
  • OpenTableApp.swift — SyncCoordinator startup
  • project.pbxproj — entitlements linked for Debug + Release

Test plan

  • Enable iCloud sync toggle in Settings > General
  • Verify connections, tags, settings, and templates sync to a second Mac
  • Modify data on both Macs simultaneously to trigger conflict resolution
  • Verify passwords are NOT synced — synced connections show key badge
  • Disable sync and verify no further pushes occur
  • Test with iCloud signed out — toggle should be disabled with warning

Implement opt-in iCloud sync via NSUbiquitousKeyValueStore with
protocol-based architecture (SyncEngine/ICloudSyncEngine), three-way
conflict detection, and a SwiftUI conflict resolution UI. Passwords
remain in local Keychain and are never synced. Synced connections
show a key badge when local password entry is needed.
@datlechin datlechin marked this pull request as draft February 9, 2026 17:38
@datlechin datlechin added the enhancement New feature or request label Feb 27, 2026
@github-project-automation github-project-automation bot moved this to Todo in TablePro Feb 27, 2026
@datlechin datlechin moved this from Todo to Done in TablePro Mar 1, 2026
@datlechin datlechin moved this from Done to In Progress in TablePro Mar 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In Progress

Development

Successfully merging this pull request may close these issues.

1 participant