@@ -23,15 +23,13 @@ final class AppSettingsManager {
2323 didSet {
2424 general. language. apply ( )
2525 storage. saveGeneral ( general)
26- notifyChange ( domain: " general " , notification: . generalSettingsDidChange)
2726 }
2827 }
2928
3029 var appearance : AppearanceSettings {
3130 didSet {
3231 storage. saveAppearance ( appearance)
3332 appearance. theme. apply ( )
34- notifyChange ( domain: " appearance " , notification: . appearanceSettingsDidChange)
3533 }
3634 }
3735
@@ -40,7 +38,7 @@ final class AppSettingsManager {
4038 storage. saveEditor ( editor)
4139 // Update cached theme values for thread-safe access
4240 SQLEditorTheme . reloadFromSettings ( editor)
43- notifyChange ( domain : " editor " , notification : . editorSettingsDidChange)
41+ notifyChange ( . editorSettingsDidChange)
4442 }
4543 }
4644
@@ -62,7 +60,7 @@ final class AppSettingsManager {
6260 storage. saveDataGrid ( validated)
6361 // Update date formatting service with new format
6462 DateFormattingService . shared. updateFormat ( validated. dateFormat)
65- notifyChange ( domain : " dataGrid " , notification : . dataGridSettingsDidChange)
63+ notifyChange ( . dataGridSettingsDidChange)
6664 }
6765 }
6866
@@ -84,28 +82,24 @@ final class AppSettingsManager {
8482 storage. saveHistory ( validated)
8583 // Apply history settings immediately (cleanup if auto-cleanup enabled)
8684 Task { await applyHistorySettingsImmediately ( ) }
87- notifyChange ( domain: " history " , notification: . historySettingsDidChange)
8885 }
8986 }
9087
9188 var tabs : TabSettings {
9289 didSet {
9390 storage. saveTabs ( tabs)
94- notifyChange ( domain: " tabs " , notification: . tabSettingsDidChange)
9591 }
9692 }
9793
9894 var keyboard : KeyboardSettings {
9995 didSet {
10096 storage. saveKeyboard ( keyboard)
101- notifyChange ( domain: " keyboard " , notification: . keyboardSettingsDidChange)
10297 }
10398 }
10499
105100 var ai : AISettings {
106101 didSet {
107102 storage. saveAI ( ai)
108- notifyChange ( domain: " ai " , notification: . aiSettingsDidChange)
109103 }
110104 }
111105
@@ -147,24 +141,8 @@ final class AppSettingsManager {
147141
148142 // MARK: - Notification Propagation
149143
150- /// Notify listeners that settings have changed
151- /// Posts both domain-specific and generic notifications
152- private func notifyChange( domain: String , notification: Notification . Name ) {
153- let changeInfo = SettingsChangeInfo ( domain: domain, changedKeys: nil )
154-
155- // Post domain-specific notification
156- NotificationCenter . default. post (
157- name: notification,
158- object: self ,
159- userInfo: [ SettingsChangeInfo . userInfoKey: changeInfo]
160- )
161-
162- // Post generic notification for listeners that want all settings changes
163- NotificationCenter . default. post (
164- name: . settingsDidChange,
165- object: self ,
166- userInfo: [ SettingsChangeInfo . userInfoKey: changeInfo]
167- )
144+ private func notifyChange( _ notification: Notification . Name ) {
145+ NotificationCenter . default. post ( name: notification, object: self )
168146 }
169147
170148 // MARK: - Accessibility Text Size
@@ -197,11 +175,8 @@ final class AppSettingsManager {
197175 }
198176 }
199177
200- /// Apply history settings immediately (triggered on settings change)
201178 private func applyHistorySettingsImmediately( ) async {
202- // This will be called by QueryHistoryManager
203- // We post a notification and let the manager handle the actual cleanup
204- // This keeps the settings manager decoupled from history storage implementation
179+ QueryHistoryManager . shared. applySettingsChange ( )
205180 }
206181
207182 // MARK: - Actions
0 commit comments