Skip to content

refactor: restructure settings for correct data flow and native macOS patterns#549

Merged
datlechin merged 1 commit intomainfrom
refactor/settings-restructure
Apr 1, 2026
Merged

refactor: restructure settings for correct data flow and native macOS patterns#549
datlechin merged 1 commit intomainfrom
refactor/settings-restructure

Conversation

@datlechin
Copy link
Copy Markdown
Collaborator

Summary

  • SyncSettings integrated into AppSettingsManager — was bypassing the central manager with local @State and direct AppSettingsStorage calls, now uses the same didSet → persist + SyncChangeTracker.markDirty pattern as all other settings domains
  • GeneralSettingsView binding honesty — removed hidden @Bindable settingsManager dependency; now receives @Binding var tabSettings and onResetAll closure explicitly
  • Replaced private ObjC selectorSelector(("showSettingsWindow:")) (3 call sites) replaced with Environment(\.openSettings) (macOS 14+ public API) and NotificationCenter for AppKit contexts
  • HistorySettings defensive decoding — added init(from decoder:) with decodeIfPresent + defaults, matching all other settings structs
  • Single theme activation path — removed redundant .onChange in ThemeListView that duplicated activation already handled by AppSettingsManager.appearance.didSet

Test plan

  • Open Settings (Cmd+,), verify all 10 tabs render correctly
  • Change settings in each tab, restart app, verify persistence
  • Toggle iCloud Sync on/off, verify SyncCoordinator receives enable/disable calls
  • Click SyncStatusIndicator → verify Settings opens to Sync tab
  • Drag-install a plugin → verify Settings opens to Plugins tab
  • Switch themes in Appearance tab → verify theme activates once (not twice)
  • Click "Reset All Settings to Defaults" in General tab → verify all settings reset
  • Build with xcodebuild — no warnings in changed files

@datlechin datlechin force-pushed the refactor/settings-restructure branch from 9143267 to d980715 Compare April 1, 2026 11:24
@datlechin datlechin merged commit 5091ef6 into main Apr 1, 2026
2 checks passed
@datlechin datlechin deleted the refactor/settings-restructure branch April 1, 2026 11:25
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