Skip to content

Commit 9ca765e

Browse files
committed
Migrate debug settings to HostApp
1 parent 0c746d4 commit 9ca765e

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import Preferences
2+
import SwiftUI
3+
4+
final class DebugSettings: ObservableObject {
5+
@AppStorage(\.disableLazyVStack) var disableLazyVStack
6+
@AppStorage(\.preCacheOnFileOpen) var preCacheOnFileOpen
7+
@AppStorage(\.useCustomScrollViewWorkaround) var useCustomScrollViewWorkaround
8+
@AppStorage(\.triggerActionWithAccessibilityAPI) var triggerActionWithAccessibilityAPI
9+
init() {}
10+
}
11+
12+
struct DebugSettingsView: View {
13+
@StateObject var settings = DebugSettings()
14+
15+
var body: some View {
16+
Section {
17+
Form {
18+
Toggle(isOn: $settings.disableLazyVStack) {
19+
Text("Disable LazyVStack")
20+
}
21+
Toggle(isOn: $settings.preCacheOnFileOpen) {
22+
Text("Cache editor information on file open")
23+
}
24+
Toggle(isOn: $settings.useCustomScrollViewWorkaround) {
25+
Text("Use custom scroll view workaround for smooth scrolling")
26+
}
27+
Toggle(isOn: $settings.triggerActionWithAccessibilityAPI) {
28+
Text("Trigger action with AccessibilityAPI")
29+
}
30+
}
31+
}
32+
}
33+
}
34+
35+
struct DebugSettingsView_Preview: PreviewProvider {
36+
static var previews: some View {
37+
DebugSettingsView()
38+
}
39+
}
40+

0 commit comments

Comments
 (0)