Skip to content

feat(ios): add iCloud sync toggle, default page size, and default safe mode to Settings#1169

Merged
datlechin merged 2 commits into
mainfrom
feat/settings-expansion
May 9, 2026
Merged

feat(ios): add iCloud sync toggle, default page size, and default safe mode to Settings#1169
datlechin merged 2 commits into
mainfrom
feat/settings-expansion

Conversation

@datlechin

Copy link
Copy Markdown
Member

Summary

Settings was sparse: just analytics + Face ID. This PR adds the three most-requested config knobs and threads them through the consumers.

iCloud Sync toggle

  • New @AppStorage("com.TablePro.settings.cloudSyncEnabled") (default true)
  • Sync entry points gated:
    • TableProMobileApp.scenePhase .active → skip the auto-sync Task when off
    • ConnectionListView toolbar Sync button → disables and swaps arrow.triangle.2.circlepath.icloud for icloud.slash when off
    • ConnectionListView pull-to-refresh → no-op when off
  • Onboarding's "Sync from iCloud" button is intentionally not gated (defaults are still in effect when onboarding runs, and the button is an explicit user-initiated import)
  • Existing iCloud data is not deleted; the toggle just stops further pushes/pulls

Rows per Page (default page size)

  • New @AppStorage("com.TablePro.settings.defaultPageSize") (default 100)
  • Picker with 50 / 100 / 200 / 500 options
  • DataBrowserViewModel.init reads the setting on construction. The toolbar's "Rows per Page" submenu still lets users override per session

Default Safe Mode

  • New @AppStorage("com.TablePro.settings.defaultSafeMode") (default .off)
  • Picker iterates SafeModeLevel.allCases
  • ConnectionFormViewModel.init(editing:) applies the default when editing == nil (new connection); when editing existing, the connection's stored level wins

Plumbing

  • New Platform/AppPreferences.swift enum centralizes the keys, defaults, and pageSizeOptions: [Int]. Both the View (via @AppStorage(AppPreferences.xxxKey)) and the consumers (via AppPreferences.isCloudSyncEnabled / defaultPageSize / defaultSafeMode) read the same constants

Test plan

  • Settings: iCloud Sync off → ConnectionList sync button greys out and shows icloud.slash. Pull to refresh does nothing. Cold launch with sync off does not call syncCoordinator.sync. Toggle on → sync resumes immediately
  • Settings: change Rows per Page to 200 → open a new table → bottom-bar shows "1-200 of N", pagination respects 200
  • Settings: change Default Safe Mode to Read Only → tap "+" to add new connection → safe mode picker is pre-selected to Read Only. Edit an existing connection: its stored level is preserved

@datlechin datlechin merged commit 59f6a6b into main May 9, 2026
1 check passed
@datlechin datlechin deleted the feat/settings-expansion branch May 9, 2026 19:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant