From 5427b0b507a3b35b29c50f9fb85316b40791a805 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 22 Apr 2025 08:36:12 -0700 Subject: [PATCH] macOS: add description as hover tooltip --- macos/Sources/Features/Command Palette/CommandPalette.swift | 2 ++ .../Features/Command Palette/TerminalCommandPalette.swift | 1 + 2 files changed, 3 insertions(+) diff --git a/macos/Sources/Features/Command Palette/CommandPalette.swift b/macos/Sources/Features/Command Palette/CommandPalette.swift index 943cc7846..cad93aa22 100644 --- a/macos/Sources/Features/Command Palette/CommandPalette.swift +++ b/macos/Sources/Features/Command Palette/CommandPalette.swift @@ -3,6 +3,7 @@ import SwiftUI struct CommandOption: Identifiable, Hashable { let id = UUID() let title: String + let description: String? let shortcut: String? let action: () -> Void @@ -222,6 +223,7 @@ fileprivate struct CommandRow: View { ) .cornerRadius(6) } + .help(option.description ?? "") .buttonStyle(PlainButtonStyle()) .onHover { hovering in hoveredID = hovering ? option.id : nil diff --git a/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift b/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift index e0c8435af..2e895d4d9 100644 --- a/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift +++ b/macos/Sources/Features/Command Palette/TerminalCommandPalette.swift @@ -39,6 +39,7 @@ struct TerminalCommandPaletteView: View { let action = String(cString: c.action) return CommandOption( title: String(cString: c.title), + description: String(cString: c.description), shortcut: ghosttyConfig.keyboardShortcut(for: action)?.description ) { onAction(action)