From 0fadf28b18e506ddca0027e83ebe567ac57932bf Mon Sep 17 00:00:00 2001 From: Brumaire Date: Sat, 11 Apr 2026 13:48:27 +0800 Subject: [PATCH] fix(preview): let arrow keys seek video instead of switching files (#5895) --- frontend/src/views/files/Preview.vue | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/frontend/src/views/files/Preview.vue b/frontend/src/views/files/Preview.vue index 0ac529ec..a1461695 100644 --- a/frontend/src/views/files/Preview.vue +++ b/frontend/src/views/files/Preview.vue @@ -383,11 +383,19 @@ const key = (event: KeyboardEvent) => { if (layoutStore.currentPrompt !== null) { return; } - if (event.which === 13 || event.which === 39) { + // When previewing a video, let arrow keys fall through to video.js for + // seeking instead of switching to the prev/next file. Enter still advances. + const isVideo = fileStore.req?.type === "video"; + if (event.which === 13) { + // enter + if (hasNext.value) next(); + } else if (event.which === 39) { // right arrow + if (isVideo) return; if (hasNext.value) next(); } else if (event.which === 37) { // left arrow + if (isVideo) return; if (hasPrevious.value) prev(); } else if (event.which === 27) { // esc