From a3c46e45fde1159ed7f9174281b9d76eb7bfde1c Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sat, 30 May 2026 23:08:40 -0500 Subject: [PATCH] improve motion search layout to match tracking details --- .../motion-search/MotionSearchDialog.tsx | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/web/src/views/motion-search/MotionSearchDialog.tsx b/web/src/views/motion-search/MotionSearchDialog.tsx index 5b622c1607..a2c0d06ec6 100644 --- a/web/src/views/motion-search/MotionSearchDialog.tsx +++ b/web/src/views/motion-search/MotionSearchDialog.tsx @@ -6,6 +6,7 @@ import { MdOutlineRestartAlt, MdUndo } from "react-icons/md"; import { FrigateConfig } from "@/types/frigateConfig"; import { TimeRange } from "@/types/timeline"; +import { ASPECT_PORTRAIT_LAYOUT, ASPECT_WIDE_LAYOUT } from "@/types/record"; import { Button } from "@/components/ui/button"; import { @@ -119,6 +120,27 @@ export default function MotionSearchDialog({ return config.cameras[selectedCamera]; }, [config, selectedCamera]); + const aspectRatio = useMemo(() => { + if (!cameraConfig) { + return 16 / 9; + } + + return cameraConfig.detect.width / cameraConfig.detect.height; + }, [cameraConfig]); + + // Determine camera aspect ratio category + const cameraAspect = useMemo(() => { + if (!aspectRatio) { + return "normal"; + } else if (aspectRatio > ASPECT_WIDE_LAYOUT) { + return "wide"; + } else if (aspectRatio < ASPECT_PORTRAIT_LAYOUT) { + return "tall"; + } else { + return "normal"; + } + }, [aspectRatio]); + const polygonClosed = useMemo( () => !isDrawingROI && polygonPoints.length >= 3, [isDrawingROI, polygonPoints.length], @@ -231,7 +253,15 @@ export default function MotionSearchDialog({ height: "100%", }} > -