worldmonitor icon indicating copy to clipboard operation
worldmonitor copied to clipboard

feat(global-view): live webcam filter results should be clickable and open in new tab

Open prabu-openclaw opened this issue 6 months ago • 2 comments

Problem

On the global map, the live webcam filter draws camera markers that cannot be clicked. User has to search the camera by name to watch it.

What already exists

  • Layer: src/components/DeckGLMap.ts id: 'webcam-layer' (ScatterplotLayer<WebcamEntry | WebcamCluster>)
  • Map click bus: same file, Deck onClick → handleClick(info)
  • Filter is a MapLayers.webcams flag (src/types/index.ts)
  • Open PR #4230 (fix: wire onClick handler to webcam markers on filtered map layer) — finish or rebase this, do not rewrite from scratch

Scope

Clicking a single webcam marker opens its stream URL in a new tab.

In scope

  • handleClick on webcam-layer objects that have a stream URL
  • window.open(url, '_blank', 'noopener,noreferrer') (or equivalent)
  • No-op when URL is missing
  • Clusters: do not open N tabs; zoom/expand or show a picker (pick one and document it)

Out of scope

  • In-map video player / iframe embed (ToS and CSP)
  • Changing how webcams are ingested
  • Making every map layer open a tab

Acceptance

  • [ ] Filter on → click a single camera marker → stream URL opens in a new tab
  • [ ] rel/noopener so the opener is not leaked
  • [ ] Missing URL does nothing (no throw)
  • [ ] Cluster click does not spawn a tab storm
  • [ ] Existing search-to-watch path still works
  • [ ] PR #4230 is the vehicle, or is closed with a pointer to the replacement PR

Device: web global map. Effort: S (~0.5d).

prabu-openclaw avatar May 24 '26 04:05 prabu-openclaw

Additional suggestion

It would also be useful to allow users to add live webcams to their dashboard camera panel directly from the global map view.

When browsing filtered webcam markers on the map, there should be an option (e.g. a "+" or "Add to Dashboard" button on the marker popup or stream preview) to pin that camera to the user's camera panel for quick access later.

Expected flow: filter on global map → click camera → preview/open stream → option to save/add to dashboard camera panel → camera appears in panel on next visit

This turns the global webcam filter from a one-time browse into a way to build a personal live camera collection inside the dashboard.

prabu-openclaw avatar May 24 '26 04:05 prabu-openclaw

Working a follow-up to closed #4230 rather than reviving that patch.

#4230 wired webcam-layer onClick to showWebcamClickPopup, but:

  • the first revision missed the cluster guard and return true, so cluster clicks were unsafely cast as WebcamEntry and leaf clicks double-fired through the global Deck handler
  • even after those fixes, current main already shows the pin popup via handleClick, and that popup still does not open the stream (it also waited on fetchWebcamImage before mounting, so a slow image fetch made clicks look dead)

The replacement:

  • distinguish WebcamEntry vs WebcamCluster via the _kind tag stamped at setWebcams (with a count/webcamId fallback) — no cluster→leaf cast
  • layer onClick returns true so the global handler does not double-fire
  • leaf click opens the public Windy URL with window.open(..., '_blank', 'noopener,noreferrer') and still uses the existing pin popup
  • cluster click zooms in instead of opening N tabs
  • missing URL is a no-op (no throw)

PR incoming.

shinzoxD avatar Aug 27 '26 10:08 shinzoxD