Dodaios is an open-source agent OS for your desktop: it runs your coding agents, browser and apps by voice or chat, on your own machine. Formerly Personal Jarvis.
Python agent-orchestrationai-agentai-coding-assistantclaude-codecoding-agentcomputer-usedesktop-applocal-firstmcppersonal-jarvisvoice-assistantvoice-coding
feat(ui): Keyboard shortcuts get their own Settings-hub page
rubenluetke10-beep270d9cd151f6
diff --git a/jarvis/plugins/tool/navigate.py b/jarvis/plugins/tool/navigate.pyindex dce52be78f..2d1b93587a 100644--- a/jarvis/plugins/tool/navigate.py+++ b/jarvis/plugins/tool/navigate.py@@ -75,6 +75,8 @@ KNOWN: frozenset[str] = frozenset("marketplace",# My Pets: the desktop pet, its look, and the pets the user created."pets",+ # Keyboard shortcuts: every shortcut in one place, with a key tester.+ "shortcuts",})@@ -247,6 +249,17 @@ _ALIASES: dict[str, str] = {"diktat-tastenkürzel": "voice-shortcuts", # i18n-allow: input vocab"diktat-tasten": "voice-shortcuts", # i18n-allow: input vocab"atajos de dictado": "voice-shortcuts", # i18n-allow: input vocab+ # The Keyboard shortcuts page (Settings hub). The dictation-only words+ # above keep landing on the voice tab.+ "keyboard shortcuts": "shortcuts",+ "shortcuts": "shortcuts",+ "hotkeys": "shortcuts",+ "keybinds": "shortcuts",+ "key bindings": "shortcuts",+ "tastenkürzel": "shortcuts", # i18n-allow: input vocab+ "tastenkombinationen": "shortcuts", # i18n-allow: input vocab+ "atajos de teclado": "shortcuts", # i18n-allow: input vocab+ "atajos": "shortcuts", # i18n-allow: input vocab"dictation language": "voice-language","diktat-sprache": "voice-language", # i18n-allow: input vocab"idioma de dictado": "voice-language", # i18n-allow: input vocabdiff --git a/jarvis/ui/web/frontend/src/components/layout/navGroups.ts b/jarvis/ui/web/frontend/src/components/layout/navGroups.tsindex 8e26cb9307..ffd13ee5d6 100644--- a/jarvis/ui/web/frontend/src/components/layout/navGroups.ts+++ b/jarvis/ui/web/frontend/src/components/layout/navGroups.ts@@ -33,6 +33,7 @@ import {Wallet,Workflow,PawPrint,+ Keyboard,ScanLine,ShieldCheck,type LucideIcon,@@ -267,6 +268,12 @@ export const NAV_FOOTER_ITEMS: NavItem[] = [* Appshots page is.*/export const SETTINGS_HUB_ONLY_ITEMS: NavItem[] = [+ {+ id: "shortcuts",+ labelKey: "nav.shortcuts",+ icon: Keyboard,+ fallbackLabel: "Keyboard shortcuts",+ },{ id: "appshots", labelKey: "nav.appshots", icon: ScanLine, fallbackLabel: "Appshots" },{ id: "pets", labelKey: "nav.pets", icon: PawPrint, fallbackLabel: "My Pets" },{@@ -301,6 +308,7 @@ export const SETTINGS_HUB_IDS: readonly SectionId[] = ["local-models","computers","appshots",+ "shortcuts","pets","jarvis-actions","costs",diff --git a/jarvis/ui/web/frontend/src/i18n/locales/de.json b/jarvis/ui/web/frontend/src/i18n/locales/de.jsonindex 5191d475a0..034559da20 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/de.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/de.json@@ -165,6 +165,7 @@"group_system": "System","agent_instructions": "{name}.md","appshots": "Appshots",+ "shortcuts": "Tastenkürzel","pets": "Meine Pets","jarvis_actions": "Jarvis-Aktionen","marketplace": "Marketplace",@@ -1567,6 +1568,24 @@"error": "fehler"}},+ "shortcuts_view": {+ "title": "Tastenkürzel",+ "description": "Alle Tastenkombinationen, auf die Jarvis hört, an einem Ort. Drück eine Kombination und sieh, was sie tut.",+ "tester_title": "Kombination ausprobieren",+ "tester_hint": "Drück beliebige Tasten — sie erscheinen hier, zusammen mit dem, was sie in Jarvis tun.",+ "tester_modifiers": "Halten und eine Taste dazunehmen.",+ "tester_free": "Frei — nichts in Jarvis nutzt diese Kombination.",+ "section_app": "In der App",+ "section_app_hint": "Funktioniert, solange das Jarvis-Fenster vorne ist.",+ "section_calls": "Anrufe",+ "section_calls_hint": "Sprachanruf starten und beenden — aus jedem Programm auf diesem Computer.",+ "section_dictation": "Diktat",+ "section_dictation_hint": "In das Fenster sprechen, das gerade vorne ist. Geändert wird es im Sprachbereich.",+ "edit_in_voice": "Ändern",+ "section_workspace": "Terminals und Arbeitsbereich",+ "section_workspace_hint": "Feste Tasten für die Agenten-Terminals und diese App.",+ "footer": "Anruf-, Auflege- und Diktat-Tasten funktionieren überall auf diesem Computer. Die Schnellsuche und die Arbeitsbereich-Tasten nur im Jarvis-Fenster."+ },"shortcut_overlay": {"title": "Tastenkürzel","description": "Drücke überall ?, um diese Liste zu öffnen. Die Sprachtasten lassen sich in den Einstellungen ändern.",@@ -1574,7 +1593,7 @@"or": "oder","unassigned": "nicht belegt","off": "aus",- "footer": "Sprachtasten änderst du unter Einstellungen → Tastatur.",+ "footer": "Ändern kannst du sie unter Einstellungen → Tastenkürzel.","area": {"voice": "Sprache","workspace": "Arbeitsbereich"diff --git a/jarvis/ui/web/frontend/src/i18n/locales/en.json b/jarvis/ui/web/frontend/src/i18n/locales/en.jsonindex e99501b44d..c5e0c1d4bc 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/en.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/en.json@@ -165,6 +165,7 @@"group_system": "System","agent_instructions": "{name}.md","appshots": "Appshots",+ "shortcuts": "Keyboard shortcuts","pets": "My Pets","jarvis_actions": "Jarvis actions","marketplace": "Marketplace",@@ -1600,6 +1601,24 @@"error": "error"}},+ "shortcuts_view": {+ "title": "Keyboard shortcuts",+ "description": "Every key combination Jarvis listens for, in one place. Press any combination to see what it does.",+ "tester_title": "Try a combination",+ "tester_hint": "Press any keys — they show up here with what they do in Jarvis.",+ "tester_modifiers": "Keep holding and add a key.",+ "tester_free": "Free — nothing in Jarvis uses this combination.",+ "section_app": "In the app",+ "section_app_hint": "Works while the Jarvis window is in front.",+ "section_calls": "Calls",+ "section_calls_hint": "Start and end a voice call — from any app on this computer.",+ "section_dictation": "Dictation",+ "section_dictation_hint": "Speak into whatever window is in front. Changed in the voice section.",+ "edit_in_voice": "Change",+ "section_workspace": "Terminals and workspace",+ "section_workspace_hint": "Fixed keys for the agent terminals and this app.",+ "footer": "Call, hang-up and dictation keys work everywhere on this computer. The quick switcher and the workspace keys only work inside the Jarvis window."+ },"shortcut_overlay": {"title": "Keyboard shortcuts","description": "Press ? anywhere to open this list. Voice keys are configurable in Settings.",@@ -1607,7 +1626,7 @@"or": "or","unassigned": "not assigned","off": "off",- "footer": "Rebind the voice keys under Settings → Keyboard.",+ "footer": "Change them under Settings → Keyboard shortcuts.","area": {"voice": "Voice","workspace": "Workspace"diff --git a/jarvis/ui/web/frontend/src/i18n/locales/es.json b/jarvis/ui/web/frontend/src/i18n/locales/es.jsonindex 99c958e3e0..665f4ddc34 100644--- a/jarvis/ui/web/frontend/src/i18n/locales/es.json+++ b/jarvis/ui/web/frontend/src/i18n/locales/es.json@@ -165,6 +165,7 @@"group_system": "Sistema","agent_instructions": "{name}.md","appshots": "Appshots",+ "shortcuts": "Atajos de teclado","pets": "Mis mascotas","jarvis_actions": "Acciones de Jarvis","marketplace": "Marketplace",@@ -1567,6 +1568,24 @@"error": "error"}},+ "shortcuts_view": {+ "title": "Atajos de teclado",+ "description": "Todas las combinaciones de teclas que Jarvis escucha, en un solo lugar. Pulsa una combinación para ver qué hace.",+ "tester_title": "Prueba una combinación",+ "tester_hint": "Pulsa cualquier tecla: aparece aquí junto con lo que hace en Jarvis.",+ "tester_modifiers": "Mantén pulsado y añade una tecla.",+ "tester_free": "Libre: nada en Jarvis usa esta combinación.",+ "section_app": "En la app",+ "section_app_hint": "Funciona mientras la ventana de Jarvis está delante.",+ "section_calls": "Llamadas",+ "section_calls_hint": "Empieza y termina una llamada de voz desde cualquier app de este ordenador.",+ "section_dictation": "Dictado",+ "section_dictation_hint": "Habla en la ventana que esté delante. Se cambia en la sección de voz.",+ "edit_in_voice": "Cambiar",+ "section_workspace": "Terminales y espacio de trabajo",+ "section_workspace_hint": "Teclas fijas para los terminales de agentes y esta app.",+ "footer": "Las teclas de llamada, colgar y dictado funcionan en todo este ordenador. El cambio rápido y las teclas del espacio de trabajo solo dentro de la ventana de Jarvis."+ },"shortcut_overlay": {"title": "Atajos de teclado","description": "Pulsa ? en cualquier lugar para abrir esta lista. Las teclas de voz se configuran en Ajustes.",@@ -1574,7 +1593,7 @@"or": "o","unassigned": "sin asignar","off": "desactivado",- "footer": "Cambia las teclas de voz en Ajustes → Teclado.",+ "footer": "Cámbialos en Ajustes → Atajos de teclado.","area": {"voice": "Voz","workspace": "Espacio de trabajo"diff --git a/jarvis/ui/web/frontend/src/lib/quickSwitch.ts b/jarvis/ui/web/frontend/src/lib/quickSwitch.tsindex e95578211a..152c167595 100644--- a/jarvis/ui/web/frontend/src/lib/quickSwitch.ts+++ b/jarvis/ui/web/frontend/src/lib/quickSwitch.ts@@ -79,7 +79,8 @@ const ALIASES: Partial<Record<string, readonly string[]>> = {appshots: ["screenshot", "capture"],"jarvis-actions": ["permissions", "allow", "block", "actions"],dictation: ["voice", "speech", "microphone", "mic", "whisper"],- "voice-shortcuts": ["hotkeys", "keybinds", "keyboard"],+ shortcuts: ["hotkeys", "keybinds", "keyboard", "quick switcher"],+ "voice-shortcuts": ["dictation hotkeys", "dictation keys"],"voice-language": ["recognition language"],"voice-api-keys": ["speech to text", "stt"],dictionary: ["vocabulary", "words"],diff --git a/jarvis/ui/web/frontend/src/store/events.ts b/jarvis/ui/web/frontend/src/store/events.tsindex 3814c848a1..169e02615a 100644--- a/jarvis/ui/web/frontend/src/store/events.ts+++ b/jarvis/ui/web/frontend/src/store/events.ts@@ -87,6 +87,10 @@ export type SectionId =// Appshots: the shortcut, destination, sound and flash for showing the// assistant the front window. A Settings-hub page.| "appshots"+ // Keyboard shortcuts: every shortcut in one place — the quick switcher,+ // Call / Hang up, the dictation keys (listed) and a key tester. A+ // Settings-hub page.+ | "shortcuts"// My Pets: the desktop pet — which one, its size, its bubble, and custom// pets from a sprite sheet (docs/pets.md). A Settings-hub page.| "pets"@@ -147,6 +151,7 @@ export const SECTION_IDS = ["feedback","agent-instructions","appshots",+ "shortcuts","pets","jarvis-actions","dictionary",@@ -243,6 +248,7 @@ export const SECTION_LABELS: Record<SectionId, string> = {feedback: "Feedback","agent-instructions": "Agent Instructions",appshots: "Appshots",+ shortcuts: "Keyboard shortcuts",pets: "My Pets","jarvis-actions": "Jarvis actions",dictionary: "Dictionary",diff --git a/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx b/jarvis/ui/web/frontend/src/views/SettingsHubView.tsxindex d3bb24f4e9..63e82f54bb 100644--- a/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx+++ b/jarvis/ui/web/frontend/src/views/SettingsHubView.tsx@@ -22,7 +22,8 @@ import { cn } from "@/lib/utils";* floats over the user's current section, with a searchable left navigation* (General · System · Activity) and the selected section on the right:*- * General: Settings, Appshots, My Pets, Profile, {name}.md, Contacts, Socials+ * General: Settings, Keyboard shortcuts, Appshots, My Pets, Profile,+ * {name}.md, Contacts, Socials* System: Computers, API Keys, Local models, Jarvis actions* Activity: Spend, Feedback*@@ -84,6 +85,9 @@ const JarvisActionsTab = lazy(() =>const AppshotsTab = lazy(() =>import("@/views/AppshotsView").then((m) => ({ default: m.AppshotsView })),);+const ShortcutsTab = lazy(() =>+ import("@/views/ShortcutsView").then((m) => ({ default: m.ShortcutsView })),+);const PetsTab = lazy(() =>import("@/views/PetsView").then((m) => ({ default: m.PetsView })),);@@ -99,6 +103,7 @@ const FeedbackTab = lazy(() =>/** The entries of the left navigation, in display order. */type HubNavId =| "settings"+ | "shortcuts"| "appshots"| "pets"| "profile"@@ -115,7 +120,16 @@ type HubNavId =const HUB_NAV_GROUPS: readonly { labelKey: string; ids: readonly HubNavId[] }[] = [{labelKey: "settings_hub.group_general",- ids: ["settings", "appshots", "pets", "profile", "agent-instructions", "contacts", "socials"],+ ids: [+ "settings",+ "shortcuts",+ "appshots",+ "pets",+ "profile",+ "agent-instructions",+ "contacts",+ "socials",+ ],},{labelKey: "settings_hub.group_system",@@ -138,6 +152,7 @@ const TAB_CONTENT: Record<HubNavId | "telephony-setup", LazyExoticComponent<Comp"local-models": LocalModelsTab,computers: ComputersTab,appshots: AppshotsTab,+ shortcuts: ShortcutsTab,pets: PetsTab,"jarvis-actions": JarvisActionsTab,costs: CostsTab,@@ -170,6 +185,8 @@ function resolveHubTab(active: string): { content: HubNavId | "telephony-setup";return { content: "computers", highlight: "computers" };case "appshots":return { content: "appshots", highlight: "appshots" };+ case "shortcuts":+ return { content: "shortcuts", highlight: "shortcuts" };case "pets":return { content: "pets", highlight: "pets" };case "jarvis-actions":diff --git a/jarvis/ui/web/frontend/src/views/SettingsView.tsx b/jarvis/ui/web/frontend/src/views/SettingsView.tsxindex 277812de19..329eb038ea 100644--- a/jarvis/ui/web/frontend/src/views/SettingsView.tsx+++ b/jarvis/ui/web/frontend/src/views/SettingsView.tsx@@ -2,7 +2,6 @@ import { useCallback, useEffect, useRef, useState } from "react";import {Settings,Mic,- Keyboard,Loader2,Languages,} from "lucide-react";@@ -28,9 +27,6 @@ import {useLocalSpeechInstall,type WakeWordSaveResult,} from "@/hooks/useWakeWord";-import { useKeybinds, type KeybindAction } from "@/hooks/useHotkey";-import { KeybindRow } from "@/views/settings/KeybindRow";-import { QuickSwitchKeybind } from "@/views/settings/QuickSwitchKeybind";import { deriveAssistantName } from "@/lib/deriveAssistantName";import { WAKE_ENGINES, WAKE_ENGINE_I18N_KEY } from "@/constants/wakeEngines";import { useEventStore } from "@/store/events";@@ -169,7 +165,6 @@ const SECTIONS: readonly { id: string; labelKey: string; render: () => React.Rea{ id: "volume", labelKey: "settings_view.nav.volume", render: () => <VolumeGroup /> },{ id: "audio-devices", labelKey: "settings_view.nav.audio_devices", render: () => <AudioDevicesGroup /> },{ id: "music", labelKey: "settings_view.nav.music", render: () => <MusicGroup /> },- { id: "keybinds", labelKey: "settings_view.nav.keybinds", render: () => <KeybindsPanel /> },{ id: "more", labelKey: "settings_view.nav.more", render: () => <MoreSettings /> },{ id: "overlay-taskbar", labelKey: "settings_view.nav.overlay_taskbar", render: () => <OverlayTaskbarGroup /> },];@@ -817,64 +812,8 @@ function WakeWordPanel() {);}-const _KEYBIND_ROWS: { action: KeybindAction; labelKey: string }[] = [- { action: "call", labelKey: "settings_view.keybinds.call_label" },- { action: "hangup", labelKey: "settings_view.keybinds.hangup_label" },-];--/**- * Editable Call and Hangup keybinds, one row each — the two keys that start- * and end a conversation. The user clicks Record and presses a combination, or- * resets to default, then saves. The backend validator is the authority — an- * unsafe combo or a collision with another action is rejected with a reason- * shown as a toast. A successful save surfaces a restart-required hint.- *- * NO dictation row lives here. Dictation is a different act — it never reaches- * the brain, it types into whatever window is in front, and it now has three- * shortcuts of its own (hold, hands-free, paste again). Those belong together- * on ONE surface, and that surface is the voice section's Shortcuts tab. This- * panel is deliberately NOT synced with it: the two answer different questions,- * and a row duplicated across both would let a user change the same key in two- * places and see two different truths.- *- * The row component itself is shared, so the recorder, the live validation and- * the collision check behave identically in both places — the collision check- * in particular still spans EVERY action, dictation included, because the- * backend keeps serving the whole set. Fewer rows here, never less data.+/*+ * The keybind rows moved to their own Settings-hub page ("Keyboard shortcuts",+ * views/ShortcutsView). Re-exported so existing imports keep resolving.*/-export function KeybindsPanel() {- const t = useT();- const { config, loading, error, saveKeybind } = useKeybinds();-- return (- <div className="rounded-lg border border-border bg-card p-block">- <div className="flex items-start gap-3">- <Keyboard className="mt-0.5 h-5 w-5 shrink-0 text-muted-foreground" />- <div className="min-w-0 flex-1">- <h4 className="text-title font-semibold text-foreground-strong">- {t("settings_view.keybinds.title")}- </h4>- <p className="mt-1 text-meta text-muted-foreground">- {t("settings_view.keybinds.description")}- </p>- {error && (- <p className="mt-stack text-meta text-destructive">{error}</p>- )}- <div className="mt-block space-y-stack">- {_KEYBIND_ROWS.map((row) => (- <KeybindRow- key={row.action}- action={row.action}- label={t(row.labelKey)}- config={config}- loading={loading}- onSave={saveKeybind}- />- ))}- </div>- <QuickSwitchKeybind voiceConfig={config} />- </div>- </div>- </div>- );-}+export { KeybindsPanel } from "@/views/settings/KeybindsPanel";diff --git a/jarvis/ui/web/frontend/src/views/ShortcutsView.test.tsx b/jarvis/ui/web/frontend/src/views/ShortcutsView.test.tsxnew file mode 100644index 0000000000..257caa2c0e--- /dev/null+++ b/jarvis/ui/web/frontend/src/views/ShortcutsView.test.tsx@@ -0,0 +1,94 @@+/**+ * The Keyboard shortcuts page: its four sections, and the key tester telling+ * what a pressed combination does — through the real matchers.+ */+import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";+import { act, cleanup, fireEvent, render, screen } from "@testing-library/react";+import { ShortcutsView } from "./ShortcutsView";+import { useEventStore } from "@/store/events";+import {+ QUICK_SWITCH_STORAGE_KEY,+ readQuickSwitchSettings,+ useQuickSwitchSettings,+} from "@/store/quickSwitchSettings";++const KEYBINDS = {+ keybinds: {+ call: "f3+f4",+ hangup: "f5",+ dictate: "ctrl+right_alt+j",+ dictate_toggle: "ctrl+right_alt+space",+ paste_last: "ctrl+alt+v",+ },+ defaults: {},+ suggestions: [],+ restart_required: false,+};++function press(init: KeyboardEventInit) {+ act(() => {+ window.dispatchEvent(new KeyboardEvent("keydown", { bubbles: true, ...init }));+ });+}++describe("ShortcutsView", () => {+ beforeEach(() => {+ window.localStorage.removeItem(QUICK_SWITCH_STORAGE_KEY);+ useQuickSwitchSettings.setState({ ...readQuickSwitchSettings(), combo: "ctrl+space" });+ vi.stubGlobal(+ "fetch",+ vi.fn(async () => new Response(JSON.stringify(KEYBINDS), { status: 200 })),+ );+ });+ afterEach(() => {+ cleanup();+ vi.unstubAllGlobals();+ });++ it("shows the four sections", async () => {+ render(<ShortcutsView />);+ for (const id of ["app", "calls", "dictation", "workspace"]) {+ expect(screen.getByTestId(`shortcuts-section-${id}`)).toBeTruthy();+ }+ expect(await screen.findAllByText("Ctrl")).toBeTruthy();+ });++ it("names what the quick switcher chord does", () => {+ render(<ShortcutsView />);+ press({ key: " ", code: "Space", ctrlKey: true });+ expect(screen.getByTestId("shortcut-tester-meaning").textContent).toContain("Quick switcher");+ });++ it("names a voice keybind and calls a free chord free", async () => {+ render(<ShortcutsView />);+ await screen.findByTestId("shortcuts-section-dictation");+ // Let the keybinds fetch settle before pressing.+ await act(async () => {});+ press({ key: "v", code: "KeyV", ctrlKey: true, altKey: true });+ expect(screen.getByTestId("shortcut-tester-meaning").textContent).toMatch(/paste/i);+ press({ key: "g", code: "KeyG", ctrlKey: true, shiftKey: true });+ expect(screen.getByTestId("shortcut-tester-meaning").textContent).toMatch(/free/i);+ });++ it("ignores plain typing in a field but still reads a chord there", () => {+ render(+ <>+ <input data-testid="field" />+ <ShortcutsView />+ </>,+ );+ const field = screen.getByTestId("field");+ const before = screen.getByTestId("shortcut-tester-meaning").textContent;+ fireEvent.keyDown(field, { key: "g", code: "KeyG" });+ expect(screen.getByTestId("shortcut-tester-meaning").textContent).toBe(before);+ // The hub opens with its search box focused; a chord must still register.+ fireEvent.keyDown(field, { key: "g", code: "KeyG", ctrlKey: true, shiftKey: true });+ expect(screen.getByTestId("shortcut-tester-meaning").textContent).toMatch(/free/i);+ });++ it("sends the dictation edit to the voice section", () => {+ render(<ShortcutsView />);+ fireEvent.click(screen.getByTestId("shortcuts-edit-dictation"));+ expect(useEventStore.getState().activeSection).toBe("voice-shortcuts");+ });+});diff --git a/jarvis/ui/web/frontend/src/views/ShortcutsView.tsx b/jarvis/ui/web/frontend/src/views/ShortcutsView.tsxnew file mode 100644index 0000000000..e4622189a5--- /dev/null+++ b/jarvis/ui/web/frontend/src/views/ShortcutsView.tsx@@ -0,0 +1,358 @@+/**+ * Keyboard shortcuts — a Settings-hub page of its own.+ *+ * Every shortcut Jarvis answers to, on one page: the ones edited here (the+ * quick switcher, Call and Hang up), the dictation keys that are edited in the+ * voice section and only listed here with a way there, and the fixed chords of+ * the workspace. On top sits a key tester: press anything and it shows the+ * keys big, plus what — if anything — they do in Jarvis. It answers "is this+ * combination free?" before someone records it.+ *+ * The tester resolves through the REAL matchers (the quick switcher's chord+ * matcher, the terminal zoom matcher, the voice keybind normalisation), never+ * through a copied list, so it cannot tell a different story than the app.+ */+import { useEffect, useMemo, useState, type ReactNode } from "react";+import { ArrowUpRight, AppWindow, Keyboard, Mic, Phone, Sparkles, SquareTerminal } from "lucide-react";+import { PageHeader } from "@/components/layout/PageHeader";+import { Button } from "@/components/ui/button";+import { useT } from "@/i18n";+import { useEventStore } from "@/store/events";+import { useQuickSwitchSettings } from "@/store/quickSwitchSettings";+import {+ eventToCombo,+ modifierTokens,+ normalizedComboTokens,+ useKeybinds,+ type KeybindAction,+ type KeybindsConfig,+} from "@/hooks/useHotkey";+import { detectKeyboardPlatform } from "@/views/settings/keyboardLayout";+import { ACTION_LABEL_KEY, ComboChips, formatCombo } from "@/views/settings/KeybindRow";+import { KeybindsPanel } from "@/views/settings/KeybindsPanel";+import { QuickSwitchKeybind } from "@/views/settings/QuickSwitchKeybind";+import { eventMatchesChord } from "@/lib/quickSwitchChord";+import { isTextEntryTarget } from "@/lib/shortcutOverlayTrigger";+import { keyLabel, shortcutsForArea, type FixedShortcut } from "@/lib/shortcutRegistry";+import { zoomIntentFor } from "@/components/agentic/terminalZoom";+import { cn } from "@/lib/utils";++const DICTATION_ACTIONS: readonly KeybindAction[] = ["dictate", "dictate_toggle", "paste_last"];++const ZOOM_LABEL = {+ in: "shortcut_overlay.workspace.zoom_in",+ out: "shortcut_overlay.workspace.zoom_out",+ reset: "shortcut_overlay.workspace.zoom_reset",+} as const;++// ── Keycaps ────────────────────────────────────────────────────────────────++/** One big keycap. Theme tokens only, so it reads in light and dark. */+function BigCap({ children, ghost = false }: { children: ReactNode; ghost?: boolean }) {+ return (+ <kbd+ className={cn(+ "inline-flex h-16 min-w-16 items-center justify-center rounded-xl border px-5",+ "font-sans text-2xl font-semibold tracking-tight",+ "shadow-[inset_0_-4px_0_hsl(var(--border)),0_1px_2px_rgb(var(--scrim-rgb)/0.12)]",+ ghost+ ? "border-dashed border-border text-muted-foreground/60"+ : "border-border bg-card text-foreground animate-in zoom-in-95 duration-150 motion-reduce:animate-none",+ )}+ >+ {children}+ </kbd>+ );+}++/** A small keycap for a fixed chord ("Mod" drawn as ⌘ or Ctrl). */+function SmallCaps({ keys, isMac }: { keys: string[]; isMac: boolean }) {+ return (+ <span className="inline-flex items-center gap-1">+ {keys.map((token, i) => (+ <span key={i} className="inline-flex items-center gap-1">+ {i > 0 && <span className="text-muted-foreground/50">+</span>}+ <kbd className="rounded border border-border bg-muted px-1.5 py-0.5 font-mono text-micro text-foreground shadow-[inset_0_-1px_0_rgba(0,0,0,0.35)]">+ {keyLabel(token, isMac)}+ </kbd>+ </span>+ ))}+ </span>+ );+}++// ── The key tester ──────────────────────────────────────────────────────────++interface Pressed {+ /** Bumped on every press so the caps re-run their press animation. */+ seq: number;+ caps: string[];+ /** The i18n key of what it does, "" when nothing uses it, null while only modifiers are held. */+ meaningKey: string | null;+}++function KeyTester({ config }: { config: KeybindsConfig | null }) {+ const t = useT();+ const isMac = detectKeyboardPlatform() === "mac";+ const quickSwitch = useQuickSwitchSettings();+ const [pressed, setPressed] = useState<Pressed | null>(null);++ useEffect(() => {+ let seq = 0;+ const onKeyDown = (event: KeyboardEvent) => {+ if (event.repeat) return;+ // Plain typing into a field is typing, not a test press. A chord with+ // Ctrl/Alt/⌘ still counts: the hub opens with its search box focused,+ // and the tester must work without a click away first.+ const chordHeld = event.ctrlKey || event.altKey || event.metaKey;+ if (!chordHeld && isTextEntryTarget(event.target)) return;+ // Recording a shortcut: the keys belong to the recorder.+ if (document.querySelector('[data-keybind-recording="true"]')) return;++ const combo = eventToCombo(event);+ const mods = modifierTokens(event);+ const printable = event.key.length === 1 && event.key !== " " ? event.key.toUpperCase() : null;+ const caps = combo+ ? formatCombo(combo).split(" + ")+ : [+ ...(mods.length ? formatCombo(mods.join("+")).split(" + ") : []),+ ...(printable && !["Control", "Alt", "Shift", "Meta"].includes(event.key) ? [printable] : []),+ ];+ if (caps.length === 0) return;++ let meaningKey: string | null = "";+ const zoom = zoomIntentFor(event, { isMac });+ if (quickSwitch.enabled && quickSwitch.combo && eventMatchesChord(event, quickSwitch.combo)) {+ meaningKey = "settings_view.quick_switch.title";+ } else if (zoom) {+ meaningKey = ZOOM_LABEL[zoom];+ } else if (event.key === "?" && !event.ctrlKey && !event.metaKey && !event.altKey) {+ meaningKey = "shortcut_overlay.workspace.open_overlay";+ } else if (combo) {+ const mine = [...normalizedComboTokens(combo)].sort().join("+");+ const hit = Object.entries(config?.keybinds ?? {}).find(+ ([, other]) => other && [...normalizedComboTokens(other)].sort().join("+") === mine,+ );+ if (hit) meaningKey = ACTION_LABEL_KEY[hit[0] as KeybindAction] ?? "";+ } else if (!printable) {+ meaningKey = null; // modifiers only — the chord is not finished yet+ }+ seq += 1;+ setPressed({ seq, caps, meaningKey });+ };+ window.addEventListener("keydown", onKeyDown);+ return () => window.removeEventListener("keydown", onKeyDown);+ }, [config, quickSwitch.enabled, quickSwitch.combo, isMac]);++ const ghost = quickSwitch.combo ? formatCombo(quickSwitch.combo).split(" + ") : ["Ctrl", "Space"];++ return (+ <section+ data-testid="shortcut-tester"+ className="relative overflow-hidden rounded-2xl border border-border bg-card px-6 py-8"+ >+ {/* A soft wash of the accent behind the caps — depth without a picture. */}+ <div+ aria-hidden+ className="pointer-events-none absolute inset-0"+ style={{+ background:+ "radial-gradient(60% 80% at 50% 0%, rgb(var(--accent-rgb) / 0.10), transparent 70%)",+ }}+ />+ <div className="relative flex flex-col items-center gap-5 text-center">+ <p className="text-sm font-medium uppercase tracking-wide text-muted-foreground">+ {t("shortcuts_view.tester_title")}+ </p>+ <div className="flex min-h-16 flex-wrap items-center justify-center gap-2.5" aria-live="polite">+ {(pressed?.caps ?? ghost).map((cap, i) => (+ <span key={`${pressed?.seq ?? "ghost"}-${i}`} className="inline-flex items-center gap-2.5">+ {i > 0 && <span className="text-xl text-muted-foreground/60">+</span>}+ <BigCap ghost={!pressed}>{cap}</BigCap>+ </span>+ ))}+ </div>+ <p+ data-testid="shortcut-tester-meaning"+ className={cn(+ "inline-flex min-h-8 items-center rounded-full px-4 text-sm font-medium",+ !pressed || pressed.meaningKey === null+ ? "text-muted-foreground"+ : pressed.meaningKey+ ? "bg-accent text-accent-foreground"+ : "bg-secondary text-foreground",+ )}+ >+ {!pressed+ ? t("shortcuts_view.tester_hint")+ : pressed.meaningKey === null+ ? t("shortcuts_view.tester_modifiers")+ : pressed.meaningKey+ ? t(pressed.meaningKey)+ : t("shortcuts_view.tester_free")}+ </p>+ </div>+ </section>+ );+}++// ── Sections ────────────────────────────────────────────────────────────────++function SectionCard({+ icon,+ title,+ hint,+ action,+ children,+ testId,+}: {+ icon: ReactNode;+ title: string;+ hint: string;+ action?: ReactNode;+ children: ReactNode;+ testId: string;+}) {+ return (+ <section data-testid={testId} className="flex flex-col rounded-xl border border-border bg-card">+ <header className="flex items-start gap-3 border-b border-border px-5 py-4">+ <span className="grid h-9 w-9 shrink-0 place-items-center rounded-lg bg-secondary text-foreground [&>svg]:h-[18px] [&>svg]:w-[18px]">+ {icon}+ </span>+ <div className="min-w-0 flex-1">+ <h2 className="text-base font-semibold text-foreground">{title}</h2>+ <p className="mt-0.5 text-sm text-muted-foreground">{hint}</p>+ </div>+ {action}+ </header>+ <div className="flex-1 px-5 py-4">{children}</div>+ </section>+ );+}++function ListRow({ label, chord }: { label: string; chord: ReactNode }) {+ return (+ <li className="flex items-center justify-between gap-4 py-2.5">+ <span className="min-w-0 text-sm text-foreground">{label}</span>+ <span className="flex shrink-0 flex-wrap items-center justify-end gap-1">{chord}</span>+ </li>+ );+}++function DictationList({ config }: { config: KeybindsConfig | null }) {+ const t = useT();+ return (+ <ul className="divide-y divide-border">+ {DICTATION_ACTIONS.map((action) => {+ const combo = config?.keybinds?.[action];+ return (+ <ListRow+ key={action}+ label={t(ACTION_LABEL_KEY[action])}+ chord={+ combo ? (+ <ComboChips combo={combo} />+ ) : (+ <span className="text-sm italic text-muted-foreground">+ {t("shortcut_overlay.unassigned")}+ </span>+ )+ }+ />+ );+ })}+ </ul>+ );+}++function WorkspaceList() {+ const t = useT();+ const isMac = detectKeyboardPlatform() === "mac";+ const rows = useMemo(+ () => shortcutsForArea("workspace").filter((s): s is FixedShortcut => s.kind === "fixed"),+ [],+ );+ return (+ <ul className="divide-y divide-border">+ {rows.map((row) => (+ <ListRow key={row.labelKey} label={t(row.labelKey)} chord={<SmallCaps keys={row.keys} isMac={isMac} />} />+ ))}+ </ul>+ );+}++export function ShortcutsView() {+ const t = useT();+ const setActiveSection = useEventStore((s) => s.setActiveSection);+ // One read of the voice keybinds for the tester, the list and the quick+ // switcher's duplicate check; a save anywhere refetches it.+ const { config } = useKeybinds();++ return (+ <div+ data-testid="shortcuts-view"+ className="flex h-full flex-col overflow-y-auto bg-background px-8 pb-10 scrollbar-jarvis"+ >+ <div className="w-full max-w-[1200px]">+ <PageHeader+ icon={<Keyboard />}+ title={t("shortcuts_view.title")}+ description={t("shortcuts_view.description")}+ />+ <div className="flex flex-col gap-6">+ <KeyTester config={config} />+ <div className="grid gap-6 xl:grid-cols-2">+ <SectionCard+ testId="shortcuts-section-app"+ icon={<Sparkles />}+ title={t("shortcuts_view.section_app")}+ hint={t("shortcuts_view.section_app_hint")}+ >+ <QuickSwitchKeybind voiceConfig={config} />+ </SectionCard>+ <SectionCard+ testId="shortcuts-section-calls"+ icon={<Phone />}+ title={t("shortcuts_view.section_calls")}+ hint={t("shortcuts_view.section_calls_hint")}+ >+ <KeybindsPanel bare />+ </SectionCard>+ <SectionCard+ testId="shortcuts-section-dictation"+ icon={<Mic />}+ title={t("shortcuts_view.section_dictation")}+ hint={t("shortcuts_view.section_dictation_hint")}+ action={+ <Button+ type="button"+ variant="ghost"+ size="sm"+ data-testid="shortcuts-edit-dictation"+ onClick={() => setActiveSection("voice-shortcuts")}+ >+ {t("shortcuts_view.edit_in_voice")}+ <ArrowUpRight aria-hidden />+ </Button>+ }+ >+ <DictationList config={config} />+ </SectionCard>+ <SectionCard+ testId="shortcuts-section-workspace"+ icon={<SquareTerminal />}+ title={t("shortcuts_view.section_workspace")}+ hint={t("shortcuts_view.section_workspace_hint")}+ >+ <WorkspaceList />+ </SectionCard>+ </div>+ <p className="flex items-center gap-2 text-sm text-muted-foreground">+ <AppWindow className="h-4 w-4 shrink-0" aria-hidden />+ {t("shortcuts_view.footer")}+ </p>+ </div>+ </div>+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/views/settings/KeybindsPanel.tsx b/jarvis/ui/web/frontend/src/views/settings/KeybindsPanel.tsxnew file mode 100644index 0000000000..a538a7e4c0--- /dev/null+++ b/jarvis/ui/web/frontend/src/views/settings/KeybindsPanel.tsx@@ -0,0 +1,75 @@+import { Keyboard } from "lucide-react";+import { useT } from "@/i18n";+import { useKeybinds, type KeybindAction } from "@/hooks/useHotkey";+import { KeybindRow } from "@/views/settings/KeybindRow";++const _KEYBIND_ROWS: { action: KeybindAction; labelKey: string }[] = [+ { action: "call", labelKey: "settings_view.keybinds.call_label" },+ { action: "hangup", labelKey: "settings_view.keybinds.hangup_label" },+];++/**+ * Editable Call and Hangup keybinds, one row each — the two keys that start+ * and end a conversation. The user clicks Record and presses a combination, or+ * resets to default, then saves. The backend validator is the authority — an+ * unsafe combo or a collision with another action is rejected with a reason+ * shown as a toast. A successful save surfaces a restart-required hint.+ *+ * NO dictation row lives here. Dictation is a different act — it never reaches+ * the brain, it types into whatever window is in front, and it now has three+ * shortcuts of its own (hold, hands-free, paste again). Those belong together+ * on ONE surface, and that surface is the voice section's Shortcuts tab. This+ * panel is deliberately NOT synced with it: the two answer different questions,+ * and a row duplicated across both would let a user change the same key in two+ * places and see two different truths. (The Keyboard shortcuts page LISTS the+ * dictation keys read-only and links to that tab — it never edits them.)+ *+ * The row component itself is shared, so the recorder, the live validation and+ * the collision check behave identically in both places — the collision check+ * in particular still spans EVERY action, dictation included, because the+ * backend keeps serving the whole set. Fewer rows here, never less data.+ *+ * `bare` drops the card, icon and heading, for a host that draws its own (the+ * Keyboard shortcuts page).+ */+export function KeybindsPanel({ bare = false }: { bare?: boolean } = {}) {+ const t = useT();+ const { config, loading, error, saveKeybind } = useKeybinds();++ const rows = (+ <>+ {error && <p className="text-meta text-destructive">{error}</p>}+ <div className="space-y-stack">+ {_KEYBIND_ROWS.map((row) => (+ <KeybindRow+ key={row.action}+ action={row.action}+ label={t(row.labelKey)}+ config={config}+ loading={loading}+ onSave={saveKeybind}+ />+ ))}+ </div>+ </>+ );++ if (bare) return rows;++ return (+ <div className="rounded-lg border border-border bg-card p-block">+ <div className="flex items-start gap-3">+ <Keyboard className="mt-0.5 h-5 w-5 shrink-0 text-muted-foreground" />+ <div className="min-w-0 flex-1">+ <h4 className="text-title font-semibold text-foreground-strong">+ {t("settings_view.keybinds.title")}+ </h4>+ <p className="mt-1 text-meta text-muted-foreground">+ {t("settings_view.keybinds.description")}+ </p>+ <div className="mt-block">{rows}</div>+ </div>+ </div>+ </div>+ );+}diff --git a/jarvis/ui/web/frontend/src/views/settings/QuickSwitchKeybind.tsx b/jarvis/ui/web/frontend/src/views/settings/QuickSwitchKeybind.tsxindex 1d4317a715..d6e5866d0e 100644--- a/jarvis/ui/web/frontend/src/views/settings/QuickSwitchKeybind.tsx+++ b/jarvis/ui/web/frontend/src/views/settings/QuickSwitchKeybind.tsx@@ -1,5 +1,5 @@/**- * Settings → Keyboard shortcuts: the quick switcher's on/off switch and chord.+ * The Keyboard shortcuts page: the quick switcher's on/off switch and chord.** The chord is edited with the SAME recorder the voice keybinds use, so* recording, the on-screen keyboard and the "already used by" marks behave@@ -13,7 +13,6 @@* overlap caution ("pressing the longer one triggers both") is true for global* hotkeys but false here, because the switcher fires on its exact chord only.*/-import { Search } from "lucide-react";import { Switch } from "@/components/ui/switch";import { useT } from "@/i18n";import type { KeybindAction, KeybindSaveResult, KeybindsConfig } from "@/hooks/useHotkey";@@ -75,43 +74,36 @@ export function QuickSwitchKeybind({ voiceConfig }: { voiceConfig: KeybindsConfi};return (- <div className="mt-block border-t border-border pt-block" data-testid="quick-switch-settings">- <div className="flex items-start gap-3">- <Search className="mt-0.5 h-5 w-5 shrink-0 text-muted-foreground" aria-hidden />- <div className="min-w-0 flex-1">- <div className="flex items-start justify-between gap-4">- <div className="min-w-0">- <h4 className="text-title font-semibold text-foreground-strong">{label}</h4>- <p className="mt-1 text-meta text-muted-foreground">- {t("settings_view.quick_switch.description")}- </p>- </div>- <Switch- checked={enabled}- onCheckedChange={setEnabled}- aria-label={label}- data-testid="quick-switch-enabled"- />- </div>- {enabled && (- <div className="mt-block space-y-stack">- <KeybindRow- action={ACTION}- label={t("settings_view.quick_switch.shortcut_label")}- config={config}- loading={false}- onSave={save}- actionLabel={(action) => (action === (ACTION as string) ? label : undefined)}- />- {mac && (- <p className="text-meta text-muted-foreground" data-testid="quick-switch-mac-note">- {t("settings_view.quick_switch.mac_note")}- </p>- )}- </div>- )}+ <div className="space-y-stack" data-testid="quick-switch-settings">+ <div className="flex items-start justify-between gap-4">+ <div className="min-w-0">+ <p className="text-base font-medium text-foreground">{label}</p>+ <p className="mt-0.5 text-sm text-muted-foreground">+ {t("settings_view.quick_switch.description")}+ </p></div>+ <Switch+ checked={enabled}+ onCheckedChange={setEnabled}+ aria-label={label}+ data-testid="quick-switch-enabled"+ /></div>+ {enabled && (+ <KeybindRow+ action={ACTION}+ label={t("settings_view.quick_switch.shortcut_label")}+ config={config}+ loading={false}+ onSave={save}+ actionLabel={(action) => (action === (ACTION as string) ? label : undefined)}+ />+ )}+ {enabled && mac && (+ <p className="text-sm text-muted-foreground" data-testid="quick-switch-mac-note">+ {t("settings_view.quick_switch.mac_note")}+ </p>+ )}</div>);}diff --git a/jarvis/ui/web/frontend/src/views/settings/SettingsResilience.test.tsx b/jarvis/ui/web/frontend/src/views/settings/SettingsResilience.test.tsxindex 451c094c9a..d126ed943d 100644--- a/jarvis/ui/web/frontend/src/views/settings/SettingsResilience.test.tsx+++ b/jarvis/ui/web/frontend/src/views/settings/SettingsResilience.test.tsx@@ -3,6 +3,7 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";import { afterEach, describe, expect, it, vi } from "vitest";import { SettingsView } from "@/views/SettingsView";import { KeybindRow } from "@/views/settings/KeybindRow";+import { ShortcutsView } from "@/views/ShortcutsView";import { SettingsGroupBoundary } from "@/views/settings/SettingsGroupBoundary";/**@@ -159,17 +160,38 @@ describe("SettingsView against an empty backend", () => {render(wrap(<SettingsView />));- // A locale row (identical in every language) proves the page is rendered,- // and the keybind field proves the row that used to kill it survived.+ // A locale row (identical in every language) proves the page is rendered.+ // The keybind rows moved to the Keyboard shortcuts page — tested below.await waitFor(() => {// One row per language section (interface / recognition / reply).expect(screen.getAllByText("Deutsch (German)").length).toBeGreaterThan(0);});- expect(screen.getByTestId("combo-field-call")).toBeTruthy();// A 640px form cap left the groups as a left-hand column in a sea of// black. The section fills the window; the page gutter sits on the row inside.const scroll = screen.getByTestId("settings-scroll");expect(scroll.className).not.toMatch(/max-w-form/);expect(scroll.firstElementChild?.className).toMatch(/px-8/);});++ it("renders the Keyboard shortcuts page when every route answers {}", async () => {+ vi.stubGlobal(+ "fetch",+ vi.fn(+ async () =>+ ({+ ok: true,+ status: 200,+ json: async () => ({}),+ text: async () => "{}",+ }) as unknown as Response,+ ),+ );+ vi.spyOn(console, "error").mockImplementation(() => {});++ render(wrap(<ShortcutsView />));++ // The keybind field proves the row that used to kill Settings survived.+ await waitFor(() => expect(screen.getByTestId("combo-field-call")).toBeTruthy());+ expect(screen.getByTestId("shortcut-tester")).toBeTruthy();+ });});diff --git a/jarvis/ui/web/frontend/src/views/settings/settingsSearch.ts b/jarvis/ui/web/frontend/src/views/settings/settingsSearch.tsindex 931055da00..5ad1478bea 100644--- a/jarvis/ui/web/frontend/src/views/settings/settingsSearch.ts+++ b/jarvis/ui/web/frontend/src/views/settings/settingsSearch.ts@@ -19,7 +19,6 @@ const SEARCH_GROUPS = [{ id: "volume", keys: ["volume"] },{ id: "audio-devices", keys: ["audio_devices"] },{ id: "music", keys: ["music", "music_group_title"] },- { id: "keybinds", keys: ["keybinds"] },{ id: "more", keys: ["rows", "team_proxy", "codex_title", "safety_title"] },{ id: "overlay-taskbar", keys: ["overlay_style", "bar_size", "overlay_taskbar_group_title"] },] as const;@@ -31,6 +30,7 @@ const SEARCH_PAGES = [{ id: "socials", keys: ["socials"] },{ id: "apikeys", keys: ["apikeys_view", "apikeys_voice", "apikeys_model", "apikeys_cu_model"] },{ id: "appshots", keys: ["appshots"] },+ { id: "shortcuts", keys: ["shortcuts_view", "settings_view.keybinds", "settings_view.quick_switch"] },{ id: "pets", keys: ["pets"] },{ id: "jarvis-actions", keys: ["jarvis_actions"] },{ id: "costs", keys: ["costs_view"] },