Skip to content

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

fix(hotkeys): show conflict warning when agent hotkey duplicates another mode

Gabriel Stein9f84dcef54bc
diff --git a/src/components/settings/AgentModeSettings.tsx b/src/components/settings/AgentModeSettings.tsx
index 98d3f95e0..69f4486b1 100644
--- a/src/components/settings/AgentModeSettings.tsx
+++ b/src/components/settings/AgentModeSettings.tsx
@@ -1,3 +1,4 @@
+import { useCallback } from "react";
import { useTranslation } from "react-i18next";
import { Cloud, Key } from "lucide-react";
import { useSettingsStore } from "../../stores/settingsStore";
@@ -5,6 +6,8 @@ import { HotkeyInput } from "../ui/HotkeyInput";
import { Toggle } from "../ui/toggle";
import { SettingsRow, SettingsPanel, SettingsPanelRow, SectionHeader } from "../ui/SettingsSection";
import ReasoningModelSelector from "../ReasoningModelSelector";
+import { getValidationMessage, normalizeHotkey } from "../../utils/hotkeyValidator";
+import { getPlatform } from "../../utils/platform";
export default function AgentModeSettings() {
const { t } = useTranslation();
@@ -13,6 +16,8 @@ export default function AgentModeSettings() {
setAgentEnabled,
agentKey,
setAgentKey,
+ dictationKey,
+ meetingKey,
agentModel,
setAgentModel,
agentProvider,
@@ -39,6 +44,25 @@ export default function AgentModeSettings() {
const isCloudMode = isSignedIn && cloudAgentMode === "openwhispr";
const isCustomMode = cloudAgentMode === "byok";
+ const validateAgentHotkey = useCallback(
+ (hotkey: string) => {
+ const formatError = getValidationMessage(hotkey, getPlatform());
+ if (formatError) return formatError;
+ const platform = getPlatform();
+ const normalized = normalizeHotkey(hotkey, platform);
+ if (dictationKey && normalizeHotkey(dictationKey, platform) === normalized) {
+ return t("hotkey.errors.slotConflict", { slot: t("settingsPage.general.hotkey.title") });
+ }
+ if (meetingKey && normalizeHotkey(meetingKey, platform) === normalized) {
+ return t("hotkey.errors.slotConflict", {
+ slot: t("settingsPage.general.meetingHotkey.title"),
+ });
+ }
+ return null;
+ },
+ [dictationKey, meetingKey, t]
+ );
+
return (
<div className="space-y-6">
<SectionHeader
@@ -66,7 +90,7 @@ export default function AgentModeSettings() {
title={t("agentMode.settings.hotkey")}
description={t("agentMode.settings.hotkeyDescription")}
/>
- <HotkeyInput value={agentKey} onChange={setAgentKey} />
+ <HotkeyInput value={agentKey} onChange={setAgentKey} validate={validateAgentHotkey} />
</div>
{/* Cloud / BYOK toggle */}