feat(map): geofence watch HUD — finish/cancel, inbox, fence DVR

Phone can finish a polygon without double-click. List is mute/go/rename/delete.
Inbox seeds from /api/geofence-alerts and appends WS hits. Watch all fence
ids on /ws/live. Selected-fence DVR uses GET /api/geofences/{id}/at.
This commit is contained in:
Sirius DevOps 2026-09-01 01:36:21 -04:00
commit 8c97ce50d2
2 changed files with 328 additions and 19 deletions

View file

@ -1,4 +1,4 @@
"""Geofence layer panel: draw + delete (DELETE /api/geofences/{id})."""
"""Geofence layer panel: draw, watch, inbox, delete (HTML contract)."""
from __future__ import annotations
@ -24,3 +24,33 @@ def test_load_geofences_renders_delete_controls():
assert "deleteGeofence" in js
assert "onEachFeature" in js
assert "bindPopup" in js
def test_finish_cancel_draw_controls():
assert 'id="gf-finish"' in HTML
assert 'id="gf-cancel"' in HTML
assert "function cancelGeofenceDraw" in HTML
assert "function onGfClose" in HTML
def test_watch_geofences_ws_payload():
assert "watch_geofences" in HTML
assert "function sendWatchGeofences" in HTML
def test_geofence_alert_inbox():
assert 'id="gf-inbox"' in HTML
assert "/api/geofence-alerts" in HTML
assert "function loadGfInbox" in HTML
assert "function pushGfInbox" in HTML
def test_delete_geofence_still_present():
assert "function deleteGeofence" in HTML
assert "method: 'DELETE'" in HTML or 'method: "DELETE"' in HTML
def test_fence_dvr_at_endpoint():
assert "/at?timestamp=" in HTML or "/at?timestamp=${" in HTML
assert "function dvrScrubFence" in HTML
assert "gfSelectedId" in HTML