From 301dfc185b04836bbcdbc8e1c000ede959c607cc Mon Sep 17 00:00:00 2001 From: ibs0d <53568938+ibs0d@users.noreply.github.com> Date: Wed, 18 Mar 2026 20:08:04 +1100 Subject: [PATCH] Revert "fix: motion dot outside zoom transform, fix activeMotion logic" --- web/src/hooks/use-camera-activity.ts | 4 +++- web/src/views/live/DraggableGridLayout.tsx | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/web/src/hooks/use-camera-activity.ts b/web/src/hooks/use-camera-activity.ts index 112812f2c..76a982725 100644 --- a/web/src/hooks/use-camera-activity.ts +++ b/web/src/hooks/use-camera-activity.ts @@ -176,7 +176,9 @@ export function useCameraActivity( enabled: isCameraEnabled, activeTracking: isCameraEnabled ? hasActiveObjects : false, activeMotion: isCameraEnabled - ? updatedCameraState?.motion === true || detectingMotion === "ON" + ? detectingMotion + ? detectingMotion === "ON" + : updatedCameraState?.motion === true : false, objects: isCameraEnabled ? (objects ?? []) : [], audio_detections: isCameraEnabled ? (audioDetections ?? []) : [], diff --git a/web/src/views/live/DraggableGridLayout.tsx b/web/src/views/live/DraggableGridLayout.tsx index e26c3071e..5d36ca1ba 100644 --- a/web/src/views/live/DraggableGridLayout.tsx +++ b/web/src/views/live/DraggableGridLayout.tsx @@ -32,8 +32,6 @@ import { PlayerStats } from "@/components/player/PlayerStats"; import { MdCircle } from "react-icons/md"; import { useCameraActivity } from "@/hooks/use-camera-activity"; import { Skeleton } from "@/components/ui/skeleton"; -import { MdCircle } from "react-icons/md"; -import { useCameraActivity } from "@/hooks/use-camera-activity"; import { isEqual } from "lodash"; import useSWR from "swr"; @@ -1083,8 +1081,9 @@ const BirdseyeLivePlayerGridItem = React.forwardRef< }, ); -// Separate component so useCameraActivity can be called as a hook (no hooks in loops). -// Rendered outside the zoom transform div so it doesn't scale with the camera zoom. +// Separate component so it can call useCameraActivity as a hook (no hooks in loops). +// Direct WS subscription guarantees the dot reacts to motion changes in real-time +// without relying on an intermediate callback → parent-state chain. function CameraMotionDot({ camera, autoLive, @@ -1096,7 +1095,7 @@ function CameraMotionDot({ if (autoLive === false || offline || !activeMotion) return null; return (
- +
); }