diff --git a/web/src/components/timeline/MotionSegment.tsx b/web/src/components/timeline/MotionSegment.tsx index 4d70aaa66..4c09d6ac0 100644 --- a/web/src/components/timeline/MotionSegment.tsx +++ b/web/src/components/timeline/MotionSegment.tsx @@ -233,7 +233,9 @@ export function MotionSegment({ )} - {hasRecording && ( + {(hasRecording || + firstHalfSegmentWidth > 0 || + secondHalfSegmentWidth > 0) && (
diff --git a/web/src/components/timeline/ReviewTimeline.tsx b/web/src/components/timeline/ReviewTimeline.tsx index 6d1d3a0b5..2f0620ebc 100644 --- a/web/src/components/timeline/ReviewTimeline.tsx +++ b/web/src/components/timeline/ReviewTimeline.tsx @@ -402,7 +402,7 @@ export function ReviewTimeline({
{/* TODO: determine if we should keep this tooltip */} - {isHandlebarInNoRecordingPeriod && ( + {false && isHandlebarInNoRecordingPeriod && (
No recordings
diff --git a/web/src/views/recording/RecordingView.tsx b/web/src/views/recording/RecordingView.tsx index 500a82ab6..2d3600288 100644 --- a/web/src/views/recording/RecordingView.tsx +++ b/web/src/views/recording/RecordingView.tsx @@ -56,6 +56,7 @@ import { useFullscreen } from "@/hooks/use-fullscreen"; import { useTimezone } from "@/hooks/use-date-utils"; import { useTimelineZoom } from "@/hooks/use-timeline-zoom"; import { useTranslation } from "react-i18next"; +import { useTimelineUtils } from "@/hooks/use-timeline-utils"; import { Tooltip, TooltipContent, @@ -908,12 +909,20 @@ function Timeline({ }); // motion data + const { alignStartDateToTimeline, alignEndDateToTimeline } = useTimelineUtils( + { + segmentDuration: zoomSettings.segmentDuration, + }, + ); + + const alignedAfter = alignStartDateToTimeline(timeRange.after); + const alignedBefore = alignEndDateToTimeline(timeRange.before); const { data: motionData, isLoading } = useSWR([ "review/activity/motion", { - before: timeRange.before, - after: timeRange.after, + before: alignedBefore, + after: alignedAfter, scale: Math.round(zoomSettings.segmentDuration / 2), cameras: mainCamera, }, @@ -922,8 +931,8 @@ function Timeline({ const { data: noRecordings } = useSWR([ "recordings/unavailable", { - before: timeRange.before, - after: timeRange.after, + before: alignedBefore, + after: alignedAfter, scale: Math.round(zoomSettings.segmentDuration), cameras: mainCamera, },