close sh;able to save/load projects
This commit is contained in:
@ -57,6 +57,15 @@ export default function TranscriptEditor() {
|
||||
const handleWordMouseDown = useCallback(
|
||||
(index: number, e: React.MouseEvent) => {
|
||||
e.preventDefault();
|
||||
// Ctrl+click → seek video to this word's start time
|
||||
if (e.ctrlKey) {
|
||||
const word = words[index];
|
||||
if (word) {
|
||||
const video = document.querySelector('video') as HTMLVideoElement | null;
|
||||
if (video) video.currentTime = word.start;
|
||||
}
|
||||
return;
|
||||
}
|
||||
wasDragging.current = false;
|
||||
if (e.shiftKey && selectedWordIndices.length > 0) {
|
||||
const first = selectedWordIndices[0];
|
||||
@ -70,7 +79,7 @@ export default function TranscriptEditor() {
|
||||
setSelectedWordIndices([index]);
|
||||
}
|
||||
},
|
||||
[selectedWordIndices, setSelectedWordIndices],
|
||||
[words, selectedWordIndices, setSelectedWordIndices],
|
||||
);
|
||||
|
||||
const handleWordMouseEnter = useCallback(
|
||||
@ -135,6 +144,7 @@ export default function TranscriptEditor() {
|
||||
key={globalIndex}
|
||||
id={`word-${globalIndex}`}
|
||||
data-word-index={globalIndex}
|
||||
title={`${word.start.toFixed(2)}s — Ctrl+click to seek`}
|
||||
onMouseDown={(e) => handleWordMouseDown(globalIndex, e)}
|
||||
onMouseEnter={() => handleWordMouseEnter(globalIndex)}
|
||||
onMouseLeave={() => setHoveredWordIndex(null)}
|
||||
|
||||
Reference in New Issue
Block a user