Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

Use compact modifier symbols in overlay tooltip for combo hotkeys

Gabriel Stein288e544ee8d8
diff --git a/src/App.jsx b/src/App.jsx
index abf508d68..390a549b5 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -5,7 +5,7 @@ import { X } from "lucide-react";
import { useToast } from "./components/ui/Toast";
import { LoadingDots } from "./components/ui/LoadingDots";
import { useHotkey } from "./hooks/useHotkey";
-import { formatHotkeyLabel } from "./utils/hotkeys";
+import { formatHotkeyCompact } from "./utils/hotkeys";
import { useWindowDrag } from "./hooks/useWindowDrag";
import { useAudioRecording } from "./hooks/useAudioRecording";
import { useSettingsStore } from "./stores/settingsStore";
@@ -277,7 +277,7 @@ export default function App() {
case "hover":
return {
className: `${baseClasses} bg-black/50 cursor-pointer`,
- tooltip: formatHotkeyLabel(hotkey),
+ tooltip: formatHotkeyCompact(hotkey),
};
case "recording":
return {
diff --git a/src/utils/hotkeys.ts b/src/utils/hotkeys.ts
index 7b869ce9b..7c1ea6c6a 100644
--- a/src/utils/hotkeys.ts
+++ b/src/utils/hotkeys.ts
@@ -37,6 +37,24 @@ function formatModifierPart(part: string, platform: Platform): string {
}
}
+const MODIFIER_SYMBOLS: Record<string, string> = {
+ CommandOrControl: "⌘",
+ Command: "⌘",
+ Cmd: "⌘",
+ Control: "⌃",
+ Ctrl: "⌃",
+ Alt: "⌥",
+ Option: "⌥",
+ Shift: "⇧",
+ Super: "⌘",
+ Meta: "⌘",
+ Fn: "Fn",
+};
+
+function formatModifierSymbol(part: string): string {
+ return MODIFIER_SYMBOLS[part] ?? part;
+}
+
/**
* Formats an Electron accelerator string into a user-friendly display label.
*
@@ -55,6 +73,26 @@ export function formatHotkeyLabel(hotkey?: string | null): string {
return formatHotkeyLabelForPlatform(resolvedHotkey, platform);
}
+/**
+ * Compact hotkey label using symbols on macOS (e.g., "⌘⇧K") and short text elsewhere.
+ * Designed for tight UI spaces like the 96px overlay tooltip.
+ */
+export function formatHotkeyCompact(hotkey?: string | null): string {
+ const platform = getPlatform();
+ const resolvedHotkey = hotkey && hotkey.trim() !== "" ? hotkey : getDefaultHotkey();
+
+ if (!resolvedHotkey || resolvedHotkey.trim() === "") return "";
+ if (isGlobeLikeHotkey(resolvedHotkey)) return "Globe/Fn";
+
+ if (platform === "darwin" && resolvedHotkey.includes("+")) {
+ const parts = resolvedHotkey.split("+");
+ const symbols = parts.map((p) => formatModifierSymbol(p));
+ return symbols.join("");
+ }
+
+ return formatHotkeyLabelForPlatform(resolvedHotkey, platform);
+}
+
export function formatHotkeyLabelForPlatform(hotkey: string, platform: Platform): string {
if (!hotkey || hotkey.trim() === "") {
return "";