fix: j/k only navigates sidebar when video selected, add publish_date to detail view

This commit is contained in:
Gan, Jimmy
2026-07-09 10:43:05 +08:00
parent 575fdabbc0
commit 271ad96612
5 changed files with 307 additions and 1 deletions
+4 -1
View File
@@ -305,7 +305,9 @@
function handleKeydown(e) {
if (!videos.length) return;
if (e.target.tagName === 'TEXTAREA' || e.target.tagName === 'INPUT') return;
const idx = filteredVideos.findIndex(v => v.video_id === selectedVideo?.video_id);
// If no video selected, let keyboard scroll the page naturally
if (!selectedVideo) return;
const idx = filteredVideos.findIndex(v => v.video_id === selectedVideo.video_id);
let nextIdx = idx;
if (e.key === 'j' || e.key === 'ArrowDown') {
e.preventDefault();
@@ -606,6 +608,7 @@
onclick={() => { channelFilter = selectedVideo.channel_name; }}
title="Filter by this channel">{selectedVideo.channel_name}</span>
<h1 class="text-lg font-bold leading-snug" style="color:var(--text-primary)">{selectedVideo.title}</h1>
<div class="text-[10px]" style="color:var(--text-muted)">{selectedVideo.publish_date || ''}</div>
<div class="flex space-x-2">
<button onclick={() => updateStatus(selectedVideo.video_id, 'read')} class="text-[10px] px-2.5 py-1 text-white font-bold rounded transition" style="background:var(--accent)">Read (r)</button>
<button onclick={() => updateStatus(selectedVideo.video_id, 'skipped')} class="text-[10px] px-2.5 py-1 font-bold rounded border transition" style="color:var(--text-secondary);border-color:var(--border)">Skip (s)</button>