diff --git a/DATA_SOURCES.md b/DATA_SOURCES.md
index f8da1e26c7..695eb478c1 100644
--- a/DATA_SOURCES.md
+++ b/DATA_SOURCES.md
@@ -411,7 +411,7 @@ The [Bhote Koshi event pack](public/events/bhote-koshi-2026/README.md), under `p
| Dataset | Folder | License | Commercial use? | Attribution |
| --------------------------------------------------------------------------- | --------------------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------ | --------------------------------------------------------------------------- |
| **Datacenters** (4,352) | `datacenters/` | **ODbL 1.0** (OpenStreetMap extract) | ✅ (attribution + share-alike on data) | © OpenStreetMap contributors (shared credit) |
-| **Dams** (704) | `dams/` | **ODbL 1.0** (OpenInfraMap / OSM extract) | ✅ (attribution + share-alike on data) | © OpenStreetMap contributors (shared credit) + Open Infrastructure Map |
+| **Dams** (706) | `dams/` | **ODbL 1.0** (OpenInfraMap / OSM extract + OSM API) | ✅ (attribution + share-alike on data) | © OpenStreetMap contributors (shared credit) + Open Infrastructure Map |
| **Military area names** (36,466) | `osm_military_names/` | **ODbL 1.0** (OpenStreetMap, via Overture Maps) | ✅ (attribution + share-alike on data) | © OpenStreetMap contributors (shared credit) + Overture Maps Foundation |
| **Ukraine outline** (Rail layer no-positions rule; 1 ring, 7,801 points) | `src/data/railNoPositions.js` | **ODbL 1.0** (OpenStreetMap, via geoBoundaries gbOpen UKR ADM0, commit 9469f09; simplified to 0.0005°) | ✅ (attribution + share-alike on data) | © OpenStreetMap contributors (shared credit) + geoBoundaries |
| **Québec CCTV source catalog** (1,120 locations) | `public/quebec-cameras.json` | Mixed: MTQ locations CC BY 4.0; Montréal camera nodes ODbL 1.0; scenic records retain per-record provenance. No video files are bundled or cached. | Location data is per-record; video remains hosted by Québec 511 and its platform terms apply; scenic source pages may have separate terms | MTQ / Données Québec CC BY 4.0; © OpenStreetMap contributors (ODbL); scenic operator and position source shown in the selected-camera panel |
@@ -432,7 +432,7 @@ The [Bhote Koshi event pack](public/events/bhote-koshi-2026/README.md), under `p
| **Yale Bright Star Catalogue** (9,096 stars, sky background) | `sky/` | **Public domain** | ✅ (no restrictions) | "Yale Bright Star Catalogue (Hoffleit & Warren, via CDS)" (courtesy credit) |
| **ESO Milky Way panorama** (eso0932a, blurred cube map, sky background) | `sky/` | **CC BY 4.0** | ✅ (attribution; changes stated) | "ESO/S. Brunier" |
| **CCTV ground heights** (3,445 cameras) | `cctv_ground_heights/` | Precomputed camera placement heights, aligned to work with Google Photorealistic 3D Tiles (folder README) | — | — |
-| **CCTV Camera Database** model-enrichment extract v2.26.0 + v2.29.0 (20 camera-model records) | `src/layers/cctv/modelSpecs.js` | **CC0-1.0** (public domain dedication) | ✅ (no restrictions) | "Specs: cctv-database.com" (courtesy — not legally required) |
+| **CCTV Camera Database** model-enrichment extract v2.26.0 + v2.29.0 (20 CCTV and 15 ALPR camera-model records) | `src/layers/cctv/modelSpecs.js`, `src/layers/alpr/modelSpecs.js` | **CC0-1.0** (public domain dedication) | ✅ (no restrictions) | "Specs: cctv-database.com" (courtesy — not legally required) |
### ⚠️ TeleGeography is bundled but NonCommercial
@@ -458,6 +458,17 @@ commercial use with attribution and applicable database share-alike/access
obligations; it does not license the application code. Trimmed test-only tile
fixtures retain their provenance in `src/data/fixtures/README.md`.
+A mapped `model` tag that names datasheet hardware adds a spec line to the
+selected card. The specs are 16 CC0-1.0 records from the CCTV Camera Database
+model-enrichment extract (v2.29.0): 15 compiled into
+`src/layers/alpr/modelSpecs.js`, with the bare product codes mappers tag added
+as aliases and the SharpV G3 and SharpX XGA titles naming their variant, plus
+the CCTV layer's Bosch MIC-7522-Z30 record. Nothing is fetched at runtime, and
+an unrecognised tag is never displayed. The default hourly extract does not
+carry `model` yet, so the line appears only with a source that supplies it: an
+Overpass-backed source or a custom adapter whose records include the optional
+`model` field.
+
### CCTV Camera Database (`src/layers/cctv/modelSpecs.js`)
The CCTV layer's hardware-model specs are a small extract (v2.26.0, plus the Bosch MIC
@@ -474,7 +485,7 @@ credits it anyway as `SPECS: CCTV-DATABASE.COM` beside any spec line it renders.
### Bundled OpenStreetMap data
-Bundled OSM-derived data is distributed under [ODbL 1.0](https://opendatacommons.org/licenses/odbl/1-0/), separately from the MIT code: [datacenters](src/data/local_data/datacenters/), [dams](src/data/local_data/dams/) (via Open Infrastructure Map), [military names](src/data/local_data/osm_military_names/), the Rail layer's Ukraine outline in [`railNoPositions.js`](src/data/railNoPositions.js) (OpenStreetMap via geoBoundaries gbOpen, Runfola et al. 2020, simplified; the module's code stays MIT), and [OSM test fixtures](src/data/fixtures/). Keep © OpenStreetMap contributors and offer modified databases under ODbL.
+Bundled OSM-derived data is distributed under [ODbL 1.0](https://opendatacommons.org/licenses/odbl/1-0/), separately from the MIT code: [datacenters](src/data/local_data/datacenters/), [dams](src/data/local_data/dams/) (from Open Infrastructure Map and the OpenStreetMap API), [military names](src/data/local_data/osm_military_names/), the Rail layer's Ukraine outline in [`railNoPositions.js`](src/data/railNoPositions.js) (OpenStreetMap via geoBoundaries gbOpen, Runfola et al. 2020, simplified; the module's code stays MIT), and [OSM test fixtures](src/data/fixtures/). Keep © OpenStreetMap contributors and offer modified databases under ODbL.
### NASA FIRMS acknowledgement
diff --git a/README.md b/README.md
index dce218cccb..277b76e785 100644
--- a/README.md
+++ b/README.md
@@ -480,7 +480,7 @@ In the app, **Data Layers** groups them as Movement, Cameras, Infrastructure, Ev
| 🟡 A free Cesium ion token | **Google Photorealistic 3D cities** and world terrain — eligible personal, non-commercial use; current ion terms and quotas apply |
| 🔴 A Google Maps key | The same 3D direct from Google, plus Google place search — the billing-enabled, metered route |
-**Also on the globe:** neighborhood overlays · an optional cockpit WX cloud effect. **Bundled static infrastructure:** Datacenters (4,352), Dams (704), and Submarine Cables (712).
+**Also on the globe:** neighborhood overlays · an optional cockpit WX cloud effect. **Bundled static infrastructure:** Datacenters (4,352), Dams (706), and Submarine Cables (712).
**Missing a layer you want?** Open an issue — or add it and send the PR.
diff --git a/changelog.d/1152-acaray-yacyreta-dams.md b/changelog.d/1152-acaray-yacyreta-dams.md
new file mode 100644
index 0000000000..01b99c6c70
--- /dev/null
+++ b/changelog.d/1152-acaray-yacyreta-dams.md
@@ -0,0 +1,3 @@
+- Add the Acaray and Yacyretá dams from OpenStreetMap to the Dams layer, and
+ credit the layer to OpenStreetMap / OpenInfraMap instead of USACE (radianx,
+ #1152).
diff --git a/changelog.d/1360-alpr-model-specs.md b/changelog.d/1360-alpr-model-specs.md
new file mode 100644
index 0000000000..a7db9817c5
--- /dev/null
+++ b/changelog.d/1360-alpr-model-specs.md
@@ -0,0 +1,7 @@
+- Mapped ALPR cameras whose OpenStreetMap `model` tag names known hardware
+ (Motorola Solutions Vigilant, Genetec AutoVu, Axis, Verkada, Bosch MIC) show
+ a datasheet spec line on their card, from 16 vendored CCTV Camera Database
+ records, when their source supplies `model` (an Overpass-backed source or an
+ integration adapter; the default hourly extract does not yet); unknown,
+ generation-ambiguous or mis-attributed models show nothing
+ (bassem chagra, @ch-bas, #1360).
diff --git a/changelog.d/1808-cctv-camera-counts.md b/changelog.d/1808-cctv-camera-counts.md
new file mode 100644
index 0000000000..7c87538cd1
--- /dev/null
+++ b/changelog.d/1808-cctv-camera-counts.md
@@ -0,0 +1,8 @@
+- Zoomed out, a CCTV ground cell with two or more cameras is now one round
+ marker with a camera icon and the count (`999`, `1.7K`, `12K` in every
+ language). It grows with the count, merges with markers it would overlap,
+ takes in a lone camera right beside it, and zooms in on click until the
+ group splits. Idle cameras and markers are green. The active camera stays
+ amber and video cameras violet. Cameras on one mount draw side by side, and
+ a camera the terrain height service never answered for stands on the drawn
+ terrain (gekh, #1808).
diff --git a/changelog.d/1857-zoom-freeze-under-icons.md b/changelog.d/1857-zoom-freeze-under-icons.md
new file mode 100644
index 0000000000..6816fdfa88
--- /dev/null
+++ b/changelog.d/1857-zoom-freeze-under-icons.md
@@ -0,0 +1,3 @@
+- Wheel and trackpad zoom no longer freeze below 150 km while an aircraft or
+ vessel icon is under the centre of the view: icons drawn over depth write a
+ depth of exactly 0, which the camera's depth pick ignores (asturksever, #1857).
diff --git a/changelog.d/1861-bare-address-defaults.md b/changelog.d/1861-bare-address-defaults.md
new file mode 100644
index 0000000000..77faf35c49
--- /dev/null
+++ b/changelog.d/1861-bare-address-defaults.md
@@ -0,0 +1,4 @@
+- Opening the bare address starts with the default layers again, instead of
+ bringing back the last session's: a link still restores everything it
+ carries, so clearing the address always resets the view (samehkhamis,
+ #1861).
diff --git a/changelog.d/1862-kit-sweep-chat-voice.md b/changelog.d/1862-kit-sweep-chat-voice.md
new file mode 100644
index 0000000000..511c798fcb
--- /dev/null
+++ b/changelog.d/1862-kit-sweep-chat-voice.md
@@ -0,0 +1,2 @@
+- The AI chat panel's and voice control's buttons and glyphs are now kit
+ controls (manjunath22466, samehkhamis, #1862).
diff --git a/changelog.d/1863-kit-sweep-draw.md b/changelog.d/1863-kit-sweep-draw.md
new file mode 100644
index 0000000000..4822dd8265
--- /dev/null
+++ b/changelog.d/1863-kit-sweep-draw.md
@@ -0,0 +1,2 @@
+- Draw's and Import's buttons and glyphs are now kit controls
+ (manjunath22466, samehkhamis, #1863).
diff --git a/changelog.d/1864-kit-sweep-missions-radio.md b/changelog.d/1864-kit-sweep-missions-radio.md
new file mode 100644
index 0000000000..9f2c26b390
--- /dev/null
+++ b/changelog.d/1864-kit-sweep-missions-radio.md
@@ -0,0 +1,2 @@
+- Space Missions', Contacts', Radio's, the RTL-SDR card's and key setup's
+ buttons and glyphs are now kit controls (manjunath22466, samehkhamis, #1864).
diff --git a/changelog.d/1865-kit-sweep-bhote-koshi.md b/changelog.d/1865-kit-sweep-bhote-koshi.md
new file mode 100644
index 0000000000..d10cab97b7
--- /dev/null
+++ b/changelog.d/1865-kit-sweep-bhote-koshi.md
@@ -0,0 +1,3 @@
+- The Bhote Koshi panel's buttons are kit controls, CINEMATIC's pressed
+ state is Vue state, and its media cards are a Vue view (manjunath22466,
+ samehkhamis, #1865).
diff --git a/changelog.d/1866-no-focus-zoom.md b/changelog.d/1866-no-focus-zoom.md
new file mode 100644
index 0000000000..231f5721f4
--- /dev/null
+++ b/changelog.d/1866-no-focus-zoom.md
@@ -0,0 +1,3 @@
+- Tapping the search box or any other text field on an iPhone no longer leaves
+ the page zoomed in: the page stays at its own scale and the map does the
+ zooming (samehkhamis, #1866).
diff --git a/changelog.d/1867-start-layers.md b/changelog.d/1867-start-layers.md
new file mode 100644
index 0000000000..d617556057
--- /dev/null
+++ b/changelog.d/1867-start-layers.md
@@ -0,0 +1,4 @@
+- An application can name the layers a bare address starts with
+ (`startLayers` on `createApplicationControls`; none by default): they turn on
+ without being saved as the user's own choice, and a link's own layers always
+ win (samehkhamis, #1867).
diff --git a/changelog.d/1868-kit-sweep-photo-viewer.md b/changelog.d/1868-kit-sweep-photo-viewer.md
new file mode 100644
index 0000000000..811a3fa3ae
--- /dev/null
+++ b/changelog.d/1868-kit-sweep-photo-viewer.md
@@ -0,0 +1,3 @@
+- Street Level's photo viewer is a Vue view with kit step buttons, and a
+ provider switch always gets a fresh panorama canvas (manjunath22466,
+ samehkhamis, #1868).
diff --git a/changelog.d/1869-kit-sweep-final-scan.md b/changelog.d/1869-kit-sweep-final-scan.md
new file mode 100644
index 0000000000..bcdfc9d9ff
--- /dev/null
+++ b/changelog.d/1869-kit-sweep-final-scan.md
@@ -0,0 +1,3 @@
+- The view scan now forbids any hand-written button, Material glyph,
+ checkbox or range in the views, and any control built in script
+ (manjunath22466, samehkhamis, #1869).
diff --git a/changelog.d/1870-find-it.md b/changelog.d/1870-find-it.md
new file mode 100644
index 0000000000..6e70db31ca
--- /dev/null
+++ b/changelog.d/1870-find-it.md
@@ -0,0 +1,4 @@
+- A selected vessel or aircraft can be found again from its card: while it is
+ off screen or has left its feed (the clock moved, or the view moved away),
+ Find it flies back to it, looking it up where it was at the clock's time
+ when the feed no longer has it (samehkhamis, #1870).
diff --git a/changelog.d/1871-street-level-photo-followups.md b/changelog.d/1871-street-level-photo-followups.md
new file mode 100644
index 0000000000..e68357f915
--- /dev/null
+++ b/changelog.d/1871-street-level-photo-followups.md
@@ -0,0 +1,3 @@
+- Street Level's photo viewer settles every open and mount, draws one
+ viewer at a time and states its view contract (manjunath22466,
+ samehkhamis, #1871).
diff --git a/changelog.d/1872-omnibar-centred.md b/changelog.d/1872-omnibar-centred.md
new file mode 100644
index 0000000000..d41b20d91e
--- /dev/null
+++ b/changelog.d/1872-omnibar-centred.md
@@ -0,0 +1,3 @@
+- On a phone the search field is centred when no language picker sits beside
+ it, instead of keeping the picker's room empty on its right (samehkhamis,
+ #1872).
diff --git a/changelog.d/1873-weather-texture-limit.md b/changelog.d/1873-weather-texture-limit.md
new file mode 100644
index 0000000000..fdb351c1a2
--- /dev/null
+++ b/changelog.d/1873-weather-texture-limit.md
@@ -0,0 +1,4 @@
+- Satellite clouds draw again in a built app instead of showing "Weather
+ imagery unavailable": the weather shell read its texture limit in a
+ parameter default, which esbuild compiles for older browsers into code that
+ throws. A test now refuses the form under `src/` (samehkhamis, #1873).
diff --git a/changelog.d/1875-imagery-shows.md b/changelog.d/1875-imagery-shows.md
new file mode 100644
index 0000000000..7c5feeb2c2
--- /dev/null
+++ b/changelog.d/1875-imagery-shows.md
@@ -0,0 +1,3 @@
+- Weather imagery and shells say what they show (`shows`, such as
+ `'clouds'`), so a renderer can tell such a layer apart; nothing draws
+ differently (samehkhamis, #1875).
diff --git a/changelog.d/1876-search-dock-above-timeline.md b/changelog.d/1876-search-dock-above-timeline.md
new file mode 100644
index 0000000000..50c810776d
--- /dev/null
+++ b/changelog.d/1876-search-dock-above-timeline.md
@@ -0,0 +1,2 @@
+- On desktop the search dock sits above the World Timeline, which takes the
+ dock's floor (Sameh Khamis, @samehkhamis, #1876).
diff --git a/changelog.d/1877-landed-aircraft-on-ground.md b/changelog.d/1877-landed-aircraft-on-ground.md
new file mode 100644
index 0000000000..a53cf27fb0
--- /dev/null
+++ b/changelog.d/1877-landed-aircraft-on-ground.md
@@ -0,0 +1,4 @@
+- A plane that lands and is reported on the ground with no altitude stays on
+ the ground, instead of hanging at its approach height until it takes off
+ or its 3D model appears; its labels read "On the ground" (samehkhamis,
+ #1877).
diff --git a/docs/CURRENT-STATE.md b/docs/CURRENT-STATE.md
index f4ca0ba090..5aca10d5bc 100644
--- a/docs/CURRENT-STATE.md
+++ b/docs/CURRENT-STATE.md
@@ -10,6 +10,20 @@ or an older position from another feed) and one reported slower than 2 m/s
give no course and keep the last; an aircraft with no course at all faces
north.
+A selected vessel, aircraft or military aircraft can be found again from its
+Context card. While it is off screen, behind the globe or out of its layer's
+feed (the clock jumped to a time the feed lacks it, or the view moved away
+from it), the card's header shows Find it (`store.locate()`,
+`src/ui/stores/entityCard.js`). One still in its feed is flown to (an
+aircraft followed). One out of its feed is looked up at the layer's time on
+its own track (`locate` on the vessels, flights and military layers, through
+`locateOnTrack` in `src/data/locate.js`): the newest point at or before the
+world clock's time while the layer follows the clock, else the newest. The card
+moves to it and says how old that reading is, and the camera flies there. Once
+the feed has it again, its layer selects it again (an aircraft is followed).
+With no point at or before the time, the card says there is no reading then and
+the camera stays. A followed item is never counted as off screen.
+
While anything moves (a layer in motion, the camera, a followed contact), the
globe draws at the display's own refresh rate; there is no fixed 60 FPS cap.
The render governor (`src/renderGovernor.js`) caps a parked scene at
@@ -93,6 +107,16 @@ settling. Oblique views below 300 km are left alone.
`QA_BASE_URL=http://localhost:4173 node scripts/qa-zoom-out-guard.mjs` exercises
the real browser controller at desktop and phone widths with keyless fixtures.
+Below 150 km Cesium sizes a wheel or pinch zoom step from the depth it picks at
+the canvas centre. Icons drawn over depth (aircraft, vessels and most markers:
+`disableDepthTest: Infinity`) sit on the near plane and write a depth of
+exactly 0 there (`src/render/cesium/iconSetPrimitive.js`), which that pick
+reads as nothing drawn, so it keeps the ground under the icon. Any depth past
+the near plane would be taken for a surface a near plane's distance from the
+camera, and the zoom would stop while an icon is under the centre.
+`QA_BASE_URL=http://localhost:5173 node scripts/qa-zoom-under-icon.mjs` checks
+this against a dev server (`npm run dev`).
+
Cesium's free look (Shift+drag, which turns the camera in place) works only
below 1,000 km. Above that height a few drags could turn the whole planet out of
frame and leave only stars, so Shift+drag does nothing there. Cesium also turns
@@ -1191,9 +1215,11 @@ every width, right to left it takes the bottom right at every width, and
`src/ui/creditLineHeight.js` keeps its height in `--credit-line-height`: the
coordinates (and, right to left, the Tactical readout) stay 6px above it
however many lines it wraps onto, and the dock and World Timeline rise when
-it is taller than their usual clearance. Narrower than 1120px the dock leaves
-no room between the corners, so the coordinates and the readout sit above
-the dock, and above the World Timeline while it shows. Outside that layout
+it is taller than their usual clearance. The World Timeline takes the dock's
+floor and the dock (with the Omnibar's field) sits above it, rising by the
+bar's height while it shows, as the plain dock does. Narrower than 1120px the
+dock leaves no room between the corners, so the coordinates and the readout
+sit above the dock. Outside that layout
Cesium's credit box wraps from 1200px, as before; the phone shell, clean
view, recording and scene playback lay the line out themselves.
The left rail treats the centered World Timeline and voice control as
@@ -1929,6 +1955,16 @@ The row count explicitly says **nearby**: loaded records can be outside the
screen. Cyan camera badges use Manjunath's camera artwork; selection switches to a
larger coral badge with corner brackets and an animated tactical card. Numeric
mapped bearings draw illustrative 90 m direction wedges (not measured coverage).
+A camera whose OSM `model` tag names known hardware (Motorola Solutions Vigilant,
+Genetec AutoVu, Axis, Verkada, Bosch MIC; 408 of the 1,567 tagged cameras
+in October 2026) gets a `SPEC` line on its card from vendored datasheet records
+(`src/layers/alpr/modelSpecs.js`, matched with the CCTV layer's
+`createModelSpecLookup`). A `manufacturer` naming another maker rejects the
+match, and the raw tag text is never shown.
+Unversioned `AutoVu SharpV` and `AutoVu SharpX` tags show no specs; G1/G2
+tags show the G2 (1280x960) record and G3 tags the G3 record. The default
+hourly extract has no `model` field yet; an Overpass-backed source or a custom
+adapter record's optional `model` fills it.
The shared overlay paints gradients for at most 64 nearby cameras, promoting the
selected camera; farther cameras keep native Cesium badges without wedges.
Native ground-clamped wedges (a ground polyline plus a classification polygon per
@@ -1991,14 +2027,33 @@ directory. Every `/api/cctv` route refuses cross-site browser requests but
accepts forwarding headers, so cameras work behind a reverse proxy; a forwarded
request skips the key-bearing Street View fallback and gets the placeholder.
-The CCTV layer draws only the cameras on or near the screen. Zoomed out, it
-keeps one camera per ground cell sized to the view, preferring a healthy feed,
-and the cells are anchored to the ground so a pan keeps the same cameras. The
-active camera always shows. Ground placement and coverage geometry load only
-for the cameras in view, with at most two attempts per camera and view regime.
-The view pass reruns while the camera moves, paced by its own cost. The camera
-picker lists the cameras in view, active camera first, and closes with the
-count of cameras outside the view.
+The CCTV layer draws only the cameras on or near the screen. Zoomed out, a
+ground cell with two or more cameras shows one marker at their mean position. A
+green camera pictogram sits under its top edge and the count just below its
+middle. The marker grows with the count and paints on the world overlay at
+callout resolution. The count covers the whole cell up to the horizon, including
+its off-screen cameras. Overlapping markers merge and add their counts. A lone
+camera whose icon would touch a marker joins the nearest one, unless the HUD
+hides the merged marker. In that case the lone camera keeps its icon and the
+count stays where it was before the merge. If the marker there would still cover
+the icon, the camera stays in its count when the label fits. The active camera
+keeps its own icon beside any marker that would cover it and stays out of the
+count. A click on a marker zooms in on its group, at least halving the distance
+each time. If halving would leave the group wider or taller than the frame, the
+view zooms in on the nearest of the group's ground cells with two or more
+cameras. The cockpit or a tracked object holds the view in place. Ambient cards
+and coverage attach only to
+cameras drawn as icons. On a globe map a marker stands on the drawn terrain. A
+camera the height batch never answered for takes the drawn terrain as its ground
+once it is near the screen. It reads that height again from much closer, once
+the terrain in view has loaded, or when the terrain source changes. A later
+Re:Earth answer replaces it. A fallback preserves it. Close up every camera
+shows. Cameras on one mount draw side by side and their records keep the mount.
+Ground placement has at most two attempts per camera and view regime. The view
+pass reruns while the camera moves, paced by its own cost, and when the terrain
+in view finishes loading. The camera picker lists the active camera first, then
+one camera per visible cell, preferring healthy feeds. It ends with the count of
+catalog cameras missing from the list.
Turning CCTV on opens on the camera nearest the view. Until someone picks a
camera, each settled move, such as a shared view's flight landing, moves it to
@@ -2130,7 +2185,10 @@ trail, a route. A layer under another layer's card or label
(`isUnderOtherCard`) does nothing: it neither acts on its item there nor
treats the click as empty space, so a tracked aircraft stays tracked and a
selection stays selected. Context (`src/ui/entityContextBridge.js`) names
-nothing under a card. With no card on top, the scene rules are unchanged.
+nothing under a card. A layer can claim a target it paints outside the overlay's
+entries (`registerClickClaim`) where no card or label is on top. A CCTV count
+claims each click that zooms to it, so a tracked aircraft stays tracked.
+With no card or claim on top, the scene rules are unchanged.
World-overlay hit rectangles are what is painted on screen until the next
paint: an overlay change (a click subscriber publishing its selection card)
no longer clears them mid-click, and a paint that draws nothing clears them
@@ -6317,7 +6375,17 @@ caption has no place name (KartaView's is where the drive began) and links to
the full-size photo through the image proxy, since kartaview.org's photo
pages fail for signed-out visitors. The viewer itself is `photoViewer.js`,
shared with Panoramax: each provider hands it a `PhotoSources` table (first
-and sharper flat and panorama URLs, and the caption fields).
+and sharper flat and panorama URLs, and the caption fields). It builds no
+element: it presents the viewer through the layer's
+`subscribePhotoViewer()`, which the application shell publishes to the
+`gev-street-level-photo` store, and `StreetLevelPhotoViewer` draws it in the
+viewer host and hands back the canvas the panorama is drawn on (a fresh one
+after a lost context). Each mount and each canvas has a key of its own, so
+a viewer never draws on another one's elements, and of two viewers
+mounting at once only the later one is drawn (`photoViewers.js`): the
+earlier one's mount closes. A view may draw at once or later; what it
+reads (`mountKey`, `actions.supersede()`) is `ViewerAdapter.subscribeView`
+in `registry.js`. Without a subscribed view these photos cannot open.
Panoramax (`providers/panoramax/`) is keyless and browser-side: the
meta-catalogue `api.panoramax.xyz` (CORS open) federates every instance, and
@@ -7529,7 +7597,7 @@ silently demoting every later lookup for the session.
ground clamp now lifts the cap _center_ only so the wireframe stays a true pyramid welded to
the plane (was a flattened fan / the ~47.5 m divergence — RESOLVED), re-selecting the active
camera is a no-op (killed a click-flash), and texture swaps gate on canvas content (killed a
- periodic white flash). Camera icons are cyan for stills, violet for cameras with a video feed, and amber for the active camera. Coverage is now **metro-wide: 250 cameras** (`CCTV_AUSTIN_MAX_SOURCES`
+ periodic white flash). Camera icons are green for stills, violet for cameras with a video feed, and amber for the active camera. Coverage is now **metro-wide: 250 cameras** (`CCTV_AUSTIN_MAX_SOURCES`
default 36 → 250, hard bound 300), filtered to `camera_status === TURNED_ON` (~815 live of
1,003 rows). City packs (2026-07-04): Caltrans (districts 4/7/11/3 — SF, LA, San Diego,
Sacramento; cap 300) and TfL London JamCams (cap 250) join Austin (cap 250) as keyless default
@@ -8575,7 +8643,7 @@ pins and share links already supply complete boxes.
- Vessels, Transit and Rail draw fleet models under the same DISPLAY rail `3D` toggle, at the same altitude ceiling, caps and 3 km add/keep radii as the aircraft, at true size (`FLEET_MODEL_POLICY`, `src/layers/flights/policy.js`; `createFleetModelLayer`, `src/data/fleetModelInstances.js`). A vessel's model follows its AIS ship type and is drawn at its reported length and beam (AIS static dimensions A+B and C+D, now carried on vessel rows as `length` and `beam`), standing at the sea surface, heading by true heading then course. An aid to navigation is not a hull: a vessel record whose type names a buoy, beacon, mark, RACON or light, or whose MMSI is an aid-to-navigation station's (`99MIDxxxx`), is `isAidToNavigation` (`src/data/vesselTypes.js`) and is drawn as the set's `buoys` model of the IALA mark its type names (`aidToNavigationModel`, `src/data/fleetModels.js`: cardinal N/E/S/W, port or starboard hand, preferred channel by its side, safe water, isolated danger, special mark; a beacon, light, light vessel, RACON or reference point with no mark of its own is the special mark), else a red can (`DEFAULT_AID_MODEL`), at its built size and facing north whatever heading it reports. A type is an aid's when it is one of the 32 kinds an aid report names or uses a word for one (buoy, beacon, cardinal, safe water, RACON, lighthouse and so on); a vessel that works on aids (`Buoy Tender`, `Buoy Layer`) is not one. Its icon is the buoy sprite, tinted bone white (`AID_TO_NAVIGATION_STYLE`, `src/data/vesselLabels.js`), upright and never turned, and its card, selected card and HUD readout (`src/layers/vessels/cards.js`) show its kind alone, whole, in that colour: no speed or heading, since a fixed mark has neither. AISStream subscribes to `AidsToNavigationReport` (message 21) by default, and the server names each report's aid type code (0 to 31) as its kind (`aidToNavigationTypeName`: `20` is `Cardinal Mark N`) rather than reading it as a ship type, and its name runs on into the report's `NameExtension`. A virtual aid (the report's `VirtualAtoN` flag: a mark broadcast where nothing physical stands) carries `virtual: true` on its row, and on its vessel source record (the live-source contract's `virtual`, `src/sources/live/contract.js`, false unless a source says true; any source may set it). It keeps its buoy sprite but never gets a model (`vesselModelSpec` returns null for it, and the vessel layer gathers no model item for it), and its card and readout add `VIRTUAL` after its kind. `aisStreamRows` (`server/providers/vessels/ais-store.js`) puts every vessel ahead of every aid, so a capped request (the layer asks for 12,000 rows) never gives up a ship for a buoy. The `vessels_in_area` tool (and the brief built on it) counts ships only: it leaves aids out of its rows, counts, breakdowns and speed stats. A transit vehicle's model follows its route's GTFS `route_type` when its record carries one and that type is a kind of the vehicle's mode (`types.json` `transit.route_types`: 200 a coach, 101 a high-speed set, 106 a regional DMU, 710 a double-decker), else its layer mode (`transit.modes`: bus, trolleybus, tram, cable car, subway, monorail, rail, funicular, gondola or ferry; a vehicle of `unknown` mode keeps its icon); a fleet hint that overrules the route (a bus on a tram route) leaves the type unused. A monorail and a gondola are raised by their `transit.elevation` lifts. A train's model follows its rail category and mode (rail, metro or tram). The bundled GTFS-Realtime proxy carries no route type, so its vehicles draw their mode's model; a source that adds `routeType` reaches the finer ones. Both stand on the road or rail top they are drawn on, without the 1.5 m `GROUND_FLOOR_LIFT_M` their icons carry, and are painted in their mode or category colour where the model's `_TINT` attribute marks it. A vessel model is clipped at its waterline (one clipping plane per model, at the model origin's horizontal plane), so its hull below the water never shows through a plain globe, which Cesium does not depth-test models against. Under the NVG/FLIR styles (the Flights `irBoost` parameter) these models render unlit flat white, as aircraft models do. Each vehicle's icon stays the visual until its model is loaded, ready and placed; a model is picked as its icon is, and a vehicle drawn as its model keeps its selection card and its place in the detection overlay.
- **Aircraft models skip Cesium's dynamic environment map (2026-10-24).** Flights, Military Flights and Local ADS-B pass `environmentMapOptions: AIRCRAFT_ENVIRONMENT_MAP_OPTIONS` (`{ enabled: false }`, `src/data/aircraftModelLighting.js`) to every drawn model. Otherwise each `Model` renders the sky around it and reads it back from the GPU (`readPixels`) when it is first placed, and again whenever it moves more than 1 km, the scene's atmosphere settings change, or (under sunlight dynamic lighting) an hour of scene time passes (`DynamicEnvironmentMapManager`, Cesium 1.138). The models are lit from Cesium's default spherical harmonics instead, with no specular environment map, so the sky's model-lighting cube map no longer reaches aircraft. `src/data/aircraftModelLighting.test.mjs` pins the option at every drawn model call; every model is built from the fleet set loaded up front, so there is no separate preload.
- The DISPLAY-rail `3D` toggle is the user-facing activation path for both aircraft layers. Their small approved GLBs build their render resources without Cesium's frame-spread job queue, preventing continuous Photorealistic 3D Tiles streaming from starving model readiness; model caps, tracking, camera, and fallback billboards are unchanged.
-- **The `3D` toggle DEFAULTS ON in `proximity` on a first run.** Proximity is itself the budget — models appear only within 3 km of the camera and only for the nearest `MODEL_MAX` — so the default costs nothing at globe scale, and `all` remains a deliberate opt-in. A fresh boot runs NO layer-state restoration (`LayerStateCoordinator.start()` returns early with neither a share payload nor stored state), so four independent initializers decide what a first-run operator sees and must agree: `booleanOption('models3d', 'e', true)` in `src/data/layerState.js`, `_models3dEnabled = true` in BOTH flight layers, `this._models3dEnabled = true` in `src/ui/aircraftDisplay.js`, and the `active` / `visible` classes on `#models3d-toggle` / `#models3d-mode-row` in `index.html`. All four are pinned together in `src/data/layerState.test.mjs`. Explicit state still wins: because the codec omits default-valued options, `models3d: false` is now what travels in a link (`lo=…f.e.0`) and restores OFF at both aircraft layers. **Consequence for returning users:** a stored `gev:layer-state:v2` blob is a FULL options snapshot, so a session that wrote one before this change carries `models3d:false` and keeps 3D off until the operator flips it (or clears the key) — the durable snapshot is treated as the recipient's own state, by design.
+- **The `3D` toggle DEFAULTS ON in `proximity` on a first run.** Proximity is itself the budget — models appear only within 3 km of the camera and only for the nearest `MODEL_MAX` — so the default costs nothing at globe scale, and `all` remains a deliberate opt-in. A fresh boot runs NO layer-state restoration (`LayerStateCoordinator.start()` returns early with neither a share payload nor stored state), so four independent initializers decide what a first-run operator sees and must agree: `booleanOption('models3d', 'e', true)` in `src/data/layerState.js`, `_models3dEnabled = true` in BOTH flight layers, `this._models3dEnabled = true` in `src/ui/aircraftDisplay.js`, and the `active` / `visible` classes on `#models3d-toggle` / `#models3d-mode-row` in `index.html`. All four are pinned together in `src/data/layerState.test.mjs`. Explicit state still wins: because the codec omits default-valued options, `models3d: false` is now what travels in a link (`lo=…f.e.0`) and restores OFF at both aircraft layers. Start-up never reads a stored `gev:layer-state:v2` blob back: a bare URL starts from these defaults and a link from its hash (`src/ui/shareRestoration.js`, `allowLocalState: false`), so clearing the address always resets the view.
- Civilian and military 2D aircraft use the established distance scale: `3×` near
the camera and a `0.5×` floor from 8,000 km outward. A standard 20 px ambient
icon therefore remains about 10 px at globe altitude while retaining the
@@ -8818,13 +8886,18 @@ that era's default (`scf` → 35, `ko` → 5). Every link since carries both fie
explicitly, because the generator always writes them, so no era whose default
later changed depends on a fallback either way.
-**They do NOT all persist the same way, and only one of them persists at all.**
+**None of them comes back from storage on a bare URL; only the hash carries them.**
Worth stating plainly, because "a default you can override" and "a default that
remembers" are different promises:
-- **3D models** have durable storage — `gev:layer-state:v2` in local storage,
- written by `LayerStateCoordinator` on explicit intent. A session that stored a
- snapshot keeps whatever it stored, across tabs and restarts.
+- **3D models** are written to `gev:layer-state:v2` in local storage by
+ `LayerStateCoordinator` on explicit intent, but start-up never reads it back:
+ a link restores what its hash carries, and a bare URL starts with the default
+ layers and options (`src/ui/shareRestoration.js` passes
+ `allowLocalState: false`), so clearing the address always resets the view.
+ A host may name the layers a bare URL starts with (`startLayers` on
+ `createApplicationControls`, e.g. `['flights', 'satellites']`); they are
+ restored passively, never written to storage, and a link's own layers win.
- **Detection mode/density and scope feather have NO storage key at all.** Their
only durable carrier is the URL hash (`dm`/`dd`, `scf`), written on a 500 ms
debounce. A same-URL reload therefore keeps them only if that debounce already
diff --git a/docs/I18N.md b/docs/I18N.md
index 4799cded25..efad640373 100644
--- a/docs/I18N.md
+++ b/docs/I18N.md
@@ -107,6 +107,7 @@ Call it before views render. `onLocaleChange` listeners word their text again at
- **Translate the label, not the value.** Layer ids, enums, share-link parameters, API fields, voice tool schemas and feed data (callsigns, vessel and place names) stay as they are; translate only the text shown for them.
- **No `t()` at module top level.** Keep the English in `msg()` and call `t()` when rendering.
- **Numbers and dates** go through `formatNumber`, `formatDate`, `formatRelativeTime` and `formatUtcDayMonth` from `src/i18n/index.js`, which follow the active language.
+ Compact CCTV count badges painted on the map use Latin digits, a decimal point and a `K` suffix for thousands (`999`, `1.7K`, `12K`). Each badge keeps its width and reads the same across locales. Format these badges only with `formatCameraCount` in `src/data/cctvCellCounts.js`.
- **Identical English means identical translation,** unless you give it a context: `t('CLEAR', { context: 'action' })` (a button) is its own catalog entry, `action|CLEAR`, while `t('CLEAR')` (the sky) stays separate. English output is the same.
- **Text that should stay English** (a brand, a code, a unit symbol) is simply not wrapped.
diff --git a/docs/INFRASTRUCTURE-LAYERS.md b/docs/INFRASTRUCTURE-LAYERS.md
index f8f9b48623..bcfece2df4 100644
--- a/docs/INFRASTRUCTURE-LAYERS.md
+++ b/docs/INFRASTRUCTURE-LAYERS.md
@@ -83,6 +83,6 @@ Consumers use the package exports, which do not import standalone application
globals.
Dataset files and source/license notices remain under `src/data/local_data/`.
-Their input counts are 4,352 datacenter features and 704 dam features. A multipart
+Their input counts are 4,352 datacenter features and 706 dam features. A multipart
geometry draws as several parts, each with its own stem; part and stem counts are
-different measurements from feature counts. This change does not refresh or relicense the datasets.
+different measurements from feature counts.
diff --git a/docs/VUE-MIGRATION.md b/docs/VUE-MIGRATION.md
index 2dcedab29f..aa2909df10 100644
--- a/docs/VUE-MIGRATION.md
+++ b/docs/VUE-MIGRATION.md
@@ -84,21 +84,43 @@ Home and End), since each of Core's groups keeps its own keyboard policy, and
once and asks for a change only when it lands on another option. Every
segmented group in Core is a `UiSegmented`; the old `segmentedControl.js`
adapter is gone.
+No view hand-writes a control the kit has: every button in an SFC outside
+the kit is a `UiButton`, `UiCloseButton` or another kit control, every
+Material Symbols glyph a `UiIcon`, every checkbox a `UiCheckbox`, every
+select a `UiSelect`, and every range a `UiSlider` except the radio
+tuner's and the world timeline's, for the reasons given below. No module
+outside the kit, and no SFC's script, builds a button, select, field or
+Material glyph in script or writes one as markup in a string, apart from
+the globe panel's standalone page (`src/tools/globePanel.js`), plain HTML
+a host serves with no Vue or kit, whose Expand and Open buttons are
+written as markup (`src/ui/kit/viewControls.test.mjs` pins all of it).
+The native fields left are the text, number, password and file inputs
+and the two text areas (the chat's message box and the scene dialog's
+multiline field) the kit has no control for, and the search fields whose
+surfaces this document names. The scene dialog's single-line field takes
+its type from its caller, which passes text-like types only.
`UiButton` adds `pressedClass`, Core's class on a pressed toggle (most use
`active`); its pressed classes toggle through `classList`, so a class other
code adds (a voice highlight) survives a press. Every pressed toggle (a
control with `aria-pressed`) in the views is a `UiButton` with `pressed`
-except two that keep their own `aria-pressed`: Bhote Koshi's cinematic
-button, whose state the event layer writes into the attributes its panel
-renders, and Explore's story cards, which are `role="button"` elements,
-not buttons (`src/ui/kit/viewControls.test.mjs` pins it). Where the
+except Explore's story cards, which keep their own `aria-pressed` since
+they are `role="button"` elements, not buttons
+(`src/ui/kit/viewControls.test.mjs` pins it). Where the
converted buttons draw Material symbols (the tilt-map button, the Context
header's search and expand, the imported files' row actions and the rail
chips' icons), the glyphs are `UiIcon`s with `:size="null"`, so the site
rules still size them. Core's pressable chips and pills (the rail cards'
chips and action chips, Recent Imagery's day chips, SWAP and ZOOM IN, map
-sources, cities and places, and the view context's place and layer chips)
-are `UiButton`s too; the key setup chip is still a plain button. `UiChip`
+sources, cities and places, the view context's place and layer chips and
+the key setup chip) are `UiButton`s too. `UiChip` is a non-interactive
+label chip, used by the voice card.
+header's search and expand, Draw, Import, the imported files' and drawn
+shapes' row actions and the rail chips' icons), the glyphs are `UiIcon`s
+with `:size="null"`, so the site rules still size them. Core's pressable
+chips and pills (the rail cards' chips and action chips, Recent Imagery's
+day chips, SWAP and ZOOM IN, map sources, cities and places, and the view
+context's place and layer chips) are `UiButton`s too; the key setup chip
+is still a plain button. `UiChip`
is a non-interactive label chip, used by the voice card.
The welcome card's buttons (SKIP, the three start tiles, BROWSE STORIES,
BACK and the main NEXT / ENTER GOD MODE action) are ghost `UiButton`s:
@@ -192,6 +214,51 @@ while a query is typed. The Filter button opens a disclosure and carries
a `UiIcon` with `:size="null"`, so `layer-finder.css` still sizes them
(`src/ui/kit/layerFinderControls.test.mjs` pins it); the search field's
magnifier is `UiSearchField`'s own span.
+The Space Missions panel's buttons (a mission's roster row, FOCUS,
+REPLAY ASCENT, the replay's pause, PREV, NEXT and SHOW ALL / DESELECT),
+the Contacts panel's (PREV, FOCUS, NEXT and a contact's row), the Radio
+panel's (Enable, PREV, PLAY, NEXT and STOP), the RTL-SDR card's (Connect,
+Locate, Change device, FM, ADS-B, Tune and the two seeks) and the key
+setup's (the POWER UP chip, a key's REMOVE, the voice auth toggle and
+SAVE KEYS) are ghost `UiButton`s. Radio's Enable and the card's Connect,
+FM and ADS-B are pressed toggles with `active`; PLAY and Locate keep
+their own `active` class without `aria-pressed`, since their words say
+what they will do or have done. The chip's bolt is a `UiIcon` with
+`:size="null"`, so provider-settings.css still sizes it
+(`src/ui/kit/missionsRadioControls.test.mjs` pins it). The card's FM
+frequency stays a native number field, which the kit has no control for,
+and the replay's pause, the roster's chevron and the compass arrows are
+text characters, not Material symbols.
+Utilities' Draw and Import are on the kit. Draw (a pressed toggle with
+`active`), Clear and Import are ghost `UiButton`s, their glyphs `UiIcon`s
+with `pp-icon` and `:size="null"`. Draw's five colour swatches, in the
+toolbar and in a drawn shape's row, are ghost `UiButton`s with
+`role="radio"`: they say they are chosen with `aria-checked` and their own
+`active` class, never `aria-pressed`. A drawn shape's row (its swatch,
+show/hide, the application's row actions and fly to, beside its remove
+`UiCloseButton`) is on the kit too, its glyphs `UiIcon`s with
+`:size="null"`, so `controls.css` still sizes them; show/hide says what it
+does in its name (Show …, Hide …) rather than being pressed. The Street
+Level panel's controls already were kit controls; its EXPAND ⤢ ⤡ and its
+errors' ⚠ are text characters and stay text
+(`src/ui/kit/drawControls.test.mjs` pins it).
+The AI chat panel's and the voice control's buttons are ghost
+`UiButton`s: the chat's Settings, quick prompts, attachment removes,
+Attach layer, Attach a file, Expand conversation, command suggestions,
+Expand chat, Add attachment and Send (a submit button that turns into
+Stop reply), and the voice control's Open AI chat, Back to chat, Back to
+voice, its Preview and Settings tabs and the error tray's DISMISS, beside
+the tier button, the mic and the dock and minimize buttons, which already
+were. The tier button and dock are pressed toggles; the mic is one only
+while its owner has a state for it; the tabs keep `role="tab"` and
+`aria-selected`. DISMISS is a text button, not a cross, so it is not a
+`UiCloseButton`. The Settings and tab glyphs are `UiIcon`s with
+`:size="null"`, so voice-cost.css and voice-card.css still size them
+(`src/ui/kit/chatVoiceControls.test.mjs` pins it). The chat bubble,
+globe, attach, send and stop, expand and Back glyphs stay inline SVG,
+since no Material symbol the page loads draws them the same, and the
+message box, file picker and inactivity minutes stay native fields, which
+the kit has none of. The voice modules build no controls in script.
The small surfaces' buttons are ghost `UiButton`s: the locale picker's
button, the phone tab bar's tabs, the globe actions' Clear, Share, Reset
and north-up compass, the imagery divider's handle, the scene sharing
@@ -208,6 +275,36 @@ targets in its template, as many as `view.subRings` says, rather than
building them in script; the Omnibar's one other `material-symbols-outlined`
is a stylesheet selector, and the layer disclosure only names a button in a
comment (`src/ui/kit/smallSurfacesControls.test.mjs` pins it).
+The Street Level photo viewer of KartaView and Panoramax (the photo, the
+panorama canvas and the ‹ › buttons) is `StreetLevelPhotoViewer`, drawn
+from what the photo viewer presents rather than built in script. Its ‹ and
+› are ghost `UiButton`s, not pressed toggles, whose glyphs are text
+characters; the viewer builds no element, and the street-level layer it
+belongs to needs no Vue (`src/ui/kit/streetLevelPhotoControls.test.mjs`
+pins it). The notice the God's Eye View panel page shows when it loses its
+3D graphics (`#status`, in `src/app/globePanelRuntime.js`) stays built in
+script: that script is sent to the host as source text and runs in the
+host's panel page before the app loads, so it can import nothing.
+The Bhote Koshi reconstruction panel's buttons (previous and next beat,
+Play, Play scene, Cinematic, Full story, Open original, Lower gorge, the
+field reports and Open public map) are ghost `UiButton`s that keep their
+`data-action` hooks. Cinematic is a pressed toggle with no pressed class,
+since bhote-koshi.css reads its `aria-pressed`: the event layer presents
+its state as the record's `pressed`, which the panel passes to the
+button, instead of writing an `aria-pressed` attribute. The ‹ and ›
+arrows are text characters. The event's embedded media cards (each
+anchored witness clip's frame, leader line, title, status and original
+link, and the hidden YouTube preload) are drawn by
+`BhoteKoshiMediaCards`, which `src/data/bhoteKoshiEmbeddedMedia.js`
+renders into its overlay root with `h()` and `render()` on every change,
+words again on a locale change, and places after each frame; they hold
+no control, and the original link stays a link. The script still builds
+the provider SDKs' script and preconnect tags, the overlay root, and the
+Facebook player node: that node is warmed hidden before its card exists
+and carried, loaded, into the card's player, where the SDK replaces its
+contents, so a template could only rebuild it and reload the player; the
+X post is likewise built by its SDK inside the player
+(`src/ui/kit/bhoteKoshiControls.test.mjs` pins it).
`UiSelect` renders the bare native select (Core's labels sit outside it or
come as an `aria-label`) with `v-model`, `options` and `disabled`;
options that carry their own attributes come through the slot, a caller's
@@ -388,7 +485,20 @@ slot whenever its view is drawn.
(done: `RecentImageryReadout` and its day cards, the same way),
Street level (done: `StreetLevelPanel` renders the `gev-street-level`
store that `StreetLevelControls` publishes to; the controls keep their
- listeners, EXPAND, focus and resizing), CCTV (done: `CctvPanel` renders
+ listeners, EXPAND, focus and resizing; `StreetLevelPhotoViewer`, beside
+ it in the layer panels, teleports into the viewer host the photo viewer
+ KartaView and Panoramax mount there, which `createPhotoViewer()`
+ presents through the layer's `subscribePhotoViewer()` and the
+ application shell publishes to the `gev-street-level-photo` store, so
+ the portable `./layers/street-level` entries need no Vue; the viewer
+ keeps every decision, the photo loading, keys, drag and zoom, and draws
+ its panorama on the canvas the view hands back, a fresh one after a lost
+ WebGL context; each mount and canvas is keyed, so no viewer reuses
+ another's elements, and of two viewers mounting at once only the later
+ is drawn while the earlier one's mount closes; with no view
+ subscribed, as when the layer runs without the application shell, a
+ KartaView or Panoramax photo cannot mount),
+ CCTV (done: `CctvPanel` renders
the whole panel from the `gev-cctv` store, including the camera picker,
the inline pose editor, the frame preview, source badge and typed
summary; `CctvControls` keeps its listeners, the frame requests and the
@@ -490,7 +600,8 @@ slot whenever its view is drawn.
reconstruction panel (`BhoteKoshiPanel`, last in the context rail,
renders what the event layer publishes to the `gev-bhote-koshi-panel`
store: each control's text, hidden, disabled, value and attributes as
- the layer writes them, unchanged frames sending nothing; the rail takes
+ the layer writes them, and the cinematic button's pressed state,
+ unchanged frames sending nothing; the rail takes
`bhote-event-active` while it shows), the full-globe celestial ring
(`CelestialRing` teleports into the globe container what `CelestialRing`
in `src/celestialRing.js` publishes to the `gev-celestial-ring` store and
diff --git a/index.html b/index.html
index ded159f2c9..ed18f8e240 100644
--- a/index.html
+++ b/index.html
@@ -2,7 +2,7 @@
-
+
God's Eye View
/g, '');
+// An opening tag's attributes, quoted values may hold `>` (`() => x`).
+const ATTRS = String.raw`(?:[^>"']|"[^"]*"|'[^']*')*`;
+const tags = (markup, name) =>
+ markup.match(new RegExp(String.raw`<${name}\b${ATTRS}>`, 'g')) ?? [];
+// An attribute's name, outside the quoted values.
+const names = (attrs) => attrs.replace(/"[^"]*"|'[^']*'/g, '""');
+
+const PANEL = 'ui/views/panels/BhoteKoshiPanel.vue';
+const CARDS = 'ui/bhoteKoshi/BhoteKoshiMediaCards.vue';
+// Per file: its UiButtons, UiCloseButtons, UiSliders and UiIcons.
+const SURFACES = {
+ // Previous and next beat, Play, Play scene, Cinematic, Full story, Open
+ // original, Lower gorge, a field report (one tag, one per report) and Open
+ // public map; Close; the split and progress sliders.
+ [PANEL]: [10, 1, 2, 0],
+ // The media cards: a frame, a leader, a footer and the original link.
+ [CARDS]: [0, 0, 0, 0],
+};
+
+test('the Bhote Koshi views hand-write no button; each is a kit button', () => {
+ for (const [file, [buttons, closes, sliders]] of Object.entries(SURFACES)) {
+ const markup = template(file);
+ assert.deepEqual(markup.match(/ {
+ for (const [file, [, , , icons]] of Object.entries(SURFACES)) {
+ const markup = template(file);
+ assert.deepEqual(markup.match(/material-symbols/g) ?? [], [], file);
+ const found = tags(markup, 'UiIcon');
+ assert.equal(found.length, icons, file);
+ for (const icon of found) assert.match(icon, /\s:size="null"/, file);
+ }
+});
+
+test('the cinematic button takes the kit pressed state', () => {
+ for (const file of Object.keys(SURFACES))
+ for (const [tag, attrs] of template(file).matchAll(
+ new RegExp(String.raw`<[A-Za-z][\w-]*\b(${ATTRS})>`, 'g'),
+ )) {
+ assert.doesNotMatch(
+ names(attrs),
+ /(?:^|\s)(?::|v-bind:)?aria-pressed(?=[\s=/]|$)/,
+ tag,
+ );
+ assert.doesNotMatch(
+ attrs,
+ /(?:^|\s)(?:v-bind|:)=(?:"[^"]*aria-?pressed[^"]*"|'[^']*aria-?pressed[^']*')/i,
+ tag,
+ );
+ }
+ const pressed = tags(template(PANEL), 'UiButton').filter((tag) =>
+ /\s:pressed=/.test(tag),
+ );
+ assert.equal(pressed.length, 1);
+ assert.match(
+ pressed[0],
+ /^ {
+ const source = read('data/bhoteKoshiEmbeddedMedia.js');
+ assert.doesNotMatch(source, /innerHTML|insertAdjacentHTML|createElementNS/);
+ // Provider scripts and preconnects, the overlay root, and the Facebook
+ // embed node and its warm host.
+ assert.deepEqual(
+ [...source.matchAll(/createElement\('(\w+)'\)/g)].map((m) => m[1]),
+ ['script', 'script', 'script', 'link', 'div', 'div', 'div'],
+ );
+ assert.match(source, /renderVue\(\s*h\(BhoteKoshiMediaCards,/);
+ const cards = template(CARDS);
+ const opening = (name, attribute) =>
+ new RegExp(String.raw`<${name}\b${ATTRS}\s${attribute}${ATTRS}>`);
+ for (const part of [
+ opening('iframe', 'class="bhote-embedded-media-warmup"'),
+ opening('section', 'class="bhote-embedded-callout"'),
+ opening('svg', 'class="bhote-embedded-callout-leader"'),
+ opening('div', 'class="bhote-embedded-callout-body" data-overlay-input'),
+ opening('small', 'role="status"'),
+ opening('a', 'target="_blank" rel="noopener noreferrer"'),
+ ])
+ assert.match(cards, part);
+});
diff --git a/src/ui/kit/chatVoiceControls.test.mjs b/src/ui/kit/chatVoiceControls.test.mjs
new file mode 100644
index 0000000000..b1716157ca
--- /dev/null
+++ b/src/ui/kit/chatVoiceControls.test.mjs
@@ -0,0 +1,150 @@
+// The AI chat panel's and the voice control's buttons and Material glyphs
+// are the kit's: neither their templates nor the voice card and panel
+// layout buttons they render hand-write a or a Material Symbols
+// span. Their other glyphs (the chat bubble, the globe, attach, send and
+// stop, expand and the two Back chevrons) are inline SVG drawn with their own
+// strokes, which no Material symbol the page loads draws the same, so they
+// stay SVG. The voice panel's Preview and Settings are tabs (`role="tab"`
+// with `aria-selected`), not pressed toggles, and DISMISS is a text button,
+// not a cross, so it is a UiButton rather than a UiCloseButton. The chat's
+// message box, file picker and the minutes field stay native: the kit has
+// no text area, file or number field. The voice modules build no controls
+// in script.
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { readFileSync, readdirSync } from 'node:fs';
+import path from 'node:path';
+import { fileURLToPath } from 'node:url';
+
+/** A view's template block: everything outside script, style and comments. */
+function template(file) {
+ const source = readFileSync(
+ new URL(`../views/panels/${file}`, import.meta.url),
+ 'utf8',
+ );
+ return source
+ .replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/g, '')
+ .replace(//g, '');
+}
+// A tag's attributes, read past quoted values so a handler's `=>` does not
+// end the tag early.
+const ATTRS = String.raw`(?:[^>"']|"[^"]*"|'[^']*')*`;
+const tag = (pattern, flags = '') =>
+ new RegExp(pattern.replaceAll('ATTRS', ATTRS), flags);
+const tags = (markup, name) =>
+ markup.match(tag(String.raw`<${name}\bATTRS>`, 'g')) ?? [];
+
+const views = {
+ // Settings, the quick prompts, an attachment's remove, Attach layer,
+ // Attach a file, Expand conversation, the command suggestions, Expand
+ // chat, Add attachment and Send / Stop reply.
+ 'ChatPanel.vue': {
+ UiButton: 10,
+ UiCloseButton: 1,
+ UiIcon: 1,
+ UiSelect: 1,
+ svgs: 5,
+ },
+ // The tier button (dock and panel), the mic, Open AI chat, Back to chat,
+ // Back to voice, the Preview and Settings tabs and DISMISS.
+ 'VoiceControl.vue': {
+ UiButton: 9,
+ UiCloseButton: 1,
+ UiIcon: 2,
+ UiSelect: 3,
+ UiCheckbox: 2,
+ svgs: 3,
+ },
+ 'VoiceCard.vue': { UiButton: 0, UiCloseButton: 1, UiIcon: 0, svgs: 0 },
+ // Dock and minimize.
+ 'PanelLayoutButtons.vue': { UiButton: 2, UiIcon: 0, svgs: 2 },
+ 'VoiceVisualizer.vue': { UiButton: 0, UiIcon: 0, svgs: 1 },
+};
+const markup = Object.fromEntries(
+ Object.keys(views).map((file) => [file, template(file)]),
+);
+
+test('the chat and voice views hand-write no button; each is the kit', () => {
+ for (const [file, counts] of Object.entries(views)) {
+ assert.deepEqual(markup[file].match(/ {
+ for (const [file, view] of Object.entries(markup))
+ assert.doesNotMatch(view, /aria-pressed/, file);
+ const voice = tags(markup['VoiceControl.vue'], 'UiButton');
+ const tiers = voice.filter((button) => /id="gev-voice-tier"/.test(button));
+ assert.equal(tiers.length, 2);
+ for (const tier of tiers)
+ assert.match(tier, /\s:pressed="Boolean\(view\.tier\.pressed\)"/);
+ // The mic writes no aria-pressed while its owner has no state for it.
+ assert.match(
+ markup['VoiceControl.vue'],
+ tag(
+ String.raw` /role="tab"/.test(button));
+ assert.equal(tabs.length, 2);
+ for (const button of tabs) {
+ assert.match(button, /\s:aria-selected="/);
+ assert.doesNotMatch(button, /\s:pressed=/);
+ }
+});
+
+test('the views hand-write no Material glyph; each is a UiIcon the site sizes', () => {
+ for (const [file, { UiIcon, svgs }] of Object.entries(views)) {
+ assert.deepEqual(markup[file].match(/material-symbols/g) ?? [], [], file);
+ const icons = tags(markup[file], 'UiIcon');
+ assert.equal(icons.length, UiIcon, file);
+ // Without it the kit writes an 18px size that beats voice-cost.css and
+ // voice-card.css.
+ for (const icon of icons) assert.match(icon, /\s:size="null"/, file);
+ assert.equal(markup[file].match(/ /,
+ );
+ assert.equal(
+ markup['VoiceControl.vue'].match(
+ / /g,
+ )?.length,
+ 2,
+ );
+});
+
+test('the only native fields left are the message box, file picker and minutes', () => {
+ const inputs = Object.values(markup).flatMap((view) => tags(view, 'input'));
+ assert.equal(inputs.length, 2);
+ assert.match(inputs[0], /id="gev-chat-file" type="file"/);
+ assert.match(inputs[1], /id="gev-voice-timeout-input" type="number"/);
+ assert.equal(tags(markup['ChatPanel.vue'], 'textarea').length, 1);
+ for (const view of Object.values(markup)) {
+ assert.deepEqual(view.match(/ {
+ const root = fileURLToPath(new URL('../../voice/', import.meta.url));
+ const modules = readdirSync(root, { recursive: true })
+ .filter((file) => file.endsWith('.js') && !/test|Harness/.test(file))
+ .map((file) => path.join(root, file));
+ assert.ok(modules.length > 50);
+ for (const file of modules) {
+ const source = readFileSync(file, 'utf8');
+ assert.doesNotMatch(source, /createElement\(\s*['"]button/, file);
+ assert.doesNotMatch(source, /, a Material Symbols span, a select, a checkbox
+// or a range. The Draw toggle is a pressed toggle with `active`. The colour
+// swatches are `role="radio"` buttons: they say they are chosen with
+// `aria-checked` and their own `active` class, never `aria-pressed`. A drawn
+// shape's show/hide renames itself (Show …, Hide …) rather than being pressed.
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+
+const source = (file) =>
+ readFileSync(new URL(`../views/panels/${file}`, import.meta.url), 'utf8');
+/** A view's template block: everything outside script, style and comments. */
+const template = (file) =>
+ source(file)
+ .replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/g, '')
+ .replace(//g, '');
+// A tag's attributes, read past quoted values so a handler's `=>` does not
+// end the tag early.
+const ATTRS = String.raw`(?:[^>"']|"[^"]*"|'[^']*')*`;
+const tag = (pattern, flags = '') =>
+ new RegExp(pattern.replaceAll('ATTRS', ATTRS), flags);
+const tags = (markup, name) =>
+ markup.match(tag(String.raw`<${name}\bATTRS>`, 'g')) ?? [];
+
+const views = {
+ // Draw and Clear.
+ 'DrawControls.vue': { buttons: 2, icons: 1, closes: 0 },
+ // The five colours, one v-for.
+ 'DrawSwatches.vue': { buttons: 1, icons: 0, closes: 0 },
+ // A row's swatch, show/hide, the application's actions and fly to; remove
+ // is a UiCloseButton.
+ 'DrawMarkList.vue': { buttons: 4, icons: 3, closes: 1 },
+ // Import and a file's row actions.
+ 'GeoImport.vue': { buttons: 2, icons: 2, closes: 0 },
+ // The status toggle, EXPAND and the nearest-imagery button; the viewer's
+ // close. EXPAND's ⤢ ⤡ and the errors' ⚠ are text, not Material symbols.
+ 'StreetLevelPanel.vue': { buttons: 3, icons: 0, closes: 1 },
+};
+const markup = Object.fromEntries(
+ Object.keys(views).map((file) => [file, template(file)]),
+);
+
+test('the Draw, Import and Street Level views hand-write no button', () => {
+ for (const [file, { buttons, closes }] of Object.entries(views)) {
+ const html = markup[file];
+ assert.deepEqual(html.match(/ {
+ for (const [file, html] of Object.entries(markup)) {
+ assert.deepEqual(html.match(/ {
+ for (const [file, { icons }] of Object.entries(views)) {
+ const html = markup[file];
+ assert.deepEqual(html.match(/material-symbols-outlined/g) ?? [], [], file);
+ const found = tags(html, 'UiIcon');
+ assert.equal(found.length, icons, file);
+ // Without it the kit writes an 18px size that beats the site rules.
+ for (const icon of found) assert.match(icon, /\s:size="null"/, file);
+ }
+ // Draw's and Import's glyphs keep pp-icon, which sizes them.
+ for (const file of ['DrawControls.vue', 'GeoImport.vue']) {
+ const [icon] = tags(markup[file], 'UiIcon');
+ assert.match(icon, /\sclass="pp-icon"/, file);
+ }
+});
+
+test('no tag hand-writes aria-pressed; Draw is a pressed toggle with active', () => {
+ for (const [file, html] of Object.entries(markup))
+ assert.doesNotMatch(
+ html,
+ tag(String.raw`<\w+\bATTRS\s:?aria-pressed`),
+ file,
+ );
+ const [draw] = tags(markup['DrawControls.vue'], 'UiButton').filter((b) =>
+ /\sid="draw-toggle"/.test(b),
+ );
+ assert.match(draw, /\s:pressed="draw\?\.active \?\? false"/);
+ assert.match(draw, /\spressed-class="active"/);
+ const [clear] = tags(markup['DrawControls.vue'], 'UiButton').filter((b) =>
+ /\sid="draw-clear"/.test(b),
+ );
+ assert.doesNotMatch(clear, /\s:pressed=/);
+ // A shape's show/hide says what it does in its name, not by being pressed.
+ for (const button of tags(markup['DrawMarkList.vue'], 'UiButton'))
+ assert.doesNotMatch(button, /\s:pressed=/);
+});
+
+test('the colour swatches are radios chosen by aria-checked, never pressed', () => {
+ const [swatch] = tags(markup['DrawSwatches.vue'], 'UiButton');
+ assert.match(swatch, /\srole="radio"/);
+ assert.match(
+ swatch,
+ /\s:aria-checked="String\(color === props\.modelValue\)"/,
+ );
+ assert.match(swatch, /\s:class="\{ active: color === props\.modelValue \}"/);
+ assert.doesNotMatch(swatch, /\s:pressed=|\spressed-class=/);
+});
+
+test('code that focuses a converted button reaches its element', () => {
+ // A template ref on a component holds the component, not the button.
+ assert.match(
+ source('DrawSwatches.vue'),
+ /:ref="\(swatch\) => \(buttons\[index\] = swatch\?\.\$el\)"/,
+ );
+ assert.match(
+ source('GeoImport.vue'),
+ /importButton\.value\?\.\$el\.focus\(\)/,
+ );
+});
diff --git a/src/ui/kit/entityCardControls.test.mjs b/src/ui/kit/entityCardControls.test.mjs
index 5dd3f24587..39406f5709 100644
--- a/src/ui/kit/entityCardControls.test.mjs
+++ b/src/ui/kit/entityCardControls.test.mjs
@@ -31,9 +31,9 @@ const heroViews = [
test('the entity card hand-writes no button; each is a UiButton', () => {
for (const markup of [card, camera, nearby, ...heroViews])
assert.deepEqual(markup.match(/ {
for (const markup of [card, camera, nearby, ...heroViews])
assert.deepEqual(markup.match(/material-symbols-outlined/g) ?? [], []);
const counts = [
- // The preview switch's three, the hero glyph, the header icon, the
- // warning, the route's plane, the route note and the three actions.
- [card, 11],
+ // The preview switch's three, the hero glyph, the header icon, Find
+ // it, the warning, the route's plane, the route note and the three
+ // actions.
+ [card, 12],
// Bigger view, the popup's camera and More info.
[camera, 3],
// The two weather glyphs, five headings and three row glyphs.
diff --git a/src/ui/kit/missionsRadioControls.test.mjs b/src/ui/kit/missionsRadioControls.test.mjs
new file mode 100644
index 0000000000..5604a6517c
--- /dev/null
+++ b/src/ui/kit/missionsRadioControls.test.mjs
@@ -0,0 +1,142 @@
+// The space missions, Contacts, Radio and provider settings controls are the
+// kit's: none of their views hand-writes a , a Material Symbols span,
+// a select or a checkbox. Radio's Enable, the RTL-SDR card's Connect and its
+// FM and ADS-B modes are pressed toggles with `active`; Radio's Play and the
+// card's Locate keep their own `active` class, since their words change
+// with their state rather than saying they are pressed. The RTL-SDR card's
+// FM frequency stays a native number field (the kit has none), and the radio
+// tuner's range stays native: its owner moves the handle back to the
+// selected station on a drag's first input without changing the slot.
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+
+/** A view's template block: everything outside script, style and comments. */
+function template(file) {
+ const source = readFileSync(
+ new URL(`../views/${file}`, import.meta.url),
+ 'utf8',
+ );
+ return source
+ .replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/g, '')
+ .replace(//g, '');
+}
+// A tag's attributes, read past quoted values so a handler's `=>` does not
+// end the tag early.
+const ATTRS = String.raw`(?:[^>"']|"[^"]*"|'[^']*')*`;
+const tag = (pattern, flags = '') =>
+ new RegExp(pattern.replaceAll('ATTRS', ATTRS), flags);
+const tags = (markup, name) =>
+ markup.match(tag(String.raw`<${name}\bATTRS>`, 'g')) ?? [];
+const byId = (markup, name, id) => {
+ const found = tags(markup, name).filter((t) =>
+ new RegExp(String.raw`\sid="${id}"`).test(t),
+ );
+ assert.equal(found.length, 1, id);
+ return found[0];
+};
+
+// Each view's UiButtons, UiCloseButtons, UiIcons, UiSelects and UiSliders.
+const VIEWS = {
+ // FOCUS, REPLAY ASCENT, the replay's pause, PREV, NEXT and SHOW ALL; the
+ // header's deselect and the replay's Cancel close.
+ 'panels/MissionDetail.vue': [6, 2, 0, 0, 1],
+ // A mission's row.
+ 'panels/MissionRoster.vue': [1, 0, 0, 0, 0],
+ 'panels/MissionReplayOverlay.vue': [0, 0, 0, 0, 0],
+ 'panels/SpaceMissionsPanel.vue': [0, 0, 0, 0, 0],
+ // PREV, FOCUS, NEXT and a contact's row.
+ 'panels/AwarenessPanel.vue': [4, 0, 0, 0, 0],
+ 'panels/AwarenessDirection.vue': [0, 0, 0, 0, 0],
+ 'panels/AwarenessNames.vue': [0, 0, 0, 0, 0],
+ // Connect, Locate, Change device, FM, ADS-B, Tune and the two seeks.
+ 'panels/SdrCard.vue': [8, 0, 0, 1, 1],
+ // Enable, PREV, PLAY, NEXT and STOP.
+ 'panels/RadioPanel.vue': [5, 0, 0, 1, 1],
+ 'panels/RadioTuner.vue': [0, 0, 0, 0, 0],
+ // The POWER UP chip and its bolt, a key's REMOVE, the voice auth toggle
+ // and SAVE KEYS; the dialog's close.
+ 'ProviderSettingsView.vue': [4, 1, 1, 0, 0],
+};
+const views = Object.entries(VIEWS).map(([file, counts]) => ({
+ file,
+ markup: template(file),
+ counts,
+}));
+
+test('they hand-write no button; each is a UiButton or UiCloseButton', () => {
+ for (const { file, markup, counts } of views) {
+ assert.deepEqual(markup.match(/ {
+ for (const { file, markup, counts } of views) {
+ assert.deepEqual(
+ markup.match(/material-symbols-outlined/g) ?? [],
+ [],
+ file,
+ );
+ const icons = tags(markup, 'UiIcon');
+ assert.equal(icons.length, counts[2], file);
+ // Without it the kit writes an 18px size that beats the site rules.
+ for (const icon of icons) assert.match(icon, /\s:size="null"/, file);
+ }
+});
+
+test('their selects and ranges are the kit’s, apart from the tuner', () => {
+ for (const { file, markup, counts } of views) {
+ assert.deepEqual(markup.match(/
+ /\stype="range"/.test(i),
+ );
+ assert.equal(ranges.length, file === 'panels/RadioTuner.vue' ? 1 : 0, file);
+ }
+});
+
+test('no tag hand-writes aria-pressed; the pressed toggles take :pressed', () => {
+ const pressed = {
+ 'panels/MissionDetail.vue': 1,
+ 'panels/SdrCard.vue': 3,
+ 'panels/RadioPanel.vue': 1,
+ };
+ for (const { file, markup } of views) {
+ assert.doesNotMatch(
+ markup,
+ tag(String.raw`<\w+\bATTRS\s(?:v-bind)?:?aria-pressed`),
+ file,
+ );
+ const toggles = tags(markup, 'UiButton').filter((b) =>
+ /\s:pressed=/.test(b),
+ );
+ assert.equal(toggles.length, pressed[file] ?? 0, file);
+ }
+ const sdr = views.find((v) => v.file === 'panels/SdrCard.vue').markup;
+ const radio = views.find((v) => v.file === 'panels/RadioPanel.vue').markup;
+ for (const [markup, id] of [
+ [sdr, 'sdr-connect-btn'],
+ [sdr, 'sdr-mode-fm-btn'],
+ [sdr, 'sdr-mode-adsb-btn'],
+ [radio, 'radio-enable-btn'],
+ ])
+ assert.match(byId(markup, 'UiButton', id), /\spressed-class="active"/, id);
+});
+
+test('Play and Locate keep their own active class rather than pressed', () => {
+ const sdr = views.find((v) => v.file === 'panels/SdrCard.vue').markup;
+ const radio = views.find((v) => v.file === 'panels/RadioPanel.vue').markup;
+ for (const [markup, id] of [
+ [radio, 'radio-play-btn'],
+ [sdr, 'sdr-locate-btn'],
+ ]) {
+ const button = byId(markup, 'UiButton', id);
+ assert.doesNotMatch(button, /\s:pressed=/, id);
+ assert.match(button, /\sv-class-toggle="\{ active: /, id);
+ }
+});
diff --git a/src/ui/kit/streetLevelPhotoControls.test.mjs b/src/ui/kit/streetLevelPhotoControls.test.mjs
new file mode 100644
index 0000000000..1c65279af4
--- /dev/null
+++ b/src/ui/kit/streetLevelPhotoControls.test.mjs
@@ -0,0 +1,182 @@
+// The Street Level photo viewer (KartaView, Panoramax) is a view with kit
+// controls: StreetLevelPhotoViewer draws what the photo viewer presents and
+// hand-writes no and no Material Symbols span; its ‹ › are ghost
+// UiButtons, not pressed toggles, whose glyphs are text characters. The
+// photo viewer builds no element of its own, and the street-level layer it
+// belongs to needs no Vue: the application shell publishes its
+// presentation to the store the view renders.
+import { test } from 'node:test';
+import assert from 'node:assert/strict';
+import { readFileSync } from 'node:fs';
+
+const read = (file) =>
+ readFileSync(new URL(`../../${file}`, import.meta.url), 'utf8');
+/** The template block: everything outside script, style and comments. */
+const template = (file) =>
+ read(file)
+ .replace(/<(script|style)\b[\s\S]*?<\/\1\s*>/g, '')
+ .replace(//g, '');
+// An opening tag's attributes, quoted values may hold `>` (`() => x`).
+const ATTRS = String.raw`(?:[^>"']|"[^"]*"|'[^']*')*`;
+const tags = (markup, name) =>
+ markup.match(new RegExp(String.raw`<${name}\b${ATTRS}>`, 'g')) ?? [];
+// An attribute's name, outside the quoted values.
+const names = (attrs) => attrs.replace(/"[^"]*"|'[^']*'/g, '""');
+
+const VIEW = 'ui/views/panels/StreetLevelPhotoViewer.vue';
+const VIEWER = 'layers/streetLevel/photoViewer.js';
+
+test('the photo viewer hand-writes no button; ‹ and › are kit buttons', () => {
+ const markup = template(VIEW);
+ assert.deepEqual(markup.match(/ {
+ const markup = template(VIEW);
+ assert.deepEqual(markup.match(/material-symbols/g) ?? [], [], VIEW);
+ assert.equal(tags(markup, 'UiIcon').length, 0);
+ // ‹ and › are text characters.
+ assert.match(markup, />‹<\/UiButton\s*>/);
+ assert.match(markup, />›<\/UiButton\s*>/);
+});
+
+test('the step buttons are not pressed toggles', () => {
+ const markup = template(VIEW);
+ for (const [tag, attrs] of markup.matchAll(
+ new RegExp(String.raw`<[A-Za-z][\w-]*\b(${ATTRS})>`, 'g'),
+ )) {
+ assert.doesNotMatch(
+ names(attrs),
+ /(?:^|\s)(?::|v-bind:)?aria-pressed(?=[\s=/]|$)/,
+ tag,
+ );
+ assert.doesNotMatch(
+ attrs,
+ /(?:^|\s)(?:v-bind|:)=(?:"[^"]*aria-?pressed[^"]*"|'[^']*aria-?pressed[^']*')/i,
+ tag,
+ );
+ assert.doesNotMatch(names(attrs), /(?:^|\s)(?::|v-bind:)?pressed\b/, tag);
+ }
+});
+
+/**
+ * `loadImage`, which downloads through an Image of its own that is never on
+ * the page: the one place a `.src` is written.
+ */
+const LOADER = /^export function loadImage\([\s\S]*?^}$/m;
+// An assignment, plain or compound (`=`, `+=`, `||=`, `??=`, `**=`…), not
+// a comparison or an arrow.
+const ASSIGN = String.raw`\s*(?:[-+*/%&|^]|\*\*|<<|>>>?|&&|\|\||\?\?)?=(?![=>])`;
+const assigned = (target, flags = '') =>
+ new RegExp(String.raw`${target}${ASSIGN}`, flags);
+// A member or computed member: what a destructuring write must not target.
+const MEMBER = /[\w$)\]]\s*(?:\.\s*[\w$]|\[)/;
+
+test('the photo viewer is drawn by its view, and its layer needs no Vue', () => {
+ const source = read(VIEWER);
+ const loader = source.match(LOADER)?.[0];
+ assert.ok(loader, 'loadImage is found');
+ const rest = source.replace(LOADER, '');
+ // No element made, inserted, moved, removed or written: the view does
+ // all of that. (The panorama renderer in panorama.js sizes its canvas's
+ // drawing buffer, as WebGL drawing does; nothing here does.)
+ for (const write of [
+ /createElement/,
+ /\b(?:inner|outer)HTML\b/,
+ /insertAdjacent(?:HTML|Element|Text)/,
+ /\.(?:append|prepend|appendChild|insertBefore|replaceWith|replaceChildren|before|after)\(/,
+ /\.remove\(\)/,
+ /\.(?:set|remove|toggle)Attribute(?:NS)?\(/,
+ /\.(?:classList|className|dataset|style)\b/,
+ assigned(
+ String.raw`\.(?:hidden|disabled|textContent|innerText|tabIndex|title|alt)`,
+ ),
+ assigned(String.raw`\.(?:width|height|ariaLabel|id|value)`),
+ // Properties written in bulk or by reflection (an Error's own fields
+ // aside).
+ /\bObject\.assign\(\s*(?!new Error\()/,
+ /\bObject\.definePropert(?:y|ies)\(/,
+ /\bReflect\.(?:set|defineProperty)\(/,
+ /from 'vue'|\.vue'/,
+ ])
+ assert.doesNotMatch(source, write);
+ // No property written through brackets (`picture['src'] = …`,
+ // `el[name] ||= …`), outside array destructuring declarations.
+ assert.doesNotMatch(
+ source.replace(/\b(?:const|let|var)\s*\[/g, ''),
+ assigned(String.raw`[\w$)\]]\s*\[[^[\]]*\]`),
+ 'a bracket write',
+ );
+ // No destructuring write to a property (`[el.src] = …`,
+ // `({ a: el.id } = …)`); declarations bind names only.
+ for (const pattern of [
+ /(?])/g,
+ /(?])/g,
+ ])
+ for (const [write, targets] of source.matchAll(pattern))
+ assert.doesNotMatch(targets, MEMBER, write);
+ const SRC = assigned(String.raw`\.src`, 'g');
+ assert.doesNotMatch(rest, SRC, 'a .src written on the page');
+ // In loadImage, only on the off-page Image it creates: `image` is bound
+ // once, to that Image, and never rebound or shadowed.
+ assert.match(loader, /\bconst image = new Image\(\);/);
+ assert.equal(
+ loader.match(/\b(?:const|let|var|function|class)\s+image\b/g)?.length,
+ 1,
+ 'one binding of image',
+ );
+ for (const rebinding of [
+ assigned(String.raw`(?/,
+ /\((?:[^()]*[,{[\s(])?image\b[^()]*\)\s*=>/,
+ /\bfunction\b[^(]*\((?:[^)]*[,{[\s(])?image\b[^)]*\)/,
+ /\b(?:const|let|var)\s*[{[][^=]*\bimage\b/,
+ /\bcatch\s*\([^)]*\bimage\b/,
+ ])
+ assert.doesNotMatch(loader, rebinding, 'image rebound or shadowed');
+ const writes = loader.match(SRC)?.length ?? 0;
+ assert.equal(
+ loader.match(assigned(String.raw`(?
+ new RegExp(String.raw`<${name}\b${ATTRS}\s${attribute}${ATTRS}>`);
+ for (const part of [
+ opening('div', 'class="sl-photo-viewer"'),
+ opening('img', 'class="sl-photo-flat"'),
+ opening('canvas', ':key="photo.canvasKey"'),
+ opening('canvas', 'class="sl-photo-pano"'),
+ ])
+ assert.match(markup, part);
+ const groups = JSON.parse(
+ readFileSync(
+ new URL('../../../scripts/package-boundaries.json', import.meta.url),
+ 'utf8',
+ ),
+ );
+ const layer = groups['street-level-layer'];
+ assert.ok(layer.modules.includes(`src/${VIEWER}`));
+ assert.equal(layer.external.includes('vue'), false);
+ assert.equal(
+ layer.modules.some((module) => module.endsWith('.vue')),
+ false,
+ );
+});
diff --git a/src/ui/kit/viewControls.test.mjs b/src/ui/kit/viewControls.test.mjs
index ec2c708dd5..7ef7d42ba2 100644
--- a/src/ui/kit/viewControls.test.mjs
+++ b/src/ui/kit/viewControls.test.mjs
@@ -1,10 +1,14 @@
// The kit's every-control claims in docs/VUE-MIGRATION.md, read from every
-// SFC outside the kit: every select is a UiSelect, every pressed toggle a
-// UiButton with `pressed` (no template hand-writes `aria-pressed` on any
-// element, as an attribute or inside a `v-bind` object, apart from the
-// exceptions below), and every close, dismiss and clear button a
-// UiCloseButton.
-// Controls built in script are not read here.
+// SFC outside the kit: every button is a kit button, every select a
+// UiSelect, every checkbox a UiCheckbox, every range a UiSlider apart from
+// the two named below, and every Material Symbols glyph a UiIcon; every
+// pressed toggle is a UiButton with `pressed` (no template hand-writes
+// `aria-pressed` on any element, as an attribute or inside a `v-bind`
+// object, apart from the exceptions below), and every close, dismiss and
+// clear button a UiCloseButton. Outside the kit, no module (nor an SFC's
+// script) builds a button, select, field or Material glyph in script, or
+// writes one as markup in a string, apart from the globe panel's standalone
+// page named below.
import { test } from 'node:test';
import assert from 'node:assert/strict';
import { readFileSync, readdirSync } from 'node:fs';
@@ -18,9 +22,6 @@ const REPO_ROOT = path.resolve(SRC_ROOT, '..');
// The pressed toggles that still hand-write `aria-pressed`, by file: each
// pattern matches exactly one of the file's tags, and no other tag may.
const HAND_WRITTEN_PRESSED = {
- // The cinematic button renders the attributes the Bhote Koshi layer
- // writes for it, `aria-pressed` among them.
- 'src/ui/views/panels/BhoteKoshiPanel.vue': [/^ markup.replace(/\s+/g, ' ');
+// The two ranges that stay native, by file (docs/VUE-MIGRATION.md says why).
+const NATIVE_RANGES = {
+ 'src/ui/views/panels/RadioTuner.vue': 1,
+ 'src/ui/views/panels/WorldTimeline.vue': 1,
+};
+const RAW_BUTTON = /`, 'gi');
+// An attribute and its value, read from the tag rather than other values.
+const ATTRIBUTE = /([^\s=/]+)(?:\s*=\s*(?:"([^"]*)"|'([^']*)'|([^\s"'/>]+)))?/g;
+/**
+ * A tag's `type`: written, bound to a quoted literal (`:type="'checkbox'"`),
+ * or named in a `v-bind` object; null when it is bound to anything else.
+ */
+function inputType(attrs) {
+ for (const m of attrs.matchAll(ATTRIBUTE)) {
+ const name = m[1].toLowerCase();
+ const value = m[2] ?? m[3] ?? m[4] ?? '';
+ if (name === 'type') return value.toLowerCase();
+ if (name === ':type' || name === 'v-bind:type') {
+ const literal = /^\s*(['`])([^'`]*)\1\s*$/.exec(value);
+ if (literal) return literal[2].toLowerCase();
+ }
+ if (name === 'v-bind' || name === ':') {
+ const named = /\btype\s*:\s*(['`])([^'`]*)\1/.exec(value);
+ if (named) return named[2].toLowerCase();
+ }
+ }
+ return null;
+}
+
+/** Hand-written buttons in an SFC's template. */
+const rawButtons = (source) =>
+ [...template(source).matchAll(RAW_BUTTON)].map((m) => m[0]);
+
+/** Tags in an SFC's template that draw a Material glyph by hand. */
+function materialGlyphs(source) {
+ const found = [];
+ for (const m of template(source).matchAll(ANY_TAG))
+ if (!/^
+ [...template(source).matchAll(INPUT_TAG)]
+ .filter((m) => inputType(m[1]) === type)
+ .map((m) => tidy(m[0]));
+
/** Raw selects in an SFC's template. */
const rawSelects = (source) =>
[...template(source).matchAll(RAW_SELECT)].map((m) => m[0]);
@@ -137,6 +191,82 @@ test('the scans find each hand-written control', () => {
assert.equal(handWrittenCloses(markup).length, 0, markup);
});
+test('the scans find each hand-written button, glyph, checkbox and range', () => {
+ for (const markup of [
+ 'A ',
+ 'A ',
+ ])
+ assert.equal(rawButtons(markup).length, 1, markup);
+ for (const markup of [
+ 'A ',
+ '
',
+ '
',
+ ])
+ assert.equal(rawButtons(markup).length, 0, markup);
+
+ for (const markup of [
+ 'search ',
+ 'add ',
+ 'add ',
+ 'add ',
+ ])
+ assert.equal(materialGlyphs(markup).length, 1, markup);
+ for (const markup of [
+ ' ',
+ 'search ',
+ '
',
+ ])
+ assert.equal(materialGlyphs(markup).length, 0, markup);
+
+ assert.equal(
+ nativeInputs(
+ ' ',
+ 'checkbox',
+ ).length,
+ 1,
+ );
+ assert.equal(
+ nativeInputs(
+ ' ',
+ 'range',
+ ).length,
+ 1,
+ );
+ assert.equal(
+ nativeInputs(
+ ' ',
+ 'checkbox',
+ ).length,
+ 0,
+ );
+ assert.equal(
+ nativeInputs(
+ 'A ',
+ 'checkbox',
+ ).length,
+ 0,
+ );
+ for (const markup of [
+ ` `,
+ ` `,
+ ` `,
+ ' ',
+ ' ',
+ ])
+ assert.equal(nativeInputs(markup, 'checkbox').length, 1, markup);
+ assert.equal(
+ nativeInputs(' ', 'checkbox')
+ .length,
+ 0,
+ );
+ assert.equal(
+ materialGlyphs(
+ `add `,
+ ).length,
+ 1,
+ );
+});
+
test('the views are read: the scan reaches the views and skips the kit', () => {
const files = views.map((view) => view.file);
assert.ok(files.includes('src/ui/views/panels/ChatPanel.vue'));
@@ -172,3 +302,138 @@ test('no view hand-writes a close button; each is a UiCloseButton', () => {
found.push(`${file}: ${markup}`);
assert.deepEqual(found, []);
});
+
+test('every button in the views is a kit button', () => {
+ const found = [];
+ for (const { file, source } of views)
+ for (const markup of rawButtons(source)) found.push(`${file}: ${markup}`);
+ assert.deepEqual(found, []);
+});
+
+test('every Material Symbols glyph in the views is a UiIcon', () => {
+ const found = [];
+ for (const { file, source } of views)
+ for (const markup of materialGlyphs(source))
+ found.push(`${file}: ${markup}`);
+ assert.deepEqual(found, []);
+});
+
+test('every checkbox in the views is a UiCheckbox', () => {
+ const found = [];
+ for (const { file, source } of views)
+ for (const markup of nativeInputs(source, 'checkbox'))
+ found.push(`${file}: ${markup}`);
+ assert.deepEqual(found, []);
+});
+
+test('every range in the views is a UiSlider apart from the two named', () => {
+ const counts = {};
+ for (const { file, source } of views) {
+ const n = nativeInputs(source, 'range').length;
+ if (n) counts[file] = n;
+ }
+ assert.deepEqual(counts, NATIVE_RANGES);
+});
+
+// The globe panel's standalone page: plain HTML a host serves, with no Vue
+// and no kit, so its two buttons are written as markup.
+const STRING_MARKUP_PAGES = new Set(['src/tools/globePanel.js']);
+
+/**
+ * Every module under src outside the kit, tests and test support, and every
+ * SFC's script blocks, as `{ file, source }`.
+ */
+function scriptSources(directory = SRC_ROOT) {
+ const found = [];
+ for (const entry of readdirSync(directory, { withFileTypes: true })) {
+ const absolute = path.join(directory, entry.name);
+ const file = path.relative(REPO_ROOT, absolute).split(path.sep).join('/');
+ if (entry.isDirectory()) {
+ if (
+ path.relative(KIT_ROOT, absolute) !== '' &&
+ entry.name !== 'testSupport'
+ )
+ found.push(...scriptSources(absolute));
+ } else if (
+ !entry.isFile() ||
+ /\.test\.(?:js|mjs|ts)$|Fixture\.mjs$/.test(entry.name)
+ ) {
+ continue;
+ } else if (/\.(?:js|mjs|ts)$/.test(entry.name)) {
+ found.push({ file, source: readFileSync(absolute, 'utf8') });
+ } else if (entry.name.endsWith('.vue')) {
+ const blocks = [
+ ...readFileSync(absolute, 'utf8').matchAll(
+ /
-
+
diff --git a/src/ui/views/panels/DrawSwatches.vue b/src/ui/views/panels/DrawSwatches.vue
index 2cbe30b213..2d2d221576 100644
--- a/src/ui/views/panels/DrawSwatches.vue
+++ b/src/ui/views/panels/DrawSwatches.vue
@@ -6,11 +6,15 @@ import {
DRAW_COLOR_CSS,
DRAW_COLOR_NAMES,
} from '../../../annotations/drawMarks.js';
+import UiButton from '../../kit/UiButton.vue';
// Draw's five colours as one radio group: the next shape's colour and a
// drawn shape's picker. Only the checked colour is a tab stop; the arrows,
// Home and End move to and choose another, as a radio group's do. Each swatch
// shows its colour from DRAW_COLOR_CSS, the same value the shape is drawn in.
+// The swatches are ghost UiButtons with role="radio": they say they are
+// chosen with aria-checked and their own `active` class, never aria-pressed,
+// and `buttons` keeps their elements for the arrows.
// The template is one line: templates keep whitespace.
const props = defineProps({
modelValue: { type: String, default: 'primary' },
@@ -44,5 +48,5 @@ onMounted(() => {
-
+
diff --git a/src/ui/views/panels/EntityCard.vue b/src/ui/views/panels/EntityCard.vue
index fd787d97fc..f76d28c926 100644
--- a/src/ui/views/panels/EntityCard.vue
+++ b/src/ui/views/panels/EntityCard.vue
@@ -26,7 +26,7 @@ const props = defineProps({
withContacts: Boolean,
});
const store = useEntityCardStore();
-const { card, lost, tick } = storeToRefs(store);
+const { card, lost, tick, away, finding, located } = storeToRefs(store);
// Cameras carry only an id; the CCTV panel's store knows the picked one's name.
const { frame: cctvFrame } = storeToRefs(useCctvStore());
const shownTitle = computed(() => {
@@ -56,6 +56,15 @@ const status = computed(() => {
void tick.value;
const current = card.value;
if (!current) return null;
+ if (finding.value === 'finding') return { tone: 'aged', text: t('Finding it…') };
+ if (finding.value === 'none') return { tone: 'lost', text: t('No reading at this time') };
+ if (lost.value && located.value)
+ return {
+ tone: 'aged',
+ text: t('Last reading · {age}', {
+ age: ago(Math.max(0, located.value.atMs - located.value.observedAtMs)),
+ }),
+ };
if (lost.value) return { tone: 'lost', text: t('Out of feed · last reading') };
if (current.observedAgeMs !== null)
return {
@@ -399,6 +408,7 @@ watch(
{{ shownTitle }}
{{ subtitle }}
+
diff --git a/src/ui/views/panels/GeoImport.vue b/src/ui/views/panels/GeoImport.vue
index ce26dae9c2..ce04e92f64 100644
--- a/src/ui/views/panels/GeoImport.vue
+++ b/src/ui/views/panels/GeoImport.vue
@@ -56,16 +56,16 @@ function leave() {
other.querySelector('button');
if (target) return target.focus();
}
- importButton.value?.focus();
+ importButton.value?.$el.focus();
}
-
- upload_file
+
+
{{ t('Import') }}
-
+
{{ geoImport?.hint ?? '' }}
diff --git a/src/ui/views/panels/MissionDetail.vue b/src/ui/views/panels/MissionDetail.vue
index 71feb9df30..f356876b1a 100644
--- a/src/ui/views/panels/MissionDetail.vue
+++ b/src/ui/views/panels/MissionDetail.vue
@@ -68,18 +68,18 @@ watch(
0.25× 1× 4×
-
{{ t('FOCUS') }}
+
{{ t('FOCUS') }}
{{ t('REPLAY ASCENT') }}
- {{ m ? m.replay.toggleText : 'Ⅱ' }}
+ {{ m ? m.replay.toggleText : 'Ⅱ' }}
- ‹ {{ t('PREV') }}
+ ‹ {{ t('PREV') }}
{{ m ? m.index : '—' }}
- {{ t('NEXT') }} ›
+ {{ t('NEXT') }} ›
- {{ t('SHOW ALL / DESELECT') }}
+ {{ t('SHOW ALL / DESELECT') }}
diff --git a/src/ui/views/panels/MissionRoster.vue b/src/ui/views/panels/MissionRoster.vue
index 8c6a6aa130..39eaaae3ab 100644
--- a/src/ui/views/panels/MissionRoster.vue
+++ b/src/ui/views/panels/MissionRoster.vue
@@ -3,6 +3,7 @@ import { storeToRefs } from 'pinia';
import { onBeforeUpdate, onUpdated, ref } from 'vue';
import { t } from '../../../i18n/index.js';
import { useSpaceMissionsStore } from '../../stores/spaceMissions.js';
+import UiButton from '../../kit/UiButton.vue';
import UiEmpty from '../../kit/UiEmpty.vue';
// The Space Missions roster. The launches layer presents it; until it does,
@@ -72,7 +73,7 @@ onUpdated(() => {
- {{ entry.label }} {{ entry.provider }} · {{ entry.date }} ›
+ {{ entry.label }} {{ entry.provider }} · {{ entry.date }} ›
{{ t('TAB PREVIEWS · ENTER / SPACE SELECTS') }}
diff --git a/src/ui/views/panels/Omnibar.vue b/src/ui/views/panels/Omnibar.vue
index 8e08b8d70e..9bdcd2e1c6 100644
--- a/src/ui/views/panels/Omnibar.vue
+++ b/src/ui/views/panels/Omnibar.vue
@@ -1347,10 +1347,14 @@ small {
calc(var(--mobile-sheet-cover, 0px) + 6px)
);
left: auto;
- inset-inline: 16px 60px;
+ inset-inline: 16px;
width: auto;
transform: none;
}
+/* The language picker sits at the right edge beside the field; the field leaves it room. */
+:global(body.mobile-shell:has(#locale-picker) #gev-omnibar) {
+ inset-inline: 16px 60px;
+}
/* A lifted timeline leaves less map above the credits on short phones. */
@media (max-height: 480px) {
:global(body.mobile-shell:has(#world-timeline) #gev-omnibar) {
diff --git a/src/ui/views/panels/RadioPanel.vue b/src/ui/views/panels/RadioPanel.vue
index 67a8f75439..6bd5e4e8ec 100644
--- a/src/ui/views/panels/RadioPanel.vue
+++ b/src/ui/views/panels/RadioPanel.vue
@@ -52,10 +52,10 @@ const radioWords = computed(() => ({
- {{ t('PREV') }}
- {{ radio ? radio.transport.play.text : t('PLAY') }}
- {{ t('NEXT') }}
- {{ t('STOP') }}
+ {{ t('PREV') }}
+ {{ radio ? radio.transport.play.text : t('PLAY') }}
+ {{ t('NEXT') }}
+ {{ t('STOP') }}
{{ t('VOLUME') }}
diff --git a/src/ui/views/panels/SdrCard.vue b/src/ui/views/panels/SdrCard.vue
index 6418f0f6cc..6baae48c4a 100644
--- a/src/ui/views/panels/SdrCard.vue
+++ b/src/ui/views/panels/SdrCard.vue
@@ -32,8 +32,8 @@ const tune = () => act('tuneSdr', frequency.value.value);
{{ t('Chrome/Edge · WebUSB · one local tuner shared by FM and the Local ADS-B layer.') }}
{{ sdr ? sdr.connectLabel : t('CONNECT') }}
- {{ sdr ? sdr.locateLabel : t('LOCATE') }}
- {{ t('CHANGE DEVICE') }}
+ {{ sdr ? sdr.locateLabel : t('LOCATE') }}
+ {{ t('CHANGE DEVICE') }}
FM
@@ -55,11 +55,11 @@ const tune = () => act('tuneSdr', frequency.value.value);
{{ t('FM MHZ') }}
- {{ t('TUNE') }}
+ {{ t('TUNE') }}
- {{ t('◀ SEEK') }}
- {{ t('SEEK ▶') }}
+ {{ t('◀ SEEK') }}
+ {{ t('SEEK ▶') }}
{{ t('SDR VOL') }}
diff --git a/src/ui/views/panels/StreetLevelPhotoViewer.test.mjs b/src/ui/views/panels/StreetLevelPhotoViewer.test.mjs
new file mode 100644
index 0000000000..41bc0c37ad
--- /dev/null
+++ b/src/ui/views/panels/StreetLevelPhotoViewer.test.mjs
@@ -0,0 +1,304 @@
+// The Street Level photo viewer (KartaView, Panoramax) on a page: the photo
+// viewer presents it, the store carries it, and StreetLevelPhotoViewer draws
+// it into the viewer host, forwards its events and hands its elements back.
+import '../../../testSupport/registerDom.mjs';
+import test from 'node:test';
+import assert from 'node:assert/strict';
+import { createApp, nextTick } from 'vue';
+import { createPinia } from 'pinia';
+import { createPhotoViewer } from '../../../layers/streetLevel/photoViewer.js';
+import { subscribePhotoViewers } from '../../../layers/streetLevel/photoViewers.js';
+import { useStreetLevelPhotoStore } from '../../stores/streetLevelPhoto.js';
+import StreetLevelPhotoViewer from './StreetLevelPhotoViewer.vue';
+
+const PHOTOS = {
+ f: { id: 'f', sequenceId: 's', lon: 1, lat: 2, heading: 0, isPano: false },
+ g: { id: 'g', sequenceId: 's', lon: 1, lat: 2, heading: 0, isPano: false },
+ p: { id: 'p', sequenceId: 's', lon: 1, lat: 2, heading: 0, isPano: true },
+};
+const SOURCES = {
+ hasPano: (photo) => photo.isPano,
+ panoFirst: (photo) => ({ url: `${photo.id}-pano`, width: 2048 }),
+ panoSharp: () => null,
+ flatFirst: (photo) => [`https://photos.test/${photo.id}.jpg`],
+ flatSharp: () => null,
+ describe: () => ({ externalUrl: 'https://example.org' }),
+};
+
+/**
+ * The view in an app, a viewer per provider published to its store as the
+ * street-level layer does, and a panel host.
+ */
+function mount(t, options = {}, providerIds = ['panoramax']) {
+ document.body.replaceChildren();
+ const wrap = document.body.appendChild(document.createElement('div'));
+ wrap.className = 'sl-viewer-wrap';
+ const host = wrap.appendChild(document.createElement('div'));
+ host.id = 'sl-viewer';
+ const pinia = createPinia();
+ const app = createApp(StreetLevelPhotoViewer).use(pinia);
+ app.mount(document.body.appendChild(document.createElement('div')));
+ const store = useStreetLevelPhotoStore(pinia);
+ const renderers = [];
+ const stepped = [];
+ const create = (providerId) =>
+ createPhotoViewer({
+ providerId,
+ name: providerId === 'panoramax' ? 'Panoramax' : 'KartaView',
+ sources: SOURCES,
+ getPhoto: async (id) => PHOTOS[id],
+ // f, then g: the whole sequence.
+ step: async (photo, delta) =>
+ ({ f: { 1: 'g' }, g: { '-1': 'f' } })[photo.id]?.[delta] ?? null,
+ onStep: (id) => stepped.push(id),
+ load: async (url) => ({ src: url }),
+ createRenderer: (canvas) => {
+ const view = { yaw: 0, pitch: 0, fov: 80 };
+ const renderer = {
+ canvas,
+ setImage() {},
+ setView: (next) => Object.assign(view, next),
+ getView: () => ({ ...view }),
+ resize() {},
+ clear() {},
+ destroy() {},
+ };
+ renderers.push(renderer);
+ return renderer;
+ },
+ ...options,
+ });
+ const viewers = providerIds.map(create);
+ const unsubscribe = subscribePhotoViewers(viewers, (view) =>
+ store.publish(view),
+ );
+ t.after(() => {
+ for (const viewer of viewers) viewer.unmount();
+ unsubscribe();
+ app.unmount();
+ });
+ return { viewer: viewers[0], viewers, host, wrap, renderers, stepped };
+}
+
+const tick = () => new Promise((resolve) => setTimeout(resolve, 0));
+
+test('the viewer draws in its host with the markup its stylesheet reads', async (t) => {
+ const { viewer, host } = mount(t);
+ await viewer.mount(host);
+ const root = host.querySelector(':scope > .sl-photo-viewer');
+ assert.ok(root, 'drawn in the host');
+ assert.equal(root.dataset.provider, 'panoramax');
+ assert.equal(root.getAttribute('tabindex'), '0');
+ assert.equal(root.getAttribute('role'), 'group');
+ assert.match(root.getAttribute('aria-label'), /^Panoramax photo\. ← and →/);
+ assert.equal(root.hasAttribute('data-kind'), false, 'nothing shown yet');
+ const [picture, canvas, prev, next] = root.children;
+ assert.equal(picture.tagName, 'IMG');
+ assert.equal(picture.className, 'sl-photo-flat');
+ assert.equal(picture.getAttribute('alt'), 'Panoramax street-level photo');
+ assert.equal(picture.getAttribute('draggable'), 'false');
+ assert.equal(picture.hidden, true);
+ assert.equal(picture.hasAttribute('src'), false);
+ assert.equal(picture.style.objectFit, 'contain');
+ assert.equal(canvas.tagName, 'CANVAS');
+ assert.equal(canvas.className, 'sl-photo-pano');
+ assert.equal(canvas.hidden, true);
+ for (const [button, side, glyph, label] of [
+ [prev, 'prev', '‹', 'Previous photo in this sequence (←)'],
+ [next, 'next', '›', 'Next photo in this sequence (→)'],
+ ]) {
+ assert.equal(button.tagName, 'BUTTON');
+ assert.equal(button.type, 'button');
+ assert.ok(button.classList.contains('sl-photo-step'));
+ assert.ok(button.classList.contains(`sl-photo-step-${side}`));
+ assert.equal(button.textContent.trim(), glyph);
+ assert.equal(button.getAttribute('aria-label'), label);
+ assert.equal(button.getAttribute('title'), label);
+ assert.equal(button.disabled, true);
+ assert.equal(button.hasAttribute('aria-pressed'), false);
+ }
+ viewer.setRenderMode('fill');
+ await nextTick();
+ assert.equal(picture.style.objectFit, 'cover');
+ viewer.unmount();
+ await nextTick();
+ assert.equal(host.children.length, 0, 'unmounted: gone from the host');
+});
+
+test('a flat photo shows, ‹ › and ← → step along its sequence, and close hides it', async (t) => {
+ const { viewer, host, stepped } = mount(t);
+ await viewer.mount(host);
+ await viewer.open('f');
+ await nextTick();
+ const root = host.querySelector('.sl-photo-viewer');
+ const [picture, canvas, prev, next] = root.children;
+ assert.equal(root.dataset.kind, 'flat');
+ assert.equal(picture.hidden, false);
+ assert.equal(canvas.hidden, true);
+ assert.equal(picture.getAttribute('src'), 'https://photos.test/f.jpg');
+ // ‹ is disabled once its end is known; › stays.
+ await tick();
+ await nextTick();
+ assert.equal(prev.disabled, true);
+ assert.equal(next.disabled, false);
+ let bubbled = 0;
+ host.addEventListener('click', () => bubbled++);
+ next.click();
+ await tick();
+ assert.deepEqual(stepped, ['g']);
+ assert.equal(bubbled, 0, 'the click stays in the viewer');
+ await viewer.open('g');
+ root.dispatchEvent(
+ new KeyboardEvent('keydown', { key: 'ArrowLeft', bubbles: true }),
+ );
+ await tick();
+ assert.deepEqual(stepped, ['g', 'f']);
+ viewer.close();
+ await nextTick();
+ assert.equal(root.dataset.kind, '');
+ assert.equal(picture.hidden, true);
+ assert.equal(picture.hasAttribute('src'), false);
+});
+
+test('a step button that disables under the keyboard hands focus to the viewer', async (t) => {
+ // The sequence's end is known only once the user is on ›.
+ let answer;
+ const asked = new Promise((resolve) => (answer = resolve));
+ const { viewer, host } = mount(t, {
+ step: async (photo, delta) => (delta > 0 ? asked : null),
+ });
+ await viewer.mount(host);
+ await viewer.open('g');
+ await nextTick();
+ const root = host.querySelector('.sl-photo-viewer');
+ const next = root.children[3];
+ assert.equal(next.disabled, false);
+ next.focus();
+ assert.ok(document.activeElement === next, 'on ›');
+ answer(null);
+ await tick();
+ await nextTick();
+ assert.equal(next.disabled, true, 'g is the last photo');
+ assert.ok(document.activeElement === root, 'focus moved to the viewer');
+});
+
+test('a panorama draws on the view’s canvas; drag, wheel and a lost context reach the viewer', async (t) => {
+ const { viewer, host, renderers } = mount(t);
+ await viewer.mount(host);
+ await viewer.open('p');
+ await nextTick();
+ const root = host.querySelector('.sl-photo-viewer');
+ const canvas = root.children[1];
+ assert.ok(renderers[0].canvas === canvas, 'the canvas the view drew');
+ assert.equal(root.dataset.kind, 'pano');
+ assert.equal(canvas.hidden, false);
+ assert.equal(root.children[0].hidden, true);
+ canvas.dispatchEvent(
+ new PointerEvent('pointerdown', {
+ pointerId: 1,
+ pointerType: 'mouse',
+ button: 0,
+ clientX: 0,
+ clientY: 0,
+ }),
+ );
+ await nextTick();
+ assert.ok(canvas.classList.contains('sl-photo-dragging'));
+ canvas.dispatchEvent(new PointerEvent('pointerup', { pointerId: 1 }));
+ await nextTick();
+ assert.equal(canvas.classList.contains('sl-photo-dragging'), false);
+ const wheel = new WheelEvent('wheel', { deltaY: 100, cancelable: true });
+ canvas.dispatchEvent(wheel);
+ assert.equal(wheel.defaultPrevented, true, 'the page does not scroll');
+ assert.ok(renderers[0].getView().fov > 80, 'zoomed out');
+ // A lost context: a fresh canvas in its place, which the next renderer takes.
+ canvas.dispatchEvent(new Event('webglcontextlost', { cancelable: true }));
+ await nextTick();
+ const fresh = root.children[1];
+ assert.ok(fresh !== canvas, 'a new canvas');
+ assert.equal(fresh.className, 'sl-photo-pano');
+ assert.equal(canvas.isConnected, false, 'the lost one is gone');
+ await viewer.open('p');
+ assert.ok(renderers[1].canvas === fresh, 'the next renderer takes it');
+});
+
+test('docked, Esc in the viewer’s box is offered to the provider first', async (t) => {
+ let asked = 0;
+ const { viewer, host } = mount(t, { onEscape: () => ++asked > 0 });
+ await viewer.mount(host);
+ const root = host.querySelector('.sl-photo-viewer');
+ const escape = new KeyboardEvent('keydown', {
+ key: 'Escape',
+ bubbles: true,
+ cancelable: true,
+ });
+ let reachedPage = false;
+ document.body.addEventListener('keydown', () => (reachedPage = true));
+ root.dispatchEvent(escape);
+ assert.equal(asked, 1);
+ assert.equal(escape.defaultPrevented, true);
+ assert.equal(reachedPage, false, 'the panel does not collapse');
+});
+
+test('without a view, the viewer cannot mount', async () => {
+ const viewer = createPhotoViewer({
+ providerId: 'test',
+ name: 'Test',
+ sources: SOURCES,
+ getPhoto: async (id) => PHOTOS[id],
+ step: async () => null,
+ onStep() {},
+ });
+ await assert.rejects(
+ viewer.mount(document.createElement('div')),
+ /no view to draw it/,
+ );
+});
+
+test('a viewer mounted in the tick another unmounts gets elements of its own', async (t) => {
+ const { viewers, host, renderers } = mount(t, {}, ['kartaview', 'panoramax']);
+ const [kartaView, panoramax] = viewers;
+ await kartaView.mount(host);
+ await kartaView.open('p');
+ const root = host.querySelector('.sl-photo-viewer');
+ const canvas = root.children[1];
+ assert.ok(renderers[0].canvas === canvas);
+ // The core switches source: one unmounts and the other mounts at once.
+ kartaView.unmount();
+ const mounting = panoramax.mount(host);
+ await mounting;
+ await panoramax.open('p');
+ const fresh = host.querySelector('.sl-photo-viewer');
+ assert.equal(host.children.length, 1);
+ assert.ok(fresh !== root, 'a root of its own');
+ assert.equal(fresh.dataset.provider, 'panoramax');
+ assert.ok(fresh.children[1] !== canvas, 'not the destroyed renderer’s canvas');
+ assert.ok(renderers[1].canvas === fresh.children[1]);
+ assert.equal(fresh.dataset.kind, 'pano', 'not the front view');
+});
+
+test('a mount overtaken before it is drawn closes, and never shows later', async (t) => {
+ const { viewers, host } = mount(t, {}, ['kartaview', 'panoramax']);
+ const [kartaView, panoramax] = viewers;
+ // KartaView starts mounting; Panoramax mounts before the view draws it.
+ const overtaken = kartaView.mount(host);
+ const current = panoramax.mount(host);
+ // It settles, rather than wait for a draw that never comes.
+ const outcome = await Promise.race([
+ overtaken.then(
+ () => 'mounted',
+ (error) => error.message,
+ ),
+ new Promise((resolve) => setTimeout(() => resolve('still pending'), 100)),
+ ]);
+ assert.match(outcome, /viewer was closed/);
+ await current;
+ await nextTick();
+ assert.equal(host.children.length, 1);
+ assert.equal(host.children[0].dataset.provider, 'panoramax');
+ await assert.rejects(kartaView.open('f'), /not mounted/);
+ // Once Panoramax goes, nothing is left in the host.
+ panoramax.unmount();
+ await nextTick();
+ assert.equal(host.children.length, 0);
+});
diff --git a/src/ui/views/panels/StreetLevelPhotoViewer.vue b/src/ui/views/panels/StreetLevelPhotoViewer.vue
new file mode 100644
index 0000000000..3b25e2976e
--- /dev/null
+++ b/src/ui/views/panels/StreetLevelPhotoViewer.vue
@@ -0,0 +1,80 @@
+
+
+
+ ‹ ›
+
diff --git a/src/ui/views/panels/VoiceControl.vue b/src/ui/views/panels/VoiceControl.vue
index bcbce56b87..ba7c04907f 100644
--- a/src/ui/views/panels/VoiceControl.vue
+++ b/src/ui/views/panels/VoiceControl.vue
@@ -11,6 +11,7 @@ import PanelLayoutButtons from './PanelLayoutButtons.vue';
import UiButton from '../../kit/UiButton.vue';
import UiCheckbox from '../../kit/UiCheckbox.vue';
import UiCloseButton from '../../kit/UiCloseButton.vue';
+import UiIcon from '../../kit/UiIcon.vue';
import UiSelect from '../../kit/UiSelect.js';
// The voice control in the command dock, as its presenter
@@ -79,7 +80,7 @@ const frameStyle = (panel) => ({
{{ view.mic.text }}
- {{ t('CHAT') }}
+ {{ t('CHAT') }}
@@ -94,12 +95,12 @@ const frameStyle = (panel) => ({