diff --git a/frontend/src/lib/document/transcription/ShortcutCheatsheet.svelte b/frontend/src/lib/document/transcription/ShortcutCheatsheet.svelte index 3d1a7445..a68a16b1 100644 --- a/frontend/src/lib/document/transcription/ShortcutCheatsheet.svelte +++ b/frontend/src/lib/document/transcription/ShortcutCheatsheet.svelte @@ -57,7 +57,7 @@ function handleBackdropClick(event: MouseEvent) { type="button" onclick={onClose} aria-label={m.cheatsheet_close()} - class="flex h-11 w-11 items-center justify-center rounded-sm text-ink-2 hover:bg-muted" + class="flex h-11 w-11 items-center justify-center rounded-sm text-ink-2 hover:bg-muted focus-visible:ring-2 focus-visible:ring-brand-mint focus-visible:outline-none" >
{shortcut.cap} {shortcut.label} diff --git a/frontend/src/lib/shared/actions/transcribeShortcuts.ts b/frontend/src/lib/shared/actions/transcribeShortcuts.ts index 90806daf..ec333825 100644 --- a/frontend/src/lib/shared/actions/transcribeShortcuts.ts +++ b/frontend/src/lib/shared/actions/transcribeShortcuts.ts @@ -27,6 +27,10 @@ function isEditableTarget(target: EventTarget | null): boolean { return tag === 'INPUT' || tag === 'TEXTAREA' || target.isContentEditable; } +// `node` is unused: the listener is global (window) so a shortcut fires no +// matter where focus sits on the page. It is still authored as a Svelte action +// (`use:transcribeShortcuts`) so its lifecycle is tied to the host element's +// mount/unmount and `destroy()` reliably removes the listener. export function transcribeShortcuts(_node: HTMLElement, initial: TranscribeShortcutOptions) { let options = initial; diff --git a/frontend/src/routes/documents/[id]/+page.svelte b/frontend/src/routes/documents/[id]/+page.svelte index 4b5b0eb0..9d91378e 100644 --- a/frontend/src/routes/documents/[id]/+page.svelte +++ b/frontend/src/routes/documents/[id]/+page.svelte @@ -422,7 +422,7 @@ onMount(() => { {/if}
- {#if drawArmed && panelMode === 'edit'} + {#if drawArmed}