diff --git a/frontend/src/components/VideoEditor.tsx b/frontend/src/components/VideoEditor.tsx index 91726d4..f77ab51 100644 --- a/frontend/src/components/VideoEditor.tsx +++ b/frontend/src/components/VideoEditor.tsx @@ -221,6 +221,19 @@ export default function VideoEditor({ job, onClose }: { job: DownloadJob; onClos }; const stripCells = strip && trackW ? Math.max(1, Math.floor(trackW / (44 * aspect))) : 0; const hoverTime = hoverX != null ? timeAt(hoverX) : null; + // Clamp the hover-scrub popover inside the track so it never overflows the modal (which would + // add a horizontal scrollbar): center it on the cursor, but keep both edges within [0, trackW]. + const HOVER_W = 148; + const hoverLeft = + hoverX != null + ? Math.max( + 0, + Math.min( + Math.max(0, (trackW || HOVER_W) - HOVER_W), + hoverX - (trackRef.current?.getBoundingClientRect().left ?? 0) - HOVER_W / 2 + ) + ) + : 0; // --- create --- const kept = segments.filter((s) => s.keep); @@ -416,10 +429,10 @@ export default function VideoEditor({ job, onClose }: { job: DownloadJob; onClos {/* hover-scrub thumbnail */} {strip && hoverTime != null && (