Skip to content

Commit 17d202a

Browse files
committed
Add toggle to disable enhanced workspace
1 parent 5aedc75 commit 17d202a

File tree

4 files changed

+18
-4
lines changed

4 files changed

+18
-4
lines changed

Core/Sources/HostApp/DebugView.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ final class DebugSettings: ObservableObject {
1515
@AppStorage(\.disableGitHubCopilotSettingsAutoRefreshOnAppear)
1616
var disableGitHubCopilotSettingsAutoRefreshOnAppear
1717
@AppStorage(\.useUserDefaultsBaseAPIKeychain) var useUserDefaultsBaseAPIKeychain
18+
@AppStorage(\.disableEnhancedWorkspace) var disableEnhancedWorkspace
1819
init() {}
1920
}
2021

@@ -59,6 +60,10 @@ struct DebugSettingsView: View {
5960
Text("Store API keys in UserDefaults")
6061
}
6162

63+
Toggle(isOn: $settings.disableEnhancedWorkspace) {
64+
Text("Disable Enhanced Workspace")
65+
}
66+
6267
Button("Reset Migration Version to 0") {
6368
UserDefaults.shared.set(nil, forKey: "OldMigrationVersion")
6469
}

Core/Sources/Service/Service.swift

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public final class Service {
2828

2929
private init() {
3030
@Dependency(\.workspacePool) var workspacePool
31-
31+
3232
scheduledCleaner = .init(workspacePool: workspacePool, guiController: guiController)
3333
#if canImport(KeyBindingManager)
3434
keyBindingManager = .init(
@@ -43,9 +43,11 @@ public final class Service {
4343

4444
workspacePool.registerPlugin { SuggestionServiceWorkspacePlugin(workspace: $0) }
4545
#if canImport(EnhancedWorkspace)
46-
workspacePool.registerPlugin { EnhancedWorkspacePlugin(workspace: $0) }
46+
if !UserDefaults.shared.value(for: \.disableEnhancedWorkspace) {
47+
workspacePool.registerPlugin { EnhancedWorkspacePlugin(workspace: $0) }
48+
}
4749
#endif
48-
50+
4951
self.workspacePool = workspacePool
5052
}
5153

Pro

Submodule Pro updated from 87a4e99 to 6b43f38

Tool/Sources/Preferences/Keys.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,5 +499,12 @@ public extension UserDefaultPreferenceKeys {
499499
key: "FeatureFlag-DisableGitHubCopilotSettingsAutoRefreshOnAppear"
500500
)
501501
}
502+
503+
var disableEnhancedWorkspace: FeatureFlag {
504+
.init(
505+
defaultValue: false,
506+
key: "FeatureFlag-DisableEnhancedWorkspace"
507+
)
508+
}
502509
}
503510

0 commit comments

Comments
 (0)