Skip to content

Commit 48ce998

Browse files
committed
Add feature flags
1 parent e6ca4d4 commit 48ce998

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

Core/Sources/HostApp/DebugView.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@ final class DebugSettings: ObservableObject {
2525
var restartXcodeInspectorIfAccessibilityAPIIsMalfunctioningNoTimer
2626
@AppStorage(\.toastForTheReasonWhyXcodeInspectorNeedsToBeRestarted)
2727
var toastForTheReasonWhyXcodeInspectorNeedsToBeRestarted
28+
@AppStorage(\.observeToAXNotificationOnAnotherThread)
29+
var observeToAXNotificationOnAnotherThread
30+
@AppStorage(\.observeToAXNotificationWithDefaultMode)
31+
var observeToAXNotificationWithDefaultMode
2832
init() {}
2933
}
3034

@@ -116,6 +120,20 @@ struct DebugSettingsView: View {
116120
UserDefaults.shared.set(nil, forKey: "ChatModels")
117121
UserDefaults.shared.set(nil, forKey: "EmbeddingModels")
118122
}
123+
124+
Group {
125+
Toggle(
126+
isOn: $settings.observeToAXNotificationOnAnotherThread
127+
) {
128+
Text("Observe to AXNotification on background thread")
129+
}
130+
131+
Toggle(
132+
isOn: $settings.observeToAXNotificationWithDefaultMode
133+
) {
134+
Text("Observe to AXNotification with default mode")
135+
}
136+
}
119137
}
120138
}
121139
.padding()

Tool/Package.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,7 @@ let package = Package(
160160
.target(
161161
name: "AXNotificationStream",
162162
dependencies: [
163+
"Preferences",
163164
"Logger",
164165
]
165166
),

Tool/Sources/Preferences/Keys.swift

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -604,5 +604,13 @@ public extension UserDefaultPreferenceKeys {
604604
key: "FeatureFlag-ToastForTheReasonWhyXcodeInspectorNeedsToBeRestarted"
605605
)
606606
}
607+
608+
var observeToAXNotificationOnAnotherThread: FeatureFlag {
609+
.init(defaultValue: false, key: "FeatureFlag-observeToAXNotificationOnAnotherThread")
610+
}
611+
612+
var observeToAXNotificationWithDefaultMode: FeatureFlag {
613+
.init(defaultValue: false, key: "FeatureFlag-observeToAXNotificationWithDefaultMode")
614+
}
607615
}
608616

0 commit comments

Comments
 (0)