Skip to content

Commit ef28dbe

Browse files
ozgesolidkeyclaude
andcommitted
Allow video sync from any playback position, not just 0:00
"Set from line" now maps the selected log line to the current video time instead of always assuming video start. This lets users pause at any point, click the matching log line, and sync directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 29718aa commit ef28dbe

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/renderer/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,8 +416,8 @@ <h2>LOGAN</h2>
416416
</div>
417417
<div class="video-sync-bar">
418418
<label class="video-sync-label">Sync:</label>
419-
<input type="text" id="video-sync-input" class="video-sync-input" placeholder="Timestamp at video 0:00" title="Enter the log timestamp that corresponds to video start (0:00)">
420-
<button id="btn-video-sync-from-line" class="video-sync-btn" title="Use selected line's timestamp">Set from line</button>
419+
<input type="text" id="video-sync-input" class="video-sync-input" placeholder="Log timestamp at video start" title="Enter the log timestamp that corresponds to video start (0:00)">
420+
<button id="btn-video-sync-from-line" class="video-sync-btn" title="Sync selected line to current video time">Set from line</button>
421421
<span id="video-sync-status" class="video-sync-status"></span>
422422
</div>
423423
</div>

src/renderer/renderer.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4756,14 +4756,22 @@ function setVideoSyncFromCurrentLine(): void {
47564756
setTimeout(() => { elements.videoSyncStatus.textContent = ''; }, 3000);
47574757
return;
47584758
}
4759-
state.videoSyncOffsetMs = result.epochMs;
4759+
const currentVideoTimeMs = (elements.videoElement.currentTime || 0) * 1000;
4760+
state.videoSyncOffsetMs = result.epochMs - currentVideoTimeMs;
47604761
elements.videoSyncInput.value = result.timestampStr || '';
4761-
elements.videoSyncStatus.textContent = 'Sync set from line ' + (state.selectedLine! + 1);
4762+
const videoTimeStr = formatVideoTime(elements.videoElement.currentTime || 0);
4763+
elements.videoSyncStatus.textContent = 'Sync set: line ' + (state.selectedLine! + 1) + ' → ' + videoTimeStr;
47624764
setTimeout(() => { elements.videoSyncStatus.textContent = ''; }, 3000);
47634765
saveVideoState();
47644766
});
47654767
}
47664768

4769+
function formatVideoTime(seconds: number): string {
4770+
const mins = Math.floor(seconds / 60);
4771+
const secs = Math.floor(seconds % 60);
4772+
return mins + ':' + String(secs).padStart(2, '0');
4773+
}
4774+
47674775
function saveVideoState(): void {
47684776
// Save to LocalFileData via the existing persistence mechanism
47694777
if (!state.filePath) return;

0 commit comments

Comments
 (0)