diff --git a/Resources/Localizable.xcstrings b/Resources/Localizable.xcstrings index 2cdbf7ca..94e2a8db 100644 --- a/Resources/Localizable.xcstrings +++ b/Resources/Localizable.xcstrings @@ -14349,6 +14349,40 @@ } } }, + "command.enableMinimalMode.title": { + "extractionState": "manual", + "localizations": { + "en": { + "stringUnit": { + "state": "translated", + "value": "Enable Minimal Mode" + } + }, + "ja": { + "stringUnit": { + "state": "translated", + "value": "ミニマルモードを有効にする" + } + } + } + }, + "command.disableMinimalMode.title": { + "extractionState": "manual", + "localizations": { + "en": { + "stringUnit": { + "state": "translated", + "value": "Disable Minimal Mode" + } + }, + "ja": { + "stringUnit": { + "state": "translated", + "value": "ミニマルモードを無効にする" + } + } + } + }, "command.installCLI.subtitle": { "extractionState": "manual", "localizations": { diff --git a/Sources/ContentView.swift b/Sources/ContentView.swift index 35d0fd95..1d862346 100644 --- a/Sources/ContentView.swift +++ b/Sources/ContentView.swift @@ -1609,6 +1609,7 @@ struct ContentView: View { static let hasWorkspace = "workspace.hasSelection" static let workspaceName = "workspace.name" static let workspaceHasCustomName = "workspace.hasCustomName" + static let workspaceMinimalModeEnabled = "workspace.minimalModeEnabled" static let workspaceShouldPin = "workspace.shouldPin" static let workspaceHasPullRequests = "workspace.hasPullRequests" static let workspaceHasSplits = "workspace.hasSplits" @@ -4888,6 +4889,7 @@ struct ContentView: View { terminalOpenTargets: Set? = nil ) -> CommandPaletteContextSnapshot { var snapshot = CommandPaletteContextSnapshot() + snapshot.setBool(CommandPaletteContextKeys.workspaceMinimalModeEnabled, isMinimalMode) if let workspace = tabManager.selectedWorkspace { snapshot.setBool(CommandPaletteContextKeys.hasWorkspace, true) @@ -5092,6 +5094,24 @@ struct ContentView: View { keywords: ["toggle", "sidebar", "layout"] ) ) + contributions.append( + CommandPaletteCommandContribution( + commandId: "palette.enableMinimalMode", + title: constant(String(localized: "command.enableMinimalMode.title", defaultValue: "Enable Minimal Mode")), + subtitle: constant(String(localized: "command.toggleSidebar.subtitle", defaultValue: "Layout")), + keywords: ["minimal", "mode", "titlebar", "sidebar", "layout"], + when: { !$0.bool(CommandPaletteContextKeys.workspaceMinimalModeEnabled) } + ) + ) + contributions.append( + CommandPaletteCommandContribution( + commandId: "palette.disableMinimalMode", + title: constant(String(localized: "command.disableMinimalMode.title", defaultValue: "Disable Minimal Mode")), + subtitle: constant(String(localized: "command.toggleSidebar.subtitle", defaultValue: "Layout")), + keywords: ["minimal", "mode", "titlebar", "sidebar", "layout"], + when: { $0.bool(CommandPaletteContextKeys.workspaceMinimalModeEnabled) } + ) + ) contributions.append( CommandPaletteCommandContribution( commandId: "palette.triggerFlash", @@ -5711,6 +5731,12 @@ struct ContentView: View { registry.register(commandId: "palette.toggleSidebar") { sidebarState.toggle() } + registry.register(commandId: "palette.enableMinimalMode") { + workspacePresentationMode = WorkspacePresentationModeSettings.Mode.minimal.rawValue + } + registry.register(commandId: "palette.disableMinimalMode") { + workspacePresentationMode = WorkspacePresentationModeSettings.Mode.standard.rawValue + } registry.register(commandId: "palette.triggerFlash") { tabManager.triggerFocusFlash() }