This commit is contained in:
Josh Hawkins 2025-10-28 22:29:54 -05:00
parent 160e7b15a0
commit a627a79f47
3 changed files with 15 additions and 10 deletions

View File

@ -120,16 +120,16 @@ export function MotionSegment({
return showMinimap && segmentTime === alignedMinimapEndTime; return showMinimap && segmentTime === alignedMinimapEndTime;
}, [showMinimap, segmentTime, alignedMinimapEndTime]); }, [showMinimap, segmentTime, alignedMinimapEndTime]);
// Top border: current segment has no recording, but previous segment has recordings // Bottom border: current segment HAS recording, but next segment (below/earlier) has NO recording
const isFirstSegmentWithoutRecording = useMemo(() => { const isFirstSegmentWithoutRecording = useMemo(() => {
return hasRecording === false && prevIsNoRecording === false; return hasRecording === true && nextIsNoRecording === true;
}, [hasRecording, prevIsNoRecording]);
// Bottom border: current segment has no recording, but next segment has recordings
const isLastSegmentWithoutRecording = useMemo(() => {
return hasRecording === false && nextIsNoRecording === false;
}, [hasRecording, nextIsNoRecording]); }, [hasRecording, nextIsNoRecording]);
// Top border: current segment HAS recording, but prev segment (above/later) has NO recording
const isLastSegmentWithoutRecording = useMemo(() => {
return hasRecording === true && prevIsNoRecording === true;
}, [hasRecording, prevIsNoRecording]);
const firstMinimapSegmentRef = useRef<HTMLDivElement>(null); const firstMinimapSegmentRef = useRef<HTMLDivElement>(null);
useEffect(() => { useEffect(() => {
@ -198,10 +198,10 @@ export function MotionSegment({
onTouchEnd={(event) => handleTouchStart(event, segmentClick)} onTouchEnd={(event) => handleTouchStart(event, segmentClick)}
> >
{isFirstSegmentWithoutRecording && ( {isFirstSegmentWithoutRecording && (
<div className="absolute -top-[1px] left-0 right-0 h-[1px] bg-primary-variant/50" /> <div className="absolute bottom-[0px] left-0 right-0 h-[1px] bg-primary-variant/50" />
)} )}
{isLastSegmentWithoutRecording && ( {isLastSegmentWithoutRecording && (
<div className="absolute bottom-[0px] left-0 right-0 h-[1px] bg-primary-variant/50" /> <div className="absolute -top-[1px] left-0 right-0 h-[1px] bg-primary-variant/50" />
)} )}
{!motionOnly && ( {!motionOnly && (
<> <>

View File

@ -158,12 +158,17 @@ export const VirtualizedMotionSegments = forwardRef<
const hasRecording = getRecordingAvailability(segmentTime); const hasRecording = getRecordingAvailability(segmentTime);
// Check if previous and next segments have recordings
// This is important because in motionOnly mode, the segments array is filtered
const prevSegmentTime = segmentTime + segmentDuration; const prevSegmentTime = segmentTime + segmentDuration;
const nextSegmentTime = segmentTime - segmentDuration; const nextSegmentTime = segmentTime - segmentDuration;
const prevHasRecording = getRecordingAvailability(prevSegmentTime); const prevHasRecording = getRecordingAvailability(prevSegmentTime);
const nextHasRecording = getRecordingAvailability(nextSegmentTime); const nextHasRecording = getRecordingAvailability(nextSegmentTime);
// Check if prev/next segments have no recording available
// Note: We only check hasRecording, not motion values, because segments can have
// recordings available but no motion (eg, start of a recording before motion begins)
const prevIsNoRecording = prevHasRecording === false; const prevIsNoRecording = prevHasRecording === false;
const nextIsNoRecording = nextHasRecording === false; const nextIsNoRecording = nextHasRecording === false;

View File

@ -924,7 +924,7 @@ function Timeline({
{ {
before: timeRange.before, before: timeRange.before,
after: timeRange.after, after: timeRange.after,
scale: Math.round(zoomSettings.segmentDuration / 2), scale: Math.round(zoomSettings.segmentDuration),
cameras: mainCamera, cameras: mainCamera,
}, },
]); ]);