From e33eed0216b49ba4ee8a2d4eacdbca9bada67417 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 21 Apr 2025 10:32:07 -0700 Subject: [PATCH] macOS: command palette visual tweaks --- .../Command Palette/CommandPalette.swift | 26 ++++++++++++++----- .../TerminalCommandPalette.swift | 2 +- .../Helpers/KeyboardShortcut+Extension.swift | 2 +- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/macos/Sources/Features/Command Palette/CommandPalette.swift b/macos/Sources/Features/Command Palette/CommandPalette.swift index 24677debc..887ea3464 100644 --- a/macos/Sources/Features/Command Palette/CommandPalette.swift +++ b/macos/Sources/Features/Command Palette/CommandPalette.swift @@ -91,10 +91,16 @@ struct CommandPaletteView: View { option.action() } } - .frame(width: 500) - .background(backgroundColor) - .cornerRadius(12) - .shadow(radius: 20) + .frame(maxWidth: 500) + .background( + RoundedRectangle(cornerRadius: 12) + .fill(backgroundColor) + .shadow(color: .black.opacity(0.4), radius: 10, x: 0, y: 10) + .overlay( + RoundedRectangle(cornerRadius: 12) + .stroke(Color.black.opacity(0.1), lineWidth: 1) + ) + ) .padding() } } @@ -179,7 +185,7 @@ fileprivate struct CommandTable: View { } } } - .frame(height: 200) + .frame(maxHeight: 200) .onChange(of: selectedIndex) { _ in guard selectedIndex < options.count else { return } withAnimation { @@ -207,8 +213,14 @@ fileprivate struct CommandRow: View { Spacer() if let shortcut = option.shortcut { Text(shortcut) - .foregroundStyle(.secondary) - .font(.system(size: 12)) + .font(.system(.body, design: .monospaced)) + .kerning(1.5) + .padding(.horizontal, 6) + .padding(.vertical, 2) + .background( + RoundedRectangle(cornerRadius: 6) + .fill(Color.gray.opacity(0.2)) + ) } } .padding(.horizontal, 6) diff --git a/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift b/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift index 29ce28906..fe23d5bf8 100644 --- a/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift +++ b/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift @@ -41,7 +41,7 @@ struct TerminalCommandPaletteView: View { if isPresented { GeometryReader { geometry in VStack { - Spacer().frame(height: geometry.size.height * 0.1) + Spacer().frame(height: geometry.size.height * 0.05) ResponderChainInjector(responder: surfaceView) .frame(width: 0, height: 0) diff --git a/macos/Sources/Helpers/KeyboardShortcut+Extension.swift b/macos/Sources/Helpers/KeyboardShortcut+Extension.swift index b953f5755..9b5855757 100644 --- a/macos/Sources/Helpers/KeyboardShortcut+Extension.swift +++ b/macos/Sources/Helpers/KeyboardShortcut+Extension.swift @@ -29,7 +29,7 @@ extension KeyboardShortcut: @retroactive CustomStringConvertible { case .leftArrow: keyString = "←" case .rightArrow: keyString = "→" default: - keyString = String(key.character) + keyString = String(key.character.uppercased()) } result.append(keyString)