feat(map): dense per-article blip layer from /api/news/blips (T2 frontend) #65

Merged
sirius merged 1 commit from wt/t_305683a2 into master 2026-11-20 03:53:28 +00:00
Owner

Kanban T2 (t_305683a2). Additive Article Blips layer on the HUD map — app/static/index.html only (+132/−1). Critical-news pins and /api/news/map consumption are byte-unchanged.

What ships

  • New legend toggle Article Blips (default OFF) + count, ARTICLES HUD chip, syncHud wiring.
  • Fetches GET /api/news/blips?bbox=${currentBBox()}&limit=1000 — the frozen T1 wire contract, exact keys only. Own articlesReq superseded-counter + overlayFetch/overlayAbort handling; refresh on pan/zoom (existing 500ms moveend debounce) and on a NEWS_REFRESH_MS (3-min) timer while enabled.
  • Radius-3 quiet-violet (#a06cd5) L.circleMarker field in a vendored L.markerClusterGroup (maxClusterRadius: 40, chunkedLoading, bulk addLayers), custom violet cluster icons sized sm/md/lg. Distinct from the cyan critical pins.
  • Click → .blip-pop popup: headline, domain · category, time-ago · location_name (confidence) · score, source ↗ link (target=_blank rel=noopener). esc() on every field; defensive dedup by id + finite-lat/lon filter.
  • Graceful failure: non-OK (e.g. 404 before T1+T3 deploy) or network error → console.warn + idle at 0; map and critical pins unaffected. Toggle-off clears timer, layer, and renderer.

Two fixes found during browser verification

  1. .leaflet-heatmap-layer { pointer-events: none; } — the FIRMS heat canvas is visual-only (no listeners) but is appended last to the overlay pane with pointer-events: auto, eating every click meant for vector overlays below. This blocked blip clicks and (pre-existing) critical-pin clicks whenever fires were on. One CSS line; rendering unchanged.
  2. One persistent L.svg({padding:0.5}) renderer for the blip field instead of a fresh renderer per refresh (which leaks a full-viewport container per pan/zoom — ~19 MB each at retina). SVG paths are individually clickable and the pointer-events:none root lets clicks fall through to the canvas pins below (Leaflet stacks svg z200 over canvas z100) — so both layers stay clickable simultaneously, in either toggle order.

Premise corrections (measured at 5ea43a3)

  • index.html is 4673 lines, not ~3576.
  • Critical pins are cyan #35e0ff circleMarkers (radius 6), not magenta diamonds — the magenta diamond is the NEWS HUD chip. Violet blips remain clearly distinct.
  • The existing newsInterval only starts after the News view is opened, so the blip layer keeps its own timer at the same NEWS_REFRESH_MS cadence (works even if News is never opened).
  • Pre-existing bug left untouched (out of lane): loadNewsPins() calls pointCanvas() inside the per-pin map callback — one full-viewport canvas per pin, leaking ~5 canvases per refresh; only the topmost pin's canvas receives clicks. Follow-up card filed.

Verification (local mock of the frozen contract, real browser, 1440×900)

Mock: 1398-row fixture (16 city hotspots + world scatter + XSS/null/duplicate edge rows), exact contract keys, created_at DESC, bbox/limit/422 behavior, switchable ok/404/slow/empty modes; real GIBS Blue Marble basemap.

  • ✅ Default OFF; toggle on → 1000 markers render in 0.25s, 42 violet clusters at world view; count 1,000 + HUD chip update.
  • ✅ Real coordinate clicks open popups: XSS headline rendered as literal text (0 injected nodes, window.__pwned undefined), link href preserved incl. &b=<2>, target=_blank rel=noopener; all-null-fields row shows ARTICLE / no location label, no link/score.
  • ✅ Critical pins independent: 5 cyan pins, count 5, pin popup opens with blips layer on (Kherson pin verified).
  • ✅ Pan/zoom refetches with correct bbox (Paris/Sydney/Kyiv/NYC/LA queries logged); counts viewport-scoped (81/56/63/24/57).
  • ✅ Superseded guard: slow-mode pan A→B aborts A, only B renders (57 == exact-bbox fixture count).
  • ✅ 404 mode: warn + count 0 + HUD 0, map and critical pins unaffected; recovers when endpoint returns.
  • ✅ Toggle off: group/renderer/timer null, SVG root removed, chip dimmed; re-enable works.
  • ✅ No container leak: 1 SVG root across 10+ refreshes; world DOM = 24 paths + 20 cluster icons for 1000 markers.
  • ✅ Instant-pan → refetch → clustered render settles in 0.92s wall (incl. 500ms debounce).
  • ✅ Zero console errors across the whole session (only the intentional 404 warn).

Evidence screenshots attached to the kanban card. Live deploy + end-to-end proof is T3 (t_bcadd420, devops). Merge-on-green per card; CI runs on master after merge.

Kanban T2 (t_305683a2). Additive **Article Blips** layer on the HUD map — `app/static/index.html` only (+132/−1). Critical-news pins and `/api/news/map` consumption are byte-unchanged. ## What ships - New legend toggle **Article Blips** (default OFF) + count, **ARTICLES** HUD chip, `syncHud` wiring. - Fetches `GET /api/news/blips?bbox=${currentBBox()}&limit=1000` — the frozen T1 wire contract, exact keys only. Own `articlesReq` superseded-counter + `overlayFetch`/`overlayAbort` handling; refresh on pan/zoom (existing 500ms moveend debounce) and on a `NEWS_REFRESH_MS` (3-min) timer while enabled. - Radius-3 quiet-violet (`#a06cd5`) `L.circleMarker` field in a vendored `L.markerClusterGroup` (`maxClusterRadius: 40`, `chunkedLoading`, bulk `addLayers`), custom violet cluster icons sized sm/md/lg. Distinct from the cyan critical pins. - Click → `.blip-pop` popup: headline, domain · category, time-ago · location_name (confidence) · score, `source ↗` link (`target=_blank rel=noopener`). `esc()` on every field; defensive dedup by id + finite-lat/lon filter. - Graceful failure: non-OK (e.g. 404 before T1+T3 deploy) or network error → `console.warn` + idle at 0; map and critical pins unaffected. Toggle-off clears timer, layer, and renderer. ## Two fixes found during browser verification 1. **`.leaflet-heatmap-layer { pointer-events: none; }`** — the FIRMS heat canvas is visual-only (no listeners) but is appended last to the overlay pane with `pointer-events: auto`, eating every click meant for vector overlays below. This blocked blip clicks and (pre-existing) critical-pin clicks whenever fires were on. One CSS line; rendering unchanged. 2. **One persistent `L.svg({padding:0.5})` renderer** for the blip field instead of a fresh renderer per refresh (which leaks a full-viewport container per pan/zoom — ~19 MB each at retina). SVG paths are individually clickable and the `pointer-events:none` root lets clicks fall through to the canvas pins below (Leaflet stacks svg z200 over canvas z100) — so **both layers stay clickable simultaneously**, in either toggle order. ## Premise corrections (measured at 5ea43a3) - `index.html` is 4673 lines, not ~3576. - Critical pins are **cyan `#35e0ff` circleMarkers (radius 6)**, not magenta diamonds — the magenta diamond is the NEWS HUD chip. Violet blips remain clearly distinct. - The existing `newsInterval` only starts after the News view is opened, so the blip layer keeps its own timer at the same `NEWS_REFRESH_MS` cadence (works even if News is never opened). - **Pre-existing bug left untouched (out of lane):** `loadNewsPins()` calls `pointCanvas()` *inside the per-pin map callback* — one full-viewport canvas per pin, leaking ~5 canvases per refresh; only the topmost pin's canvas receives clicks. Follow-up card filed. ## Verification (local mock of the frozen contract, real browser, 1440×900) Mock: 1398-row fixture (16 city hotspots + world scatter + XSS/null/duplicate edge rows), exact contract keys, created_at DESC, bbox/limit/422 behavior, switchable ok/404/slow/empty modes; real GIBS Blue Marble basemap. - ✅ Default OFF; toggle on → 1000 markers render in **0.25s**, 42 violet clusters at world view; count `1,000` + HUD chip update. - ✅ Real coordinate clicks open popups: XSS headline rendered as literal text (0 injected nodes, `window.__pwned` undefined), link href preserved incl. `&b=<2>`, `target=_blank rel=noopener`; all-null-fields row shows `ARTICLE / no location label`, no link/score. - ✅ Critical pins independent: 5 cyan pins, count 5, pin popup opens with blips layer on (Kherson pin verified). - ✅ Pan/zoom refetches with correct bbox (Paris/Sydney/Kyiv/NYC/LA queries logged); counts viewport-scoped (81/56/63/24/57). - ✅ Superseded guard: slow-mode pan A→B aborts A, only B renders (57 == exact-bbox fixture count). - ✅ 404 mode: warn + count 0 + HUD 0, map and critical pins unaffected; recovers when endpoint returns. - ✅ Toggle off: group/renderer/timer null, SVG root removed, chip dimmed; re-enable works. - ✅ No container leak: 1 SVG root across 10+ refreshes; world DOM = 24 paths + 20 cluster icons for 1000 markers. - ✅ Instant-pan → refetch → clustered render settles in **0.92s** wall (incl. 500ms debounce). - ✅ **Zero console errors** across the whole session (only the intentional 404 warn). Evidence screenshots attached to the kanban card. Live deploy + end-to-end proof is T3 (t_bcadd420, devops). Merge-on-green per card; CI runs on master after merge.
Additive 'Article Blips' layer on the HUD map (default OFF), separate
from the critical-news pins:
- GET /api/news/blips?bbox=&limit=1000 (frozen T1 contract), own
  superseded-request counter + overlayAbort handling, bbox refresh on
  pan/zoom and a NEWS_REFRESH_MS timer while enabled
- small radius-3 violet circleMarkers in a chunked markerClusterGroup
  (maxClusterRadius 40) with quiet violet cluster icons; one persistent
  SVG renderer (clickable paths, click-through root, no container leak)
- click -> .blip-pop popup: headline, domain, category, location_name +
  confidence, score, source link (esc() on every field)
- legend toggle + count, ARTICLES HUD chip, syncHud wiring
- graceful 404/failure: warn + idle at 0, map and critical pins unaffected
- .leaflet-heatmap-layer pointer-events:none — the visual-only FIRMS
  canvas sat on top of the overlay pane and ate clicks meant for vector
  blips/pins (pre-existing; fixes click-through for canvas pins too)

Critical-news layer and /api/news/map consumption unchanged.
sirius merged commit fe2b5df369 into master 2026-11-20 03:53:28 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
sirius/osint-dashboard!65
No description provided.