From 52354d194aea4b5916e73ebea4df76bb48ae4aa6 Mon Sep 17 00:00:00 2001 From: Julian Cuni Date: Tue, 17 Nov 2026 15:57:35 +0100 Subject: [PATCH] =?UTF-8?q?feat(cameras):=20large=20view=20opens=20in=20th?= =?UTF-8?q?e=20tile's=20state=20(live=20tile=20=E2=86=92=20Live=20on=20the?= =?UTF-8?q?=20same=20stream,=20idle=20tile=20=E2=86=92=20Snapshot)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01RZgP5oMncSaVmKRKk1UvN4 --- apps/web/src/ui/CameraDock.tsx | 16 +++++++++------- wiki/decisions/camera-live-view.md | 13 ++++++++++--- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/apps/web/src/ui/CameraDock.tsx b/apps/web/src/ui/CameraDock.tsx index 418a828..2bbb768 100644 --- a/apps/web/src/ui/CameraDock.tsx +++ b/apps/web/src/ui/CameraDock.tsx @@ -12,10 +12,10 @@ import { createPlatformSocket } from "../lib/platform-ws.js"; // chips in the device footer; docked bottom-right, the first opened rightmost and each // next one to its left. A tile rests on the camera's newest entry/exit snapshot and // switches to live video while that camera is seeing a vehicle (the server's per-camera -// activity, pushed over /api/ws). Clicking the picture opens a large view that streams -// LIVE ON DEMAND (car or no car) with a Live / Snapshot switch; closing it returns the -// tile to automatic — a stream the user started stops, one the camera started carries -// on. Live frames come over their own socket as JPEG binaries; only the newest frame is +// activity, pushed over /api/ws). Clicking the picture opens a large view in the +// tile's state (live if the tile is live, else the snapshot), with a Live / Snapshot +// switch that streams LIVE ON DEMAND, car or no car; closing it returns the tile to +// automatic — a stream the user started stops, one the camera started carries on. Live frames come over their own socket as JPEG binaries; only the newest frame is // shown, and the tile and the large view share that one socket. Advisory viewing — // nothing here gates anything. @@ -75,7 +75,7 @@ function CameraTile({ const { t } = useTranslation(); /** The camera is reporting a vehicle (server-side activity, 30 s after its last push). */ const active = useLiveStore((s) => s.activeCameras[deviceId] === true); - /** Large view open, and what the user picked in it (opens on "live"). */ + /** Large view open, and what it shows (opens in the tile's state, then the user's pick). */ const [expanded, setExpanded] = useState(false); const [modalMode, setModalMode] = useState<"live" | "snapshot">("live"); // Modal open → the user's choice rules; closed → automatic (live while a vehicle is in view). @@ -120,11 +120,13 @@ function CameraTile({ ✕ - {/* The picture is the expand control: a click opens the large view, live. */} + {/* The picture is the expand control: the large view opens showing what the tile + shows. Seeded from `active`, not from "a frame has arrived", so a camera-started + stream that is still connecting is not torn down by the click. */}