From 009e1def3ed1ceb34913b06b7029501087e3cbd0 Mon Sep 17 00:00:00 2001 From: midzelis Date: Thu, 25 Sep 2025 14:26:23 +0000 Subject: [PATCH] feat: search results keyboard actions --- web/src/lib/actions/shortcut.ts | 7 + .../search/SearchKeyboardShortcuts.svelte | 237 ++++++++++++++++++ .../components/search/SearchResults.svelte | 2 + 3 files changed, 246 insertions(+) create mode 100644 web/src/lib/components/search/SearchKeyboardShortcuts.svelte diff --git a/web/src/lib/actions/shortcut.ts b/web/src/lib/actions/shortcut.ts index f7b3009403..0d89a69f65 100644 --- a/web/src/lib/actions/shortcut.ts +++ b/web/src/lib/actions/shortcut.ts @@ -1,5 +1,11 @@ import type { ActionReturn } from 'svelte/action'; +interface ExplainedShortcut { + key: string[]; + action: string; + info?: string; +} + export type Shortcut = { key: string; alt?: boolean; @@ -14,6 +20,7 @@ export type ShortcutOptions = { ignoreInputFields?: boolean; onShortcut: (event: KeyboardEvent & { currentTarget: T }) => unknown; preventDefault?: boolean; + explainedShortcut?: ExplainedShortcut; }; export const shortcutLabel = (shortcut: Shortcut) => { diff --git a/web/src/lib/components/search/SearchKeyboardShortcuts.svelte b/web/src/lib/components/search/SearchKeyboardShortcuts.svelte new file mode 100644 index 0000000000..6b813a222e --- /dev/null +++ b/web/src/lib/components/search/SearchKeyboardShortcuts.svelte @@ -0,0 +1,237 @@ + + + + +{#if isShowDeleteConfirmation} + (isShowDeleteConfirmation = false)} + onConfirm={() => handlePromiseError(trashOrDelete(true))} + /> +{/if} diff --git a/web/src/lib/components/search/SearchResults.svelte b/web/src/lib/components/search/SearchResults.svelte index 3a93d8ba2b..4e13cdf125 100644 --- a/web/src/lib/components/search/SearchResults.svelte +++ b/web/src/lib/components/search/SearchResults.svelte @@ -1,5 +1,6 @@