diff --git a/.changeset/customizable-toggle-window-shortcut.md b/.changeset/customizable-toggle-window-shortcut.md new file mode 100644 index 000000000..9dbacc875 --- /dev/null +++ b/.changeset/customizable-toggle-window-shortcut.md @@ -0,0 +1,5 @@ +--- +default: minor +--- + +Add a customizable Global shortcut to show or hide the app window diff --git a/src/app/features/settings/keyboard-shortcuts/KeyboardShortcuts.test.tsx b/src/app/features/settings/keyboard-shortcuts/KeyboardShortcuts.test.tsx index df44e8400..6f021a834 100644 --- a/src/app/features/settings/keyboard-shortcuts/KeyboardShortcuts.test.tsx +++ b/src/app/features/settings/keyboard-shortcuts/KeyboardShortcuts.test.tsx @@ -7,13 +7,14 @@ import { defaultSettings, settingsAtom } from '$state/settings'; import type * as PlatformUtils from '$utils/platform'; import { KeyboardShortcuts } from './KeyboardShortcuts'; -const { mockGetDesktopRuntimeState, mockIsDesktopTauri, mockSetToggleWindowShortcut } = - vi.hoisted(() => ({ +const { mockGetDesktopRuntimeState, mockIsDesktopTauri, mockSetToggleWindowShortcut } = vi.hoisted( + () => ({ mockGetDesktopRuntimeState: vi.fn<() => Promise>(), mockIsDesktopTauri: vi.fn<() => boolean>(() => true), - mockSetToggleWindowShortcut: vi - .fn<(params: { binding: string | null }) => Promise>(), - })); + mockSetToggleWindowShortcut: + vi.fn<(params: { binding: string | null }) => Promise>(), + }) +); vi.mock('$generated/tauri/commands', () => ({ getDesktopRuntimeState: mockGetDesktopRuntimeState, diff --git a/src/app/features/settings/keyboard-shortcuts/KeyboardShortcuts.tsx b/src/app/features/settings/keyboard-shortcuts/KeyboardShortcuts.tsx index 053273d6e..3d5f16bba 100644 --- a/src/app/features/settings/keyboard-shortcuts/KeyboardShortcuts.tsx +++ b/src/app/features/settings/keyboard-shortcuts/KeyboardShortcuts.tsx @@ -17,7 +17,11 @@ import { getShortcutBinding, isDesktopOnlyShortcut, } from '../../../keyboard/shortcuts'; -import type { ShortcutDefinition, ShortcutId, ShortcutOverrides } from '../../../keyboard/shortcuts'; +import type { + ShortcutDefinition, + ShortcutId, + ShortcutOverrides, +} from '../../../keyboard/shortcuts'; function ShortcutKeys({ binding }: { binding: string | null }) { const label = formatShortcut(binding); @@ -226,8 +230,8 @@ export function KeyboardShortcuts({ requestBack, requestClose }: KeyboardShortcu - Choose Change, then press a new key combination. App-wide shortcuts do not run - while typing unless the action specifically supports it. + Choose Change, then press a new key combination. App-wide shortcuts do not run while + typing unless the action specifically supports it. {CATEGORIES.map((category) => (