diff --git a/CodeEdit.xcodeproj/project.pbxproj b/CodeEdit.xcodeproj/project.pbxproj index b39a549a56..ad4b538dd1 100644 --- a/CodeEdit.xcodeproj/project.pbxproj +++ b/CodeEdit.xcodeproj/project.pbxproj @@ -319,9 +319,6 @@ 6C578D8929CD36E400DC73B2 /* Commands+ForEach.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C578D8829CD36E400DC73B2 /* Commands+ForEach.swift */; }; 6C578D8C29CD372700DC73B2 /* ExtensionCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C578D8B29CD372700DC73B2 /* ExtensionCommands.swift */; }; 6C5B63DE29C76213005454BA /* WindowCodeFileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C5B63DD29C76213005454BA /* WindowCodeFileView.swift */; }; - 6C5BE51C2A3D542B002DA0FC /* FeatureFlagsSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C5BE51B2A3D542B002DA0FC /* FeatureFlagsSettingsView.swift */; }; - 6C5BE51E2A3D545F002DA0FC /* FeatureFlagsSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C5BE51D2A3D545F002DA0FC /* FeatureFlagsSettings.swift */; }; - 6C5BE5222A3D5666002DA0FC /* WindowManagement in Frameworks */ = {isa = PBXBuildFile; productRef = 6C5BE5212A3D5666002DA0FC /* WindowManagement */; }; 6C5C891B2A3F736500A94FE1 /* FocusedValues.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C5C891A2A3F736500A94FE1 /* FocusedValues.swift */; }; 6C5FDF7A29E6160000BC08C0 /* AppSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C5FDF7929E6160000BC08C0 /* AppSettings.swift */; }; 6C66C31329D05CDC00DE9ED2 /* GRDB in Frameworks */ = {isa = PBXBuildFile; productRef = 6C66C31229D05CDC00DE9ED2 /* GRDB */; }; @@ -337,7 +334,6 @@ 6C6BD70429CD17B600235D17 /* ExtensionsManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C6BD70329CD17B600235D17 /* ExtensionsManager.swift */; }; 6C7256D729A3D7D000C2D3E0 /* SplitViewControllerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C7256D629A3D7D000C2D3E0 /* SplitViewControllerView.swift */; }; 6C7F37FE2A3EA6FA00217B83 /* View+focusedValue.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C7F37FD2A3EA6FA00217B83 /* View+focusedValue.swift */; }; - 6C7F38012A3EA71400217B83 /* WindowSplitView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C7F38002A3EA71400217B83 /* WindowSplitView.swift */; }; 6C81916729B3E80700B75C92 /* ModifierKeysObserver.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C81916629B3E80700B75C92 /* ModifierKeysObserver.swift */; }; 6C81916B29B41DD300B75C92 /* DequeModule in Frameworks */ = {isa = PBXBuildFile; productRef = 6C81916A29B41DD300B75C92 /* DequeModule */; }; 6C82D6B329BFD88700495C54 /* NavigateCommands.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6C82D6B229BFD88700495C54 /* NavigateCommands.swift */; }; @@ -861,8 +857,6 @@ 6C578D8829CD36E400DC73B2 /* Commands+ForEach.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "Commands+ForEach.swift"; sourceTree = ""; }; 6C578D8B29CD372700DC73B2 /* ExtensionCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionCommands.swift; sourceTree = ""; }; 6C5B63DD29C76213005454BA /* WindowCodeFileView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WindowCodeFileView.swift; sourceTree = ""; }; - 6C5BE51B2A3D542B002DA0FC /* FeatureFlagsSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureFlagsSettingsView.swift; sourceTree = ""; }; - 6C5BE51D2A3D545F002DA0FC /* FeatureFlagsSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FeatureFlagsSettings.swift; sourceTree = ""; }; 6C5C891A2A3F736500A94FE1 /* FocusedValues.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FocusedValues.swift; sourceTree = ""; }; 6C5FDF7929E6160000BC08C0 /* AppSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppSettings.swift; sourceTree = ""; }; 6C6BD6EE29CD12E900235D17 /* ExtensionManagerWindow.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionManagerWindow.swift; sourceTree = ""; }; @@ -873,7 +867,6 @@ 6C6BD70329CD17B600235D17 /* ExtensionsManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ExtensionsManager.swift; sourceTree = ""; }; 6C7256D629A3D7D000C2D3E0 /* SplitViewControllerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SplitViewControllerView.swift; sourceTree = ""; }; 6C7F37FD2A3EA6FA00217B83 /* View+focusedValue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+focusedValue.swift"; sourceTree = ""; }; - 6C7F38002A3EA71400217B83 /* WindowSplitView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WindowSplitView.swift; sourceTree = ""; }; 6C81916629B3E80700B75C92 /* ModifierKeysObserver.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ModifierKeysObserver.swift; sourceTree = ""; }; 6C82D6B229BFD88700495C54 /* NavigateCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigateCommands.swift; sourceTree = ""; }; 6C82D6B829BFE34900495C54 /* HelpCommands.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HelpCommands.swift; sourceTree = ""; }; @@ -1036,7 +1029,6 @@ buildActionMask = 2147483647; files = ( 6C0F3A3C2A1D0D5000223D19 /* CodeEditKit in Frameworks */, - 6C5BE5222A3D5666002DA0FC /* WindowManagement in Frameworks */, 6C66C31329D05CDC00DE9ED2 /* GRDB in Frameworks */, 58F2EB1E292FB954004A9BDE /* Sparkle in Frameworks */, 6C2149412A1BB9AB00748382 /* LogStream in Frameworks */, @@ -2373,15 +2365,6 @@ path = Environment; sourceTree = ""; }; - 6C5BE51A2A3D5419002DA0FC /* FeatureFlags */ = { - isa = PBXGroup; - children = ( - 85AEE8D42A474EEC009507BC /* Models */, - 6C5BE51B2A3D542B002DA0FC /* FeatureFlagsSettingsView.swift */, - ); - path = FeatureFlags; - sourceTree = ""; - }; 6C6BD6ED29CD123000235D17 /* Extensions */ = { isa = PBXGroup; children = ( @@ -2441,14 +2424,6 @@ path = Text; sourceTree = ""; }; - 85AEE8D42A474EEC009507BC /* Models */ = { - isa = PBXGroup; - children = ( - 6C5BE51D2A3D545F002DA0FC /* FeatureFlagsSettings.swift */, - ); - path = Models; - sourceTree = ""; - }; 85CD0C5D2A10CC2500E531FD /* URL */ = { isa = PBXGroup; children = ( @@ -2506,7 +2481,6 @@ 58F2EAAE292FB2B0004A9BDE /* ThemeSettings */, B6EA1FF329DA37D3001BF195 /* TextEditingSettings */, 5B698A082B262F8400DE9392 /* SearchSettings */, - 6C5BE51A2A3D5419002DA0FC /* FeatureFlags */, B6CF632629E5417C0085880A /* Keybindings */, B6F0516E29D9E35300D72287 /* LocationsSettings */, B6F0516D29D9E34200D72287 /* SourceControlSettings */, @@ -2596,7 +2570,6 @@ B66A4E4B29C9179B004573B4 /* CodeEditApp.swift */, 04660F6027E3A68A00477777 /* Info.plist */, 6C48D8F62972E5F300D6D205 /* WindowObserver.swift */, - 6C7F38002A3EA71400217B83 /* WindowSplitView.swift */, B658FB3127DA9E0F00EA4DBD /* WorkspaceView.swift */, 5C4BB1E028212B1E00A92FB2 /* World.swift */, ); @@ -2995,7 +2968,6 @@ 6C2149402A1BB9AB00748382 /* LogStream */, 6CDEFC9529E22C2700B7C684 /* Introspect */, 6C0F3A3B2A1D0D5000223D19 /* CodeEditKit */, - 6C5BE5212A3D5666002DA0FC /* WindowManagement */, 6CB4463F2B6DFF3A00539ED0 /* CodeEditSourceEditor */, 6CBE1CFF2B720565003AC32E /* CodeEditSourceEditor */, ); @@ -3092,7 +3064,6 @@ 6C21493F2A1BB9AB00748382 /* XCRemoteSwiftPackageReference "LogStream" */, 6CDEFC9429E22C2700B7C684 /* XCRemoteSwiftPackageReference "SwiftUI-Introspect" */, 6C0F3A3A2A1D0D5000223D19 /* XCRemoteSwiftPackageReference "CodeEditKit" */, - 6C5BE5202A3D5666002DA0FC /* XCRemoteSwiftPackageReference "SwiftUI-WindowManagement" */, 6CBE1CFE2B720565003AC32E /* XCRemoteSwiftPackageReference "CodeEditSourceEditor" */, ); productRefGroup = B658FB2D27DA9E0F00EA4DBD /* Products */; @@ -3273,7 +3244,6 @@ 587B9E5E29301D8F00AC7927 /* GitLabCommitRouter.swift in Sources */, 58F2EB0D292FB2B0004A9BDE /* ThemeSettings.swift in Sources */, 85CD0C5F2A10CC3200E531FD /* URL+isImage.swift in Sources */, - 6C5BE51E2A3D545F002DA0FC /* FeatureFlagsSettings.swift in Sources */, 587B9D9F29300ABD00AC7927 /* SegmentedControl.swift in Sources */, 6C7256D729A3D7D000C2D3E0 /* SplitViewControllerView.swift in Sources */, B6EA1FE529DA33DB001BF195 /* ThemeModel.swift in Sources */, @@ -3362,7 +3332,6 @@ 587B9E6629301D8F00AC7927 /* GitLabProjectHook.swift in Sources */, 587B9E9329301D8F00AC7927 /* BitBucketOAuthConfiguration.swift in Sources */, 6C18620A298BF5A800C663EA /* RecentProjectsListView.swift in Sources */, - 6C7F38012A3EA71400217B83 /* WindowSplitView.swift in Sources */, 58F2EB0A292FB2B0004A9BDE /* SettingsData.swift in Sources */, 20EBB503280C327C00F3A5DA /* HistoryInspectorView.swift in Sources */, B6EA1FE729DA341D001BF195 /* Theme.swift in Sources */, @@ -3450,7 +3419,6 @@ 6CB9144B29BEC7F100BC47F2 /* (null) in Sources */, 587B9E7429301D8F00AC7927 /* URL+URLParameters.swift in Sources */, 61538B902B111FE800A88846 /* String+AppearancesOfSubstring.swift in Sources */, - 6C5BE51C2A3D542B002DA0FC /* FeatureFlagsSettingsView.swift in Sources */, 581BFB6B2926431000D251EC /* RecentProjectItem.swift in Sources */, 587FB99029C1246400B519DD /* EditorTabView.swift in Sources */, 587B9DA429300ABD00AC7927 /* OverlayPanel.swift in Sources */, @@ -4771,8 +4739,8 @@ isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/CodeEditApp/CodeEditKit"; requirement = { - kind = exactVersion; - version = 0.1.0; + kind = upToNextMinorVersion; + minimumVersion = 0.1.0; }; }; 6C147C4329A329350089B630 /* XCRemoteSwiftPackageReference "swift-collections" */ = { @@ -4791,14 +4759,6 @@ minimumVersion = 1.0.0; }; }; - 6C5BE5202A3D5666002DA0FC /* XCRemoteSwiftPackageReference "SwiftUI-WindowManagement" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/Wouter01/SwiftUI-WindowManagement"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 2.1.0; - }; - }; 6C66C31129D05CC800DE9ED2 /* XCRemoteSwiftPackageReference "GRDB.swift" */ = { isa = XCRemoteSwiftPackageReference; repositoryURL = "https://github.com/groue/GRDB.swift.git"; @@ -4869,11 +4829,6 @@ package = 6C21493F2A1BB9AB00748382 /* XCRemoteSwiftPackageReference "LogStream" */; productName = LogStream; }; - 6C5BE5212A3D5666002DA0FC /* WindowManagement */ = { - isa = XCSwiftPackageProductDependency; - package = 6C5BE5202A3D5666002DA0FC /* XCRemoteSwiftPackageReference "SwiftUI-WindowManagement" */; - productName = WindowManagement; - }; 6C66C31229D05CDC00DE9ED2 /* GRDB */ = { isa = XCSwiftPackageProductDependency; package = 6C66C31129D05CC800DE9ED2 /* XCRemoteSwiftPackageReference "GRDB.swift" */; diff --git a/CodeEdit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/CodeEdit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved index 040dc189fd..95602736ef 100644 --- a/CodeEdit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ b/CodeEdit.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -1,4 +1,5 @@ { + "originHash" : "3f6921a5ec30d1ecb6d6b205cf27a816c318246bb00f0ea367b997cc66527d32", "pins" : [ { "identity" : "anycodable", @@ -14,8 +15,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/CodeEditApp/CodeEditKit", "state" : { - "revision" : "9ba3343ac53eb66a213a0a525604e297d8584a45", - "version" : "0.1.0" + "revision" : "bf76c0240589a38b504a703363ab85fcedfbc732", + "version" : "0.1.1" } }, { @@ -72,24 +73,6 @@ "version" : "0.4.2" } }, - { - "identity" : "fseventswrapper", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Frizlab/FSEventsWrapper", - "state" : { - "revision" : "e0c59a2ce2775e5f6642da6d19207445f10112d0", - "version" : "1.0.2" - } - }, - { - "identity" : "glob", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Bouke/Glob", - "state" : { - "revision" : "deda6e163d2ff2a8d7e138e2c3326dbd71157faf", - "version" : "1.0.5" - } - }, { "identity" : "grdb.swift", "kind" : "remoteSourceControl", @@ -99,33 +82,6 @@ "version" : "5.26.1" } }, - { - "identity" : "jsonrpc", - "kind" : "remoteSourceControl", - "location" : "https://github.com/ChimeHQ/JSONRPC", - "state" : { - "revision" : "aa785ad404bdcf7ec692908b3905dd4c87e87141", - "version" : "0.7.1" - } - }, - { - "identity" : "languageclient", - "kind" : "remoteSourceControl", - "location" : "https://github.com/ChimeHQ/LanguageClient", - "state" : { - "revision" : "92beeecd0bb783da52227839ba6c55e43fc866ec", - "version" : "0.5.1" - } - }, - { - "identity" : "languageserverprotocol", - "kind" : "remoteSourceControl", - "location" : "https://github.com/ChimeHQ/LanguageServerProtocol", - "state" : { - "revision" : "cae01173f45b0518ae5533b083edd153633af984", - "version" : "0.9.2" - } - }, { "identity" : "logstream", "kind" : "remoteSourceControl", @@ -144,24 +100,6 @@ "version" : "0.2.1" } }, - { - "identity" : "processenv", - "kind" : "remoteSourceControl", - "location" : "https://github.com/ChimeHQ/ProcessEnv", - "state" : { - "revision" : "29487b6581bb785c372c611c943541ef4309d051", - "version" : "0.3.1" - } - }, - { - "identity" : "processservice", - "kind" : "remoteSourceControl", - "location" : "https://github.com/ChimeHQ/ProcessService", - "state" : { - "revision" : "369fb0379983d3b43c7d7ad62c4e91ee020e347c", - "version" : "0.2.6" - } - }, { "identity" : "rearrange", "kind" : "remoteSourceControl", @@ -185,8 +123,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-collections.git", "state" : { - "revision" : "937e904258d22af6e447a0b72c0bc67583ef64a2", - "version" : "1.0.4" + "revision" : "94cf62b3ba8d4bed62680a282d4c25f9c63c2efb", + "version" : "1.1.0" } }, { @@ -203,8 +141,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/apple/swift-syntax.git", "state" : { - "revision" : "43c802fb7f96e090dde015344a94b5e85779eff1", - "version" : "509.1.0" + "revision" : "64889f0c732f210a935a0ad7cda38f77f876262d", + "version" : "509.1.1" } }, { @@ -212,8 +150,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/lukepistrol/SwiftLintPlugin", "state" : { - "revision" : "d3ec7fb242ebe1d8e23bf17e58a1e27d43125994", - "version" : "0.2.6" + "revision" : "ea6d3ca895b49910f790e98e4b4ca658e0fe490e", + "version" : "0.54.0" } }, { @@ -239,17 +177,8 @@ "kind" : "remoteSourceControl", "location" : "https://github.com/siteline/SwiftUI-Introspect", "state" : { - "revision" : "6dce3c8f5bfa8bc20120c7497da27e984a8813aa", - "version" : "0.7.0" - } - }, - { - "identity" : "swiftui-windowmanagement", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Wouter01/SwiftUI-WindowManagement", - "state" : { - "revision" : "adbebf5d7df325f3d7bf07dc832e5e162a9003f5", - "version" : "2.1.1" + "revision" : "121c146fe591b1320238d054ae35c81ffa45f45a", + "version" : "0.12.0" } }, { diff --git a/CodeEdit/CodeEditApp.swift b/CodeEdit/CodeEditApp.swift index 18339fe96d..9cc4626d47 100644 --- a/CodeEdit/CodeEditApp.swift +++ b/CodeEdit/CodeEditApp.swift @@ -6,7 +6,6 @@ // import SwiftUI -import WindowManagement @main struct CodeEditApp: App { @@ -33,20 +32,9 @@ struct CodeEditApp: App { AboutWindow() SettingsWindow() - - NSDocumentGroup(for: WorkspaceDocument.self) { workspace in - WindowSplitView(workspace: workspace) - } defaultAction: { - openWindow(sceneID: .welcome) - } - .register(.document(WorkspaceDocument.self)) // Required to make transition modifier work - .transition(.documentWindow) - .windowToolbarStyle(.unifiedCompact(showsTitle: false)) - .enableOpenWindow() // Required for opening windows through NSApp - .handlesExternalEvents(matching: []) - .commands { - CodeEditCommands() - } + .commands { + CodeEditCommands() + } } .environment(\.settings, settings.preferences) // Add settings to each window environment } diff --git a/CodeEdit/Features/Documents/WorkspaceDocument.swift b/CodeEdit/Features/Documents/WorkspaceDocument.swift index 5baa3397de..ab49327c62 100644 --- a/CodeEdit/Features/Documents/WorkspaceDocument.swift +++ b/CodeEdit/Features/Documents/WorkspaceDocument.swift @@ -9,7 +9,6 @@ import Foundation import AppKit import SwiftUI import Combine -import WindowManagement @objc(WorkspaceDocument) final class WorkspaceDocument: NSDocument, ObservableObject, NSToolbarDelegate { @@ -72,39 +71,32 @@ final class WorkspaceDocument: NSDocument, ObservableObject, NSToolbarDelegate { } override func makeWindowControllers() { - if Settings[\.featureFlags.useNewWindowingSystem] { - let window = NSApp.openDocument(self) - if let windowController = window?.windowController { - self.addWindowController(windowController) - } + let window = NSWindow( + contentRect: NSRect(x: 0, y: 0, width: 1400, height: 900), + styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView], + backing: .buffered, + defer: false + ) + // Setting the "min size" like this is hacky, but SwiftUI overrides the contentRect and + // any of the built-in window size functions & autosave stuff. So we have to set it like this. + // SwiftUI also ignores this value, so it just manages to set the initial window size. *Hopefully* this + // is fixed in the future. + if let rectString = getFromWorkspaceState(.workspaceWindowSize) as? String { + window.minSize = NSRectFromString(rectString).size } else { - let window = NSWindow( - contentRect: NSRect(x: 0, y: 0, width: 1400, height: 900), - styleMask: [.titled, .closable, .miniaturizable, .resizable, .fullSizeContentView], - backing: .buffered, - defer: false - ) - // Setting the "min size" like this is hacky, but SwiftUI overrides the contentRect and - // any of the built-in window size functions & autosave stuff. So we have to set it like this. - // SwiftUI also ignores this value, so it just manages to set the initial window size. *Hopefully* this - // is fixed in the future. - if let rectString = getFromWorkspaceState(.workspaceWindowSize) as? String { - window.minSize = NSRectFromString(rectString).size - } else { - window.minSize = .init(width: 1400, height: 900) - } - let windowController = CodeEditWindowController( - window: window, - workspace: self - ) + window.minSize = .init(width: 1400, height: 900) + } + let windowController = CodeEditWindowController( + window: window, + workspace: self + ) - if let rectString = getFromWorkspaceState(.workspaceWindowSize) as? String { - window.setFrameOrigin(NSRectFromString(rectString).origin) - } else { - window.center() - } - self.addWindowController(windowController) + if let rectString = getFromWorkspaceState(.workspaceWindowSize) as? String { + window.setFrameOrigin(NSRectFromString(rectString).origin) + } else { + window.center() } + self.addWindowController(windowController) } // MARK: Set Up Workspace diff --git a/CodeEdit/Features/Settings/Models/SettingsData.swift b/CodeEdit/Features/Settings/Models/SettingsData.swift index 2eebf5af0b..1e04636737 100644 --- a/CodeEdit/Features/Settings/Models/SettingsData.swift +++ b/CodeEdit/Features/Settings/Models/SettingsData.swift @@ -47,9 +47,6 @@ struct SettingsData: Codable, Hashable { /// The global settings for keybindings var keybindings: KeybindingsSettings = .init() - /// Feature Flags settings - var featureFlags: FeatureFlagsSettings = .init() - /// Searh Settings var search: SearchSettings = .init() @@ -74,7 +71,6 @@ struct SettingsData: Codable, Hashable { KeybindingsSettings.self, forKey: .keybindings ) ?? .init() - self.featureFlags = try container.decodeIfPresent(FeatureFlagsSettings.self, forKey: .featureFlags) ?? .init() } // swiftlint:disable cyclomatic_complexity @@ -100,8 +96,6 @@ struct SettingsData: Codable, Hashable { sourceControl.searchKeys.forEach { settings.append(.init(name, isSetting: true, settingName: $0)) } case .location: LocationsSettings().searchKeys.forEach { settings.append(.init(name, isSetting: true, settingName: $0)) } - case .featureFlags: - featureFlags.searchKeys.forEach { settings.append(.init(name, isSetting: true, settingName: $0)) } case .behavior: return [.init(name, settingName: "Error")] case .components: return [.init(name, settingName: "Error")] case .keybindings: return [.init(name, settingName: "Error")] diff --git a/CodeEdit/Features/Settings/Models/SettingsPage.swift b/CodeEdit/Features/Settings/Models/SettingsPage.swift index 54d9b0a970..d8caed9933 100644 --- a/CodeEdit/Features/Settings/Models/SettingsPage.swift +++ b/CodeEdit/Features/Settings/Models/SettingsPage.swift @@ -31,7 +31,6 @@ struct SettingsPage: Hashable, Equatable, Identifiable { case sourceControl = "Source Control" case components = "Components" case location = "Locations" - case featureFlags = "Feature Flags" case advanced = "Advanced" } diff --git a/CodeEdit/Features/Settings/Pages/FeatureFlags/FeatureFlagsSettingsView.swift b/CodeEdit/Features/Settings/Pages/FeatureFlags/FeatureFlagsSettingsView.swift deleted file mode 100644 index ddf222b4b9..0000000000 --- a/CodeEdit/Features/Settings/Pages/FeatureFlags/FeatureFlagsSettingsView.swift +++ /dev/null @@ -1,31 +0,0 @@ -// -// FeatureFlagsSettingsView.swift -// CodeEdit -// -// Created by Wouter Hennen on 17/06/2023. -// - -import SwiftUI - -struct FeatureFlagsSettingsView: View { - - @AppSettings(\.featureFlags.useNewWindowingSystem) - var useNewWindowingSystem - - var body: some View { - Form { - VStack(alignment: .leading) { - Toggle("New Windowing System", isOn: $useNewWindowingSystem) - Text( - """ - Active workspaces must be reopened in order to take effect. - Inspector only works on macOS Sonoma. - """ - ) - .font(.footnote) - .foregroundStyle(.secondary) - } - } - .formStyle(.grouped) - } -} diff --git a/CodeEdit/Features/Settings/Pages/FeatureFlags/Models/FeatureFlagsSettings.swift b/CodeEdit/Features/Settings/Pages/FeatureFlags/Models/FeatureFlagsSettings.swift deleted file mode 100644 index f612c8d782..0000000000 --- a/CodeEdit/Features/Settings/Pages/FeatureFlags/Models/FeatureFlagsSettings.swift +++ /dev/null @@ -1,24 +0,0 @@ -// -// FeatureFlagsSettings.swift -// CodeEdit -// -// Created by Wouter Hennen on 17/06/2023. -// - -import Foundation - -extension SettingsData { - - struct FeatureFlagsSettings: Codable, Hashable, SearchableSettingsPage { - - /// The search keys - var searchKeys: [String] { - [ - "New Windowing System" - ] - .map { NSLocalizedString($0, comment: "") } - } - - var useNewWindowingSystem = false - } -} diff --git a/CodeEdit/Features/Settings/SettingsView.swift b/CodeEdit/Features/Settings/SettingsView.swift index a40d76dba9..8bc583efd6 100644 --- a/CodeEdit/Features/Settings/SettingsView.swift +++ b/CodeEdit/Features/Settings/SettingsView.swift @@ -84,13 +84,6 @@ struct SettingsView: View { baseColor: .green, icon: .system("externaldrive.fill") ) - ), - .init( - SettingsPage( - .featureFlags, - baseColor: .cyan, - icon: .system("flag.2.crossed.fill") - ) ) ] @@ -173,8 +166,6 @@ struct SettingsView: View { SourceControlSettingsView() case .location: LocationsSettingsView() - case .featureFlags: - FeatureFlagsSettingsView() default: Text("Implementation Needed").frame(alignment: .center) } diff --git a/CodeEdit/Features/WindowCommands/ViewCommands.swift b/CodeEdit/Features/WindowCommands/ViewCommands.swift index 9c8fb9e463..cd46e5e4b2 100644 --- a/CodeEdit/Features/WindowCommands/ViewCommands.swift +++ b/CodeEdit/Features/WindowCommands/ViewCommands.swift @@ -12,8 +12,6 @@ struct ViewCommands: Commands { var editorFontSize @AppSettings(\.terminal.font.size) var terminalFontSize - @AppSettings(\.featureFlags.useNewWindowingSystem) - var useNewWindowingSystem @AppSettings(\.general.showEditorPathBar) var showEditorPathBar @AppSettings(\.general.dimEditorsWithoutFocus) @@ -83,56 +81,36 @@ struct ViewCommands: Commands { Divider() - if useNewWindowingSystem { - Button("\(navigationSplitViewVisibility == .detailOnly ? "Show" : "Hide") Navigator") { - withAnimation(.linear(duration: .zero)) { - if navigationSplitViewVisibility == .all { - navigationSplitViewVisibility = .detailOnly - } else { - navigationSplitViewVisibility = .all - } - } - } - .disabled(navigationSplitViewVisibility == nil) - .keyboardShortcut("0", modifiers: [.command]) - - Button("\(inspectorVisibility == false ? "Show" : "Hide") Inspector") { - inspectorVisibility?.toggle() - } - .disabled(inspectorVisibility == nil) - .keyboardShortcut("i", modifiers: [.control, .command]) - } else { - Button("\(navigatorCollapsed ? "Show" : "Hide") Navigator") { - windowController?.toggleFirstPanel() - } - .disabled(windowController == nil) - .keyboardShortcut("0", modifiers: [.command]) - .onReceive(NSApp.publisher(for: \.keyWindow)) { window in - windowController = window?.windowController as? CodeEditWindowController - } + Button("\(navigatorCollapsed ? "Show" : "Hide") Navigator") { + windowController?.toggleFirstPanel() + } + .disabled(windowController == nil) + .keyboardShortcut("0", modifiers: [.command]) + .onReceive(NSApp.publisher(for: \.keyWindow)) { window in + windowController = window?.windowController as? CodeEditWindowController + } - Button("\(inspectorCollapsed ? "Show" : "Hide") Inspector") { - windowController?.toggleLastPanel() - } - .disabled(windowController == nil) - .keyboardShortcut("i", modifiers: [.control, .command]) + Button("\(inspectorCollapsed ? "Show" : "Hide") Inspector") { + windowController?.toggleLastPanel() + } + .disabled(windowController == nil) + .keyboardShortcut("i", modifiers: [.control, .command]) - Button("\(inspectorCollapsed ? "Show" : "Hide") Utility Area") { - CommandManager.shared.executeCommand("open.drawer") - } - .disabled(windowController == nil) - .keyboardShortcut("y", modifiers: [.shift, .command]) + Button("\(inspectorCollapsed ? "Show" : "Hide") Utility Area") { + CommandManager.shared.executeCommand("open.drawer") + } + .disabled(windowController == nil) + .keyboardShortcut("y", modifiers: [.shift, .command]) - Divider() + Divider() - Button("\(showEditorPathBar ? "Hide" : "Show") Path Bar") { - showEditorPathBar.toggle() - } + Button("\(showEditorPathBar ? "Hide" : "Show") Path Bar") { + showEditorPathBar.toggle() + } - Toggle("Dim editors without focus", isOn: $dimEditorsWithoutFocus) + Toggle("Dim editors without focus", isOn: $dimEditorsWithoutFocus) - Divider() - } + Divider() if let model = windowController?.navigatorSidebarViewModel { Divider() diff --git a/CodeEdit/WindowSplitView.swift b/CodeEdit/WindowSplitView.swift deleted file mode 100644 index 36dae71bdf..0000000000 --- a/CodeEdit/WindowSplitView.swift +++ /dev/null @@ -1,87 +0,0 @@ -// -// WindowSplitView.swift -// CodeEdit -// -// Created by Wouter Hennen on 18/06/2023. -// -// - -import SwiftUI - -struct WindowSplitView: View { - @StateObject var workspace: WorkspaceDocument - @State var visibility: NavigationSplitViewVisibility = .all - @State var showInspector = true - @State var window: NSWindow = .init() - - var navigatorAreaView: some View { - NavigatorAreaView(workspace: workspace, viewModel: NavigatorSidebarViewModel()) - .toolbar { - ToolbarItem { - Button { - withAnimation(.linear(duration: 0)) { - if visibility == .detailOnly { - visibility = .all - } else { - visibility = .detailOnly - } - } - } label: { - Image(systemName: "sidebar.left") - .imageScale(.large) - } - } - } - } - - var body: some View { - WindowObserver(window: window) { - if #available(macOS 14.0, *) { - NavigationSplitView(columnVisibility: $visibility) { - navigatorAreaView - } detail: { - WorkspaceView() - .toolbar { - ToolbarItem(id: "com.apple.SwiftUI.navigationSplitView.toggleSidebar") { - ToolbarBranchPicker( - workspaceFileManager: workspace.workspaceFileManager - ) - } - .defaultCustomization(.hidden, options: []) - } - } -#if swift(>=5.9) // Fixes build on Xcode 14 - .inspector(isPresented: $showInspector) { - InspectorAreaView(viewModel: InspectorAreaViewModel()) - .inspectorColumnWidth(min: 100, ideal: 200, max: 400) - .toolbar { - Spacer() - Button { - showInspector.toggle() - } label: { - Image(systemName: "sidebar.right") - .imageScale(.large) - } - } - } -#endif - } else { - NavigationSplitView(columnVisibility: $visibility) { - navigatorAreaView - } detail: { - WorkspaceView() - } - } - } - .focusedSceneValue(\.navigationSplitViewVisibility, $visibility) - .focusedSceneValue(\.inspectorVisibility, $showInspector) - .environmentObject(workspace) - .environmentObject(workspace.editorManager) - .environmentObject(workspace.utilityAreaModel) - .task { - if let newWindow = workspace.windowControllers.first?.window { - window = newWindow - } - } - } -}