feat: Ctrl+F also focuses archive search when on Archiv tab

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) <noreply@anthropic.com>
This commit is contained in:
xRangerDE 2026-05-11 05:18:37 +02:00
parent 00e19ccf67
commit d9593091a5

View File

@ -236,14 +236,24 @@ async function init(): Promise<void> {
// Ctrl+F (or Cmd+F): focus the VOD filter — only when on the VODs tab. // 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 // 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')) { if ((e.ctrlKey || e.metaKey) && !e.altKey && !e.shiftKey && (e.key === 'f' || e.key === 'F')) {
const onVodsTab = document.getElementById('vodsTab')?.classList.contains('active'); if (document.getElementById('vodsTab')?.classList.contains('active')) {
if (onVodsTab) {
e.preventDefault(); e.preventDefault();
focusVodFilter(); focusVodFilter();
return; 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 // Skip rest if user is typing in an input field