feat(cameras): ‹ › through older/newer snapshots in the large view

On the Snapshot side the large view steps through that camera's snapshots (‹ older,
› newer, also ← →), muted at either end; the caption carries the date and always names
the picture on screen (the previous one stays while the next loads; a pruned still says
"unavailable"). The tile stays on the newest; closing resets. New read-only route
GET /api/cameras/:deviceId/snapshots/:snapshotId/neighbors (session:read), ordered by
(capturedAt, id) like latest-snapshot, bounded to seek the device/time index.

Also carries the user's own label edits in en.ts / sq.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01RZgP5oMncSaVmKRKk1UvN4
This commit is contained in:
2026-11-17 17:31:58 +01:00
parent bccef3875b
commit cb43ad78ca
8 changed files with 267 additions and 43 deletions
+8
View File
@@ -180,6 +180,14 @@ export async function fetchLatestCameraSnapshot(deviceId: string): Promise<Camer
}
}
/** The next older / newer snapshot of the same camera (the large view's ‹ ›). */
export function fetchCameraSnapshotNeighbors(
deviceId: string,
snapshotId: string,
): Promise<{ older: CameraSnapshotMeta | null; newer: CameraSnapshotMeta | null }> {
return apiFetch(`/api/cameras/${encodeURIComponent(deviceId)}/snapshots/${encodeURIComponent(snapshotId)}/neighbors`);
}
/** Snapshot bytes as an object URL. Fetched (not an <img src>) so it works in the
* desktop shell too, whose webview does not carry the session cookie. The caller
* revokes the URL. */