From d9593091a5734ea7df50ec7def2d36d6fe81539d Mon Sep 17 00:00:00 2001 From: xRangerDE Date: Mon, 11 May 2026 05:18:37 +0200 Subject: [PATCH] feat: Ctrl+F also focuses archive search when on Archiv tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ctrl+F was wired to focus the VOD filter input — but only when the VODs tab was active. On the Archive tab (added in 4.6.15) Ctrl+F did nothing useful: the browser default find bar was suppressed (Electron renderer doesn't have one anyway) and the app handler didn't have a branch for the archive context. Now Ctrl+F also targets the archiveSearchQuery input when the Archive tab is the active tab. Other tabs (Clips / Cutter / Merge / Stats / Settings) let the shortcut fall through to no-op since they don't have a primary search/filter input. Same input-focus convention as the VODs tab: focus + select-all so the user can immediately type to replace or append. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/renderer.ts | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/renderer.ts b/src/renderer.ts index ea7c0dc..1121e69 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -236,14 +236,24 @@ async function init(): Promise { // Ctrl+F (or Cmd+F): focus the VOD filter — only when on the VODs tab. // Browser's default Ctrl+F is suppressed because Electron's renderer - // doesn't have a native find bar anyway. + // doesn't have a native find bar anyway. Route the shortcut to the + // active tab's search/filter input so the user lands in a useful + // place regardless of which tab they happen to be on. if ((e.ctrlKey || e.metaKey) && !e.altKey && !e.shiftKey && (e.key === 'f' || e.key === 'F')) { - const onVodsTab = document.getElementById('vodsTab')?.classList.contains('active'); - if (onVodsTab) { + if (document.getElementById('vodsTab')?.classList.contains('active')) { e.preventDefault(); focusVodFilter(); return; } + if (document.getElementById('archiveTab')?.classList.contains('active')) { + const archiveInput = document.getElementById('archiveSearchQuery') as HTMLInputElement | null; + if (archiveInput) { + e.preventDefault(); + archiveInput.focus(); + archiveInput.select(); + return; + } + } } // Skip rest if user is typing in an input field