Commit Graph
9 Commits
Author SHA1 Message Date
German Khokhlov ab33ac5332 Merge remote-tracking branch 'origin/main' into german/cctv-nearest-same-camera
# Conflicts:
#	src/layers/cctv/selection.test.mjs
2026-11-20 13:17:49 +04:00
German Khokhlov 09588b98bf Commit the shown CCTV camera with FOCUS, not a hidden picker option
The picker no longer keeps a hidden, disabled copy of the opening camera.
That copy could be re-picked with ArrowDown on a closed list, could show
twice in the iOS picker, and left Firefox without an accessible value.
The list now selects the camera's own option, as before. A native list
sends no change for the option it already shows, so FOCUS (or NEAREST,
when that camera is the nearest) keeps the shown camera. Closing the list
without a choice keeps automatic selection.
2026-11-20 12:55:52 +04:00
German Khokhlov aba4c9e533 fix(cctv): keep a clicked group in frame and let counts take clicks over plain fills
- The flight after a count click checks the frame on both axes and at the
  height of the highest mount, so a group on a slope or in a very wide
  window stays in view; when it cannot, it flies to the nearest cell with
  two or more cameras, never to a lone camera that joined the count.
- A count takes a click over a background fill no layer owns (earthquake
  discs, fire perimeters), and still yields to a scene item another layer
  registered.
- A count crossing the HUD edge refreshes the view only when the active
  icon or a lone camera depends on it, and never mid-motion, so panning no
  longer runs extra full view passes.
- A count restored at the HUD edge keeps the lone cameras its outline
  covers, and leaves the others as icons.
2026-11-20 02:02:06 +04:00
German Khokhlov a6eecee157 Let the camera picker pick the opening CCTV camera
The picker preselected the active camera, and a native select fires no
change for the option it already shows. So while CCTV was still following
the view, choosing the camera the picker showed did nothing, and the next
pan switched to another camera.

The layer now reports whether the active camera is the opening one
(activeCameraProvisional). While it is, the picker shows that camera from
a hidden, disabled first option, so choosing it from the list is a change
and ends automatic selection; closing the list keeps it. A same-camera
pick that ends the opening pick notifies listeners so the picker drops the
hidden option, and reopenNearestCamera passes { opening: true } so its own
notification already carries the opening state.

docs/CURRENT-STATE.md now says when automatic selection ends. Tests cover
the hidden option, confirming and dismissing the picker before a pan, the
notification, and focusNearestToPoint, which is now on main.
2026-11-20 01:10:42 +04:00
German Khokhlov f6982dc934 fix(cctv): a count click yields to what is on top and keeps its group in frame
- A count click stands aside when an overlay label or another layer's card
  already took the click, and CCTV now claims a count click in the shared
  pick registry, so the flights layer no longer reads it as an empty-map
  click and keeps tracking its aircraft.
- The flight to a group halves the distance only while the group stays in
  frame; otherwise it flies to the nearest ground cell of the group, so a
  tilted click no longer ends with no camera on screen.
- Counts hidden under the HUD no longer push the active icon aside, and a
  lone camera that would move a merged count under the HUD leaves the
  original count and its icon as they were.
- Cameras on one mount are spread before counts merge, so a spread icon no
  longer slides under a neighbouring count.
- The ground module comment says how a camera without a batch height takes
  the drawn terrain.
2026-11-19 17:52:50 +04:00
German Khokhlov 81fe7f88cc fix(cctv): settle the review of the count markers
Bugs:
- Cameras on one mount stay side by side after their geometry is built,
  so a click or a settled view no longer folds them back into one icon.
- A count click yields to a card drawn over the marker and to another
  layer's object under it, waits while the cockpit or tracking holds the
  view, and flies at most halfway, so a long chain of cameras still splits.
- The active camera's icon is never covered by a count, transparent
  corners of the marker no longer catch clicks, and a count hidden under
  the HUD keeps its lone cameras.
- A lone camera joins only its nearest count and never bridges two; cameras
  close enough to draw as icons take part too, at their drawn icon size.
- Groups across the antimeridian keep their longitude; the flight frames
  the highest mount; markers on ground below the ellipsoid stay visible;
  counts fade outside the Scope circle.
- Mounts less than a metre apart count as one mount.
- A drawn-terrain height survives a late fallback answer, is read for an
  unresolved camera and for one projected off the window, is re-read when
  the terrain under it finishes loading or the terrain source changes, and
  the read budget no longer goes to the same misses each pass.

Cleanup: the glyph draws from one green SVG sprite instead of recolouring
pixels, marker-only constants move next to their use, layout tests check
behaviour rather than formulas, and docs and comments match the code.
docs/I18N.md names the one fixed notation of count badges as an exception.
2026-11-19 03:07:04 +04:00
German Khokhlov aabfa5e084 fix(cctv): paint count markers on the world overlay canvas
The scene renders at CSS resolution and is stretched on a high-density
display, so a count marker drawn as a scene sprite looked coarse next
to the camera callouts, which the world overlay paints at device
density.

Paint the markers through the overlay's custom paint lane instead, in
the callouts' typeface. Each paint reprojects the group centres; a
click is resolved against the rectangles painted in the last frame and
still zooms to the group without choosing a camera. A marker that would
cover HUD chrome is skipped, as overlay entries are.

With no aggregate sprites left, the contact sweep no longer needs to
skip them, so that exclusion is removed.
2026-11-18 15:31:20 +04:00
German Khokhlov 607796737c feat(cctv): show how many cameras a thinned marker stands for
Zoomed out, the layer keeps one camera per ground cell and drew it as an
ordinary icon, so nothing showed that dozens or hundreds of other cameras
sat behind it. A cell with two or more cameras is now one round marker
with the count inside, at the centre of its cameras. Single cameras and
the active camera keep their icons.

The count covers the whole cell, so it does not change while the cell
crosses the screen edge. Markers that would overlap on screen merge into
one carrying their sum. Counts above 999 use the compact form of the UI
language and widen the marker into a pill. Clicking a marker zooms to
its group and does not choose a camera.

Ambient cards and coverage attach only to cameras drawn as icons; the
camera picker keeps one representative per visible cell as before.
2026-11-18 14:26:37 +04:00
InoukT fa4ce4b2a5 feat(cctv): add Quebec, Ottawa, and World feeds 2026-11-02 22:57:22 -05:00