Compare commits

..
Author SHA1 Message Date
Sameh KhamisandManjunath Paparaju d55f696514 Add the changelog entry for #1842
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-19 01:32:05 -08:00
Sameh Khamis 29e38b6198 Merge remote-tracking branch 'origin/main' into samehkhamis/kit-checkbox 2026-11-19 01:31:58 -08:00
Sameh Khamis fc9d59f258 Merge pull request #1841 from bilawalsidhu/samehkhamis/kit-search-field
Vue kit: UiSearchField for the Context and Layer Finder searches
2026-11-19 01:31:48 -08:00
Sameh Khamis 31ed97043a Merge remote-tracking branch 'origin/main' into samehkhamis/kit-search-field
# Conflicts:
#	docs/VUE-MIGRATION.md
2026-11-19 01:10:34 -08:00
Sameh KhamisandManjunath Paparaju 2d7b7be890 Vue kit: UiCheckbox for the Visual, voice, Data Library and welcome checkboxes
UiCheckbox is a label wrapping a native checkbox and its words; trailing
puts the box after them, as the Visual panel's rows have it. v-model shows
the value and emits the checked state, and change is emitted with its event;
without a modelValue the box is the browser's own, as the welcome card's
"Don't show this again" is. restore puts the box back to modelValue once a
change has rendered without the owner taking it, which is what the voice
panel's v-checked directive did for a refused preference. Attributes go to
the label; inputId and inputAttrs to the box.

checkbox.css holds the centred flex row, moved out of the two labels that
hold only a checkbox (first-run.css, library.css) and loaded before them.
Each box keeps its skin's size, margin and accent colour. checkboxes.test.mjs
fails if a view writes a checkbox by hand; Story Explore's filters are not
converted yet.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-19 01:05:12 -08:00
Sameh Khamis fb49418851 Merge pull request #1840 from bilawalsidhu/samehkhamis/kit-close-button
Vue kit: UiCloseButton for every close button in the views
2026-11-19 00:57:23 -08:00
Sameh KhamisandManjunath Paparaju b3e6c265e8 Add the changelog entry for #1841
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-19 00:48:57 -08:00
Sameh Khamis f09e9ce6eb Merge branch 'main' into samehkhamis/kit-close-button 2026-11-19 00:43:52 -08:00
Sameh KhamisandManjunath Paparaju 52dd576769 Vue kit: UiSearchField for the Context and Layer Finder searches
UiSearchField is the search glyph, a search input with v-model and, with
clearLabel, a UiCloseButton shown while text is typed that clears and
refocuses. tag is div or label; attributes go to the frame, and inputId,
inputClass, autocomplete and spellcheck to the input. Escape stops at the
input and is emitted with its event; focus() focuses the input.

search-field.css holds the declarations both skins had in common (the
frame's flex row, the input's min-width, border and background), moved out
of context-dock.css and layer-finder.css and loaded before them. The
browser's cancel button stays each skin's own.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-19 00:42:51 -08:00
Sameh Khamis 3235e404da Merge pull request #1839 from bilawalsidhu/samehkhamis/kit-styles
Vue kit: the kit's classes carry Core's standard looks
2026-11-19 00:29:03 -08:00
Sameh KhamisandManjunath Paparaju 2418e43545 Vue kit: bare is for skins that set their own padding; pin the CCTV and Inspector close load order; changelog for #1840
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-19 00:26:29 -08:00
Sameh KhamisandManjunath Paparaju 1711b4b456 Vue kit: UiCloseButton for every close button in the views
UiCloseButton is a UiButton with a fixed glyph (× or the Material close
symbol through UiIcon), a required accessible label and no tip unless the
site passes a title. Attributes and classes pass through, so each site keeps
its id, feature class, data and aria attributes, and its look.

Its kit class, ui-close-button (close-button.css, loaded before the feature
stylesheets), is Core's common look: a bare glyph with no padding, border
or background of its own, and a pointer. The guide's close button shares
the rule, and the copies of those declarations leave the feature rules.
`bare` leaves the look off for Street Level's and the space mission's close
buttons, whose skins keep the browser's padding. UiIcon takes size null to
leave the glyph's size to the stylesheet.

The sixteen hand-written close, dismiss and clear buttons in the SFCs are
now UiCloseButtons; closeButtons.test.mjs pins that none remain.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-19 00:19:33 -08:00
Sameh Khamis c58f9fbdc6 Merge branch 'main' into samehkhamis/kit-styles 2026-11-19 00:17:02 -08:00
Sameh KhamisandManjunath Paparaju 0d3c3325d4 Vue kit: compact styles the action variant only, tone is accent or danger, a disabled icon button dims; pin the inherited type
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 23:51:16 -08:00
Sameh Khamis 5f71ee0273 Merge pull request #1837 from bilawalsidhu/samehkhamis/rail-and-hud-cleanup
Keep the panel rails clear of an obstacle across the middle of a short window
2026-11-18 23:48:06 -08:00
Sameh KhamisandManjunath Paparaju 4114ea1a05 Add the changelog entry for #1839
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 23:45:02 -08:00
Sameh KhamisandManjunath Paparaju 9f8a4cb39d Vue kit: the kit's classes wear Core's standard looks
UiButton gains styled variants beside the unstyled default ghost:
action (the gev-action-button surface, tone="danger" and size="compact"),
primary (that surface with the scene panel's main-action accent) and icon
(the panel collapse toggle's square glyph button). A pressed styled button
looks as a hovered one does. UiChip wears the read-only chip (now chip.css,
shared with the news chips), UiEmpty the one-line empty state (now
empty-state.css, shared with the news readout), and UiBadge and UiSegmented
carry their skins through the kit's own classes too.

Every kit selector shares one selector list with the Core skin it comes
from, in skins loaded before the feature stylesheets, so no rule is copied
and feature classes still win. The app renders as before: the voice card
chip and the Recent Imagery and Authoring empty states keep their own type
by inheriting it, and the dock pin buttons drop variant="icon", which they
never wore. kitStyles.test.mjs pins the shared rules.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 23:42:55 -08:00
Sameh Khamis 6502028fbe Merge branch 'main' into samehkhamis/rail-and-hud-cleanup 2026-11-18 23:33:51 -08:00
Sameh KhamisandManjunath Paparaju c1e58b72b9 fix(ui): any positive room counts when a midpoint band asks for no minimum
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 23:26:22 -08:00
Sameh KhamisandManjunath Paparaju fd64a78aca test(ui): pin the midpoint band's exact minimum, and correct a test comment
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 23:26:10 -08:00
Sameh Khamis 9977154606 Merge pull request #1838 from bilawalsidhu/samehkhamis/nearby-places-fixes
Prefer a nearby small place over a far namesake, and bound the place tiles a lookup reads
2026-11-18 23:15:55 -08:00
Sameh KhamisandManjunath Paparaju 10dbd2f937 fix(ui): a side of a midpoint block thinner than 8% of the window holds no panel; pin the lower merge edge
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 23:14:26 -08:00
Sameh KhamisandManjunath Paparaju 378df7b613 fix(ui): neighbours exactly two gaps from a midpoint obstacle join its block, and the band beside it stays inside the rail's own edges
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 23:02:10 -08:00
Sameh KhamisandManjunath Paparaju 81df2c8c42 fix(ui): the left rail's panels use all the room it counted above an obstacle across the middle
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 23:01:47 -08:00
Sameh KhamisandManjunath Paparaju 50824c9a65 test(places): pin the pack build-date rule and a nearer village beating a namesake inside a wide search
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 22:54:53 -08:00
Sameh KhamisandManjunath Paparaju 98a100ed7e fix(ui): rails count the obstacles beside those across the middle, and read them as before when neither side has room
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 22:51:42 -08:00
Sameh KhamisandManjunath Paparaju 75e345aa07 fix(places): small places stop at 500 km even in tiles that reach past it
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 22:44:36 -08:00
Sameh KhamisandManjunath Paparaju d2797dbad2 fix(places): keep the places index's build date only when every tile is unchanged; say the 500 km cap is for wide lookups
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 22:44:12 -08:00
Sameh KhamisandManjunath Paparaju ecb7e7cd68 Add the changelog entry for #1838
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 22:41:36 -08:00
Sameh KhamisandManjunath Paparaju feedd88614 fix(ui): rails take obstacles across the middle together, so their order never picks the side
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 22:39:29 -08:00
Sameh KhamisandManjunath Paparaju a2c86c0fed fix(places): a rebuild writes its files before removing stale tiles, and keeps the build date when nothing changed
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 22:34:59 -08:00
Sameh KhamisandManjunath Paparaju 30ec362c13 fix(places): look for small places within 500 km, so a whole-globe view reads only the tiles near its centre
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 22:34:59 -08:00
Sameh KhamisandManjunath Paparaju f414df97eb fix(places): a small place in view comes before a far bigger namesake
findPlace looked at the detail tiles only when no city had the typed name,
so a village called Paris in view lost to Paris, France. With
includeSmallPlaces it now reads the places near the view as well and takes
the nearest place of the name there, city or not. With none near, the
largest city of the name still wins.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 22:34:59 -08:00
Sameh KhamisandManjunath Paparaju 31a7b6a0a5 Add the changelog entry for #1837
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 22:32:50 -08:00
Sameh KhamisandManjunath Paparaju 8b055a1423 fix(ui): panel rails keep clear of an obstacle across the middle of the window
An obstacle that crossed the middle of the window (the World Timeline, the
voice control or a card in a window under about 520px tall) was neither
above nor below it, so neither rail counted it and panels could be laid out
over it. Such an obstacle now puts the panels on whichever side of it has
more room. When neither side has room, the rails keep their existing
minimum (the right rail's empty band, the left rail's minimum lane height).

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 22:32:40 -08:00
Sameh Khamis ec1fc6bc09 Merge pull request #1831 from bilawalsidhu/samehkhamis/omnibar-reading-fixes
Read more Omnibar lines the way they are meant
2026-11-18 22:26:52 -08:00
Sameh Khamis edf595f69f Merge branch 'main' into samehkhamis/omnibar-reading-fixes 2026-11-18 22:14:08 -08:00
Sameh Khamis 0534dcebf6 Merge pull request #1830 from bilawalsidhu/samehkhamis/place-privacy-2
Keep spelled-out emails, IP addresses, recovery phrases and lower-case codes from the place service
2026-11-18 22:13:59 -08:00
Sameh Khamis f6f1ee2a3a Merge branch 'main' into samehkhamis/place-privacy-2 2026-11-18 22:02:01 -08:00
Sameh Khamis e9fd19acb3 Merge pull request #1829 from bilawalsidhu/samehkhamis/space-missions-fixes
Finish the Space Missions shutdown, and let label clicks reach every layer
2026-11-18 22:01:51 -08:00
Sameh Khamis a5b18f3718 Merge branch 'main' into samehkhamis/space-missions-fixes 2026-11-18 21:49:21 -08:00
Sameh Khamis 6b45ea12cf Merge pull request #1836 from bilawalsidhu/fix-delayed-clock-test
Hold the clock still in the delayed-live aircraft icon test
2026-11-18 21:34:15 -08:00
Sameh KhamisandManjunath Paparaju b5018b8cc2 Let the cockpit focus test reach its check
The test's camera and rendering doubles now carry what focusing a mission
uses, so without the cockpit guard the test fails on the camera flight
rather than on a missing double.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 21:25:05 -08:00
Sameh Khamis 14bf0de2a2 Merge branch 'main' into fix-delayed-clock-test 2026-11-18 21:22:35 -08:00
Sameh Khamis b56c019df7 Merge pull request #1835 from bilawalsidhu/fix-icon-near-plane-flicker
Icons drawn over depth no longer flicker
2026-11-18 21:22:21 -08:00
Sameh Khamis 64e474f85e Add the changelog entry for #1836 2026-11-18 21:10:17 -08:00
Sameh Khamis 5e0842ad81 Add the changelog entry for #1835 2026-11-18 21:10:13 -08:00
Sameh Khamis 06aff17004 test(flights): hold the clock still while the delayed-live icon test compares drawn and read positions
The contact moves about half a metre per millisecond, and the drawn and read
positions each read Date.now(); on a busy machine the two readings landed far
enough apart to fail 'same place'.
2026-11-18 21:09:42 -08:00
Sameh Khamis 6a86102336 fix(render): icons drawn over depth no longer flicker
An icon drawn over depth set its log depth to exactly the near plane (1.0).
Interpolated across the quad, that value can arrive a rounding step or two
under czm_writeLogDepth's 0.9999999 cut, which discards the fragment, so a
moving icon vanished for a frame now and then, most visibly far away in dense
clusters. It now sits 1e-4 m past the near plane, still in front of
everything.
2026-11-18 21:09:42 -08:00
Sameh KhamisandManjunath Paparaju b363f9b09b Catch a recovery phrase quoted »like this« or ‚like this‘
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 20:58:22 -08:00
Sameh KhamisandManjunath Paparaju 6f959fc3cc Read "clear … except" from the map only when it clears every other layer
"clear all flights except ships from the map" no longer offers to turn
Ships on.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 20:58:18 -08:00
Sameh KhamisandManjunath Paparaju cdde80f3ad Never fly to a mission while the cockpit holds the camera
Focusing a mission does nothing in the cockpit, so the layer row's arrows
select the next mission without moving the camera, as its label and dot
already do.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 20:58:17 -08:00
Sameh KhamisandManjunath Paparaju bf1e313301 Catch a recovery phrase in curly or angle quotes
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 20:39:01 -08:00
Sameh KhamisandManjunath Paparaju 038915bc0b Take "from the map" off after "clear" only when what is left clears the whole map
"clear all flights from the map" no longer offers to turn Flights on, and
"clear the layers from the map" clears the layers.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 20:38:56 -08:00
Sameh KhamisandManjunath Paparaju 6c960eb3c9 Keep the camera still in the cockpit when a mission's dot is clicked or its orbit arrives
The cockpit holds the camera: the mission dot, like its label, selects the
mission there without flying to it, and a mission picked in the cockpit is
not flown to when the active satellite lookup returns.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 20:37:53 -08:00
Sameh KhamisandManjunath Paparaju 813c6b23ea Say that an explicit Satellites action lets the saved state go after a busy restore
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 20:28:58 -08:00
Sameh KhamisandManjunath Paparaju a29efa12c4 Let a mission label select its mission in the cockpit, and say what the merged click rule does
Under the card-on-top rule a mission label is the card on top for the
cockpit too, so the label no longer steps aside there: it selects its
mission without moving the camera the cockpit holds. Tests and docs no
longer claim a covered click reaches what lies under the label, and the
busy-restore note says an explicit Satellites action lets the saved state
go.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 20:24:16 -08:00
Sameh KhamisandManjunath Paparaju 406a5003e0 Keep a code private before "thanks," with a trailing comma
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 20:17:39 -08:00
Sameh KhamisandManjunath Paparaju 3a5b10a1f6 Take "from the map" off after "clear" only for the whole map
"clear flights from the map" no longer offers to turn Flights on.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 20:07:18 -08:00
Sameh KhamisandManjunath Paparaju 9b6683a9cd Read requests about a map as requests, catch quoted or dash-joined phrases, and an en dash before "thanks"
Words a request about a map is made of (near, today, open, find …) count
with the map words, so "find good food open now near this area today"
is a request; a phrase is let through about once in a hundred. Phrases
quoted, numbered "1:", "#1" or "[1]", or joined by dashes, pipes,
slashes or dots are caught, and a code before " – thanks" is private.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 20:06:35 -08:00
Sameh Khamis d2dac41668 Merge pull request #1833 from bilawalsidhu/samehkhamis/sonar-minimal-fixes
Keep the HUD corners clear of the credits, and carry Minimal + Sonar in links and scenes
2026-11-18 20:01:53 -08:00
Sameh KhamisandManjunath Paparaju 0e5c5e624c Merge origin/main into space-missions-fixes
Main's single click rule (the card or label on top takes the click, read
once per click through clickCard and isUnderOtherCard in
src/data/pickRegistry.js) covers a click on a Space Missions label: a
mission marker label is an interactive world-overlay entry, so the
host's hit test names it as the card on top for every other layer. The
per-layer label guards in CCTV, Drone Airspace, FIRMS, Ghost Maps, News,
Perimeters, Shipwrecks, Vessels, Wildlife Sightings, ALPR, Local ADS-B
and the cockpit orbital focus are dropped for main's versions.

The mission-label tests are kept on main's API: fakeInputUnderLabel now
also names the label as the card on top, and each test shows a click on
the label never acts on the card, camera, vessel, fire, reader, aircraft
or report under it, and leaves the selection as it is. A launches test
checks that a mission label is interactive and is the card on top for
every other layer. Docs, changelog and the dispatcher's `overlay` note
describe the merged behaviour.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 20:00:25 -08:00
Sameh KhamisandManjunath Paparaju 71f40c9655 Keep phone and clean-view credits as they were, and lift narrow corners over the World Timeline
The Cesium credit box's width cap and right-to-left placement apply from
1200px as before, and in the Omnibar layout at every width, so the phone
shell, clean view, recording and scene playback keep their own layout.
Narrower than 1120px the coordinates and the Tactical readout sit above
the World Timeline while it shows. The scene format notes that a build
from before `sonar` refuses a project that has it.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 19:45:47 -08:00
Sameh KhamisandManjunath Paparaju c49cf5168e Add the changelog entry for #1833
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 19:45:47 -08:00
Sameh KhamisandManjunath Paparaju 40e2998466 Carry Sonar with the Minimal HUD layout in links and scene shots
A link or scene shot made in Minimal with Sonar on played back with Sonar
off, and turned off the viewer's own. Tactical with Sonar keeps the `cyber`
layout code, which older readers understand; Minimal with Sonar now carries
an explicit mark beside its layout: flag bit 5 (`hudSonar`, default off) of
a compact link, `hs=1` in the long form, and `hud.sonar: true` in a scene
shot. A restore turns Sonar on when the state names Cyber or carries the
mark, so a state made before it restores exactly as it did.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 19:45:47 -08:00
Sameh KhamisandManjunath Paparaju c69a421678 Keep the HUD corners, the dock and a wrapped credit line apart at every width
The credit line now wraps at every width instead of running under the
corner row, and right to left it takes the bottom right at every width. A
small watcher keeps its height in --credit-line-height, so the coordinates
(and, right to left, the Tactical readout) stay 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 bottom corners, so the coordinates and the readout sit above the dock
instead of under it. Outside the Omnibar layout, the coordinate rule meant
for 981 to 1199px no longer overrides the two-row dock's placement at 980px
and below.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 19:45:47 -08:00
Sameh KhamisandManjunath Paparaju 3d31126c72 Read "from the map" only after hide, remove, turn off or clear
"show me the view from the map" is a question again, not a place search.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 19:45:38 -08:00
Sameh KhamisandManjunath Paparaju 49ad1b7b73 Catch a recovery phrase numbered "(1) … (2) …"
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 19:45:38 -08:00
Sameh KhamisandManjunath Paparaju 94dcadf54f Tell lists of places from recovery phrases by four map words in any twelve, keep " - thanks" codes private, and trim long tails at once
The map words cover 108 BIP39 words for places, buildings, vehicles and
the land; twelve list words in a row with four of them are a list of
places, which a random phrase is about once in three hundred. A code
followed by " - thanks" is private again, and the IPv6 and bearer trims
no longer slow on long runs of commas or brackets.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 19:34:48 -08:00
Sameh KhamisandManjunath Paparaju 06eb60faab Read "from the map" after "please" is dropped
"hide flights from the map please" and "please clear everything except
flights from the map" read as they do without "please".

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 19:33:50 -08:00
Sameh Khamis 8ed14efdbf Merge pull request #1781 from manjunath22466/fix/earthquake-click-details
fix(earthquakes): make quakes clickable, with card click arbitration
2026-11-18 19:19:51 -08:00
Sameh KhamisandManjunath Paparaju f75f42d3ca Read lists of places as places, not recovery phrases, and keep code tails fast
Twelve BIP39 words in a row with three words for places or things on a map
("coffee, bar, hotel, museum, park …") are a list, not a phrase; a random
phrase has three of them about once in two hundred. A code's value and the
courtesy word after it no longer overlap, and trailing punctuation is
trimmed from a word's end only, so a long run of hyphens is read at once.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 19:13:04 -08:00
Sameh KhamisandManjunath Paparaju cd5a4443a2 Read "from the map" after any switch or clear verb, before anything else
"clear everything except flights from the map" and "hide everything
from the map" now read as they do without the ending, instead of only
offering Ask GEV or a place search.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 19:10:54 -08:00
Sameh Khamis 35c5ee5deb Merge remote-tracking branch 'origin/main' into fix/earthquake-click-details 2026-11-18 18:58:33 -08:00
Sameh Khamis e87aa5190d Merge main into fix/earthquake-click-details
Resolves conflicts with main: a world focus target's own range past its
framed radius replaces the kind's range (#1832), so a quake asks for its
own range only past M6 and the earthquake framing stays its floor; FIRMS
keeps main's marker stand-in under the card-on-top rule; launches keep
main's label click and also read the card on top through the pick
registry.
2026-11-18 18:58:07 -08:00
Sameh Khamis 2a94067f5b Merge pull request #1834 from bilawalsidhu/imagery-decoded-frames
Renderer contract: decoded imagery, finished tile images handed over by the application
2026-11-18 18:52:51 -08:00
Sameh KhamisandManjunath Paparaju 3f5221b837 Withhold an SSN's last four, a code before ", thanks" and a recovery phrase written with commas or numbers
"ssn ending 1234" and "ssn last four 1234" are private again, as before
this change; a code may be followed by a comma, "cheers", "thanks a
lot" or more than one "!"; a recovery phrase is twelve BIP39 words in a
row, so commas, numbering, a closing period or "my seed is" before it no
longer hide it. The spelled-out email patterns start only at a word, which
keeps long inputs fast.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 18:38:13 -08:00
Sameh Khamis 1b03039438 Changelog entry for decoded imagery 2026-11-18 18:37:44 -08:00
Sameh Khamis 4ee0aba82e Renderer contract: decoded imagery, tiles the application hands over as finished images
A timed source of kind 'decoded' (capability imageryDecoded) names the slot a
time shows (slotAt), the slots to hold ahead (prefetch) and answers each tile
of a slot with an image, missing or defer. The Cesium renderer draws each held
slot as an imagery layer of its own, as it draws frames; the stub shows the
slot. The check globe.imagery.decoded covers it.
2026-11-18 18:37:23 -08:00
Sameh KhamisandManjunath Paparaju 81192cfa50 Keep plans for places that begin with a kind of place, and keep Satellites with Space Missions only while missions are on
A keyword is read as the start of a name only when what follows is one
word for a kind of place alone ("Radio City", "Traffic Island"), so
"traffic city hall" and "earthquakes valley forge" keep their plans.
"except space missions" keeps Satellites only while Space Missions is
on, and "from the map" is read before "except".

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 18:36:26 -08:00
Sameh Khamis bb3bf9858b fix(click): the card or label on top takes the click in every layer
Review fixes for #1781:

- One rule for cards: the world-overlay host hands its hit test to the
  pick registry, and every click handler reads the topmost interactive
  card or label once per click (`clickCard`, `isUnderOtherCard` in
  src/data/pickRegistry.js), so all handlers agree in any listener order.
  A layer whose own card or label is on top acts on it whatever is drawn
  under it; a layer under another layer's card neither acts nor treats
  the click as empty space (a tracked aircraft stays tracked, a selection
  stays selected); Context names nothing under a card. A selected news
  card over a vessel no longer opens the link and selects the vessel.
- With one rule, the per-owner arbitration options are no longer read
  and are removed: `passive`, `expanded` and `declinesClick` pick owners,
  `rememberClickPickActions`, `isActedOnByOtherLayer`, card backgrounds
  and `cardKeepsClick`. The dispatcher is unchanged from main.
- A drag that ends on a quake disc, label or card does nothing; opening
  the USGS page or clearing the selection needs a clean click.
- A click on the map under another layer's card opens no Street Level
  ground image.
- A CCTV card that is going away is still not the scene under it.
- Docs and changelog describe the new rule.
2026-11-18 18:23:41 -08:00
Sameh KhamisandManjunath Paparaju 2487500927 Read recovery phrases against the BIP39 list, and fix four more privacy readings
A recovery phrase is now twelve to twenty-four words that are all on the
BIP39 English list, so a long request ("show every plane over london then
…") reaches Ask GEV while a phrase holding "find" or "please" is still
caught. A time in brackets is no IPv6 address (only a bracketed host after
"//" is), "St 123456 A" is no National Insurance number (spaced in pairs or
not at all), "my, ID 12345" keeps its owner, a partial "ssn 1" stays
private while typed, any CVV value is private, and a code followed by
"thanks" or "now" is still a code. Idaho's reading no longer slows down on
very long lines.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 18:17:22 -08:00
Sameh KhamisandManjunath Paparaju 859aa172e7 Keep Space Missions with Satellites in "except", leave "turn off the screen" alone, and part places after a compound country
"hide everything except space missions" (or "satellites") keeps both, as
switching either off takes the other. "turn off the screen" is no longer
read as a switch with "off the screen" taken off it, which left a place
search. A place joined after a compound country is another place ("near
Trinidad and Tobago and Barbados"), and a compound country after another
place stays whole ("near Paris and Trinidad and Tobago"). Only a word for a
kind of place written after a name ("Island", "City") drops a plan, so
"earthquakes lake tahoe" and "traffic tower bridge" keep theirs. Two doc
comments are back above their code.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 18:11:18 -08:00
Sameh KhamisandManjunath Paparaju 29d0fa6e0b Keep satellite tracking stopped by a place search through the Space Missions restore
A place search or fly-to stops satellite tracking with the tool origin,
which the saved Satellites state did not take in, so a satellite tracked
by voice during the mission was tracked again when Space Missions ended.
The saved state now takes in every deliberate Satellites setting (person,
voice or tool), as the layer state does.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:56:36 -08:00
Sameh Khamis cd144ecad5 feat(firms): a marker stand-in can set how far the camera stands from a fire it draws (#1832)
setMarkerStandIn takes an optional focusRangeM(record): when a click on a fire the stand-in draws moves the camera there, it stands off that many metres instead of the usual fire framing. A world focus request may carry its own rangeM; past the framed radius it replaces the kind's range.
2026-11-18 17:46:31 -08:00
Sameh KhamisandManjunath Paparaju ab01345c7d Keep a Satellites setting the person changes while Space Missions holds its saved state
A setting such as "show orbits" changed by the person or by voice while
Space Missions keeps the Satellites state from before it (while it runs, or
after a restore that found Satellites busy) was overwritten when the mission
ended. It is now kept in that saved state, as their visibility choice is.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:36:15 -08:00
Sameh KhamisandManjunath Paparaju 25d33a2e6f Run "everything except" on Enter, keep every layer it names, and keep plans for places
"hide everything except flights" runs on Enter, as asked in so many words.
A layer to keep written with "the" is read ("except flights and the
radio"), and one that is not read switches nothing off: only Ask GEV is
offered. A keyword before the rest of a name only drops its plan when that
rest starts with a word for a kind of place ("Fire Island"), so
"earthquakes japan" and "flights London" keep theirs. "Saint Vincent and
the Grenadines" stays one place with its "the".

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:35:10 -08:00
Sameh KhamisandManjunath Paparaju 3cf230b8b3 Give back the Satellites a person chose between two missions
A saved Satellites state kept by a busy restore could still carry the mark
of a Satellites switch the person made after it, which tells the restore to
leave Satellites as it is. Space Missions turned on again kept that mark,
so turning it off left Satellites on when it had been off. The next mission
now saves Satellites as it is when it starts in that case.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:29:35 -08:00
Sameh KhamisandManjunath Paparaju c53a6d1c51 Test that a mission label's click never acts on the card or reader beneath it
ALPR, News, Wildlife Sightings, Fire Perimeters, GhostMaps and Drone
Airspace each skip their own card or overlay hit test when a painted label
took the click. Each now has a test that a click the label took does not
select the camera or sighting, open the report, or open the card's link,
and lets go of the current selection, while the same click off the label
still acts. ALPR's presentation gets its first test file.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:23:35 -08:00
Sameh KhamisandManjunath Paparaju d15c69a8ae Add the changelog entry for the place privacy fixes
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:21:40 -08:00
Sameh KhamisandManjunath Paparaju 2a4079e9f8 Keep SSNs with "is", "Bearer:" values and codes in capitals private, and let West Point through
"ssn is 123456" and a masked "ssn: xxx-xx-1234", "Bearer: island", codes
in capitals after their label ("OTP ABCDEF", "PIN ABCD", any CVV), a
document number or ID right after its colon, "lockbox number 4821", a UK
National Insurance number in lower case and an IPv6 host in a link are
private. A recovery phrase starting with "find" or holding "please" (both
on its word list) is caught. "Point" is not read as a spelled dot, so
"meet at West Point tomorrow" is looked up, and Idaho's code follows a town
written in any case ("BOISE ID 83702", "Coeur d'Alene ID 83814").

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:21:32 -08:00
Sameh Khamis 0a9235cc69 Merge pull request #1827 from bilawalsidhu/manjunath/welcome-steps
Turn the first-run launcher into a three-step welcome
2026-11-18 17:15:24 -08:00
Sameh KhamisandManjunath Paparaju 84d79f5c76 Add the changelog entry for the Omnibar readings
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:14:37 -08:00
Sameh KhamisandManjunath Paparaju 74d38e6d14 Switch Satellites on again when Space Missions returns after a busy restore
A restore that found Satellites still busy keeps the saved state, and the
next Space Missions start then skipped switching Satellites on, so it came
up with no satellites. It now keeps that saved state (still the one from
before the mission) and switches Satellites on for the mission again.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:14:04 -08:00
Sameh KhamisandManjunath Paparaju 200c788ac1 Let Idaho, questions and long place names through, and keep more tokens and codes private
"Boise ID 83702" names Idaho rather than an identity number. A long question
for the assistant is no recovery phrase: a phrase holds none of the common
words its list lacks ("the", "and", "are"). A long lower-case place name
is no passphrase, an address of up to ten words is sent as the Omnibar reads
it, and "mfa boston", "otp bank" and "security code plaza" are names.

"Authorization: Bearer" and any value after "bearer" but a place word are
tokens, and so are GitLab, Hugging Face and SendGrid keys and a code in a
link. Door, alarm and lockbox numbers (not a zip or area code), a spaced UK
National Insurance number, "my id is …", and emails spelled with "punto",
"period", a spaced dot or letter by letter are private too.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:13:12 -08:00
Sameh KhamisandManjunath Paparaju dc31774109 Read "everything except", "from the map", a doubled verb and a grid reference after "near"
"hide everything except flights" (or "all but", "other than") switches off
every layer that is on but the ones named, or says no other layers are on.
"remove flights from the map" is "remove flights", "hide hide everything"
reads the verb once, and "flights near 14R PU 2090 4906" flies to the grid
reference. A keyword that begins a name ("Fire Island", "Radio City Music
Hall") no longer offers a plan to the rest of the name. The arrow keys drop
a check for a list that opens upward, which it never does.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:12:39 -08:00
Sameh KhamisandManjunath Paparaju 71229c8549 Add the changelog entry for the Space Missions fixes
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:08:00 -08:00
Sameh KhamisandManjunath Paparaju 5feac417d6 Never act on what lies under a mission label when it is clicked
A click on a Space Missions label reaches every click subscriber so they can
let go of their selection, but the layers that test their own painted cards
or pick the scene themselves still found what lay under the label: CCTV
turned that camera on, FIRMS and Vessels selected and flew to theirs, News
and Wildlife Sightings opened their item, Perimeters, Ghost Maps and
Shipwrecks opened the card's link, ALPR selected its reader, and Local ADS-B
drilled the scene itself and selected the aircraft. Each now skips its own
test on such a click, and Local ADS-B drills through the click, so the click
only releases selections, as a click on empty map or another layer's
contact does. Ordinary clicks behave as before.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:05:43 -08:00
Sameh KhamisandManjunath Paparaju 3c0aec90ef Test which changes lay the right panels out for the Stories card
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:00:10 -08:00
Sameh KhamisandManjunath Paparaju 866eadbe5e Let a quick second click on Next move on, and Tab leave the welcome for the page
The second click of a double click on NEXT was dropped, so the button
looked dead; it now moves to the next step, and only the launch itself
still takes a single click. Tab from the search bar or another control
jumped back into the card; the card no longer claims focus from the page,
and still takes it when focus has nowhere else to be.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:00:10 -08:00
Sameh KhamisandManjunath Paparaju 4d42c56bdf Lay the right panels out again when the welcome stops hiding the Stories card
The welcome hides the card while it is up and while BROWSE STORIES loads,
so the right column started level with the left one; when the welcome
closed, the card showed over the column until something else moved the
panels. The column is laid out again when the welcome is removed or its
loading class comes off.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:00:10 -08:00
Sameh KhamisandManjunath Paparaju 44bc79ea25 Name the changelog entry for its pull request
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:00:10 -08:00
Sameh KhamisandManjunath Paparaju 0936da98a9 Launch from the welcome only on a press made on its step, and keep it up if Stories refuses
From review:
- A press begun while the steps were changing and released after (a click
  aimed at NEXT) ran ENTER GOD MODE; a press now belongs to the step it
  began on. Keyboard activation is unchanged.
- BROWSE STORIES closed the card before asking Stories to open, so a
  refusal (another mode holding the globe) left nothing on screen; the card
  closes only once Stories opens.
- On phones a mission's error line was squeezed beside the checkbox and
  BACK; it takes its own row above the buttons.
- CURRENT-STATE calls the YouTube, X, Instagram, LinkedIn and bilawal.ai
  links the author's channels, as the card does.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 17:00:10 -08:00
Manjunath PaparajuandSameh Khamis e342149a09 Turn the first-run launcher into a three-step welcome
Replace the single dense welcome card with three short steps: an
introduction to the modes, where to start (Space Missions, Environmental
or Explore manually, Explore selected by default), then quick tips (the
place tip points at the search bar) and links. Next and Back keep the
selection, and only Enter God mode runs a mission; double clicks, Enter
repeats and clicks during a step change cannot launch one. Skip and ESC
close the card for the session, as before.

Drop the Live Contacts tile and the old voice tip. Space Missions
switches on its layer, which opens its own panel, so no first-run choice
enters a Context mode or opens the Context panel any more, and that path
is gone. The last step links to the repository and
Halfpixel's channels, each opening in a new tab without opener or
referrer. Its GEV Stories card closes the welcome and opens the in-app
Stories Explore view; the Stories announcement stays hidden, and unseen,
until the card has closed and Stories has loaded. The dim layer behind
the card is a click-through tint with no blur.

Update the 13 catalogs, CURRENT-STATE, the first-run QA harness and its
mutations, and the scripts that dismissed the old card. Add a changelog
fragment.

Co-authored-by: Sameh Khamis <[email protected]>
2026-11-18 17:00:10 -08:00
Sameh KhamisandManjunath Paparaju 35049fd7f7 Keep more shapes of phones, codes, tokens, emails and IP addresses private
Review found "Alice 555-0100" sent as a Japanese postcode, recovery phrases
with a repeated word, a capitalised bearer token, codes after a lower-case
label in other cases ("verification code Abc", "PIN aBcD"), "john at
gmail.com" and "(dot)" forms, passport numbers of digits only, "ID AB123"
and IPv6 addresses. They now stay in the browser, and the suggester never
sends a line of more than eight words. "Bearer Island, Canada", "bearer
island", a ZIP+4 after two spaces and a Japanese postcode after Japanese
script are looked up again.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 16:59:35 -08:00
Sameh KhamisandManjunath Paparaju 91700f89f8 Keep a country named with "and" whole, and show places as they were typed
"flights near Trinidad and Tobago" flew to Trinidad and offered Tobago on
its own; places whose own name holds "and" or "&" (Trinidad and Tobago,
Bosnia and Herzegovina, Antigua and Barbuda and the like) now stay one
place, while "Austin and Dallas" is still two. "İstanbul" was searched with
a stray combining dot, and labels title-cased what was typed with capitals
("IPhone Store"); a place is searched in plain lower case and labelled as
it was typed.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 16:55:00 -08:00
Sameh KhamisandManjunath Paparaju 8885177e2e Keep spelled-out emails, IP addresses, recovery phrases and lower-case codes from the place service
Place suggestions still sent "john(at)gmail.com", "10.0.0.1", a wallet's
recovery phrase, a passphrase run together, "license ABC1234", lower-case
codes after a code label ("otp abcdef", "cvv abc") and short phone numbers
read as an address ("Jo 12345-6789", "Mo 0171 12345"), and a phone's three
and four digits could still be searched as a place on purpose. They now stay
in the browser. Real places that only looked private are looked up again:
Akiak, Bearer Island, SSN Station, Shibuya 150-0002. A suggested house is
named in its country's order ("Hauptstraße 12"), and one without a street
keeps its number.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 16:50:46 -08:00
Sameh Khamis 0421813e26 feat(firms): let an application stand in for the fire markers (#1828)
The fire layer takes a stand-in for its markers (setMarkerStandIn({ hitTest })): its glows, heatmap and ambient cards are hidden, and a click the stand-in answers selects and focuses the fire exactly as a marker click does.
2026-11-18 16:47:24 -08:00
Sameh KhamisandManjunath Paparaju 8675ead171 Stop roster hover and focus from moving the camera while Space Missions goes off
While Space Missions was going off (its Satellites restore still running,
the panel still shown), hovering or keyboard-focusing a roster row still
scheduled the roster preview, which flew the camera to that launch with
nothing left to end it. The preview is no longer scheduled once the layer
is going off, and one already pending is dropped. Selection, focus, replay
and stepping from the Data Layers row were already refused then.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 16:37:48 -08:00
Sameh KhamisandManjunath Paparaju 9ac937af82 Let every click subscriber hear a mission-label click
A click a painted overlay handled, such as a Space Missions label, returned
before any click subscriber ran, so the layers that close their cards or let
go of their selection on a click never heard it. Now only the picking the
label replaces is skipped: subscribers still hear the click, marked as an
overlay click whose hit is the label (no draw set, no id, nothing drilled),
and the geometry beneath it is not picked.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 16:36:00 -08:00
Sameh KhamisandManjunath Paparaju ee37511332 Keep the saved Satellites state when Satellites is still busy as Space Missions turns off
When Satellites had not settled within the 30 s limit, turning Space Missions
off cleared the saved Satellites state and put the parameters back before
failing, so Satellites stayed on as Space Missions had switched it with
nothing left to retry. Now a busy Satellites layer is left untouched and the
saved state is kept, so turning Space Missions off again finishes the
restore. A Satellites action the person took still gets its parameters back.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 16:35:52 -08:00
Sameh Khamis 46e831620e Merge pull request #1826 from bilawalsidhu/manjunath/space-missions-layer
Make Space Missions an ordinary layer with its own panel
2026-11-18 16:16:01 -08:00
Sameh KhamisandManjunath Paparaju 6f8ef5c4d1 Name the changelog entry for its pull request
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 16:03:51 -08:00
Sameh KhamisandManjunath Paparaju 67d675c5d9 Keep the Space Missions panel out of the Cockpit and its controls out of teardown
From review:
- Voice "open the Space Missions panel" under the Cockpit opened it and
  wrote its preference; it is refused there now, as the layer's own reveal
  is. On a phone the panel's Missions sheet shows too.
- A voice "context off" switches Space Missions off only when no Context
  mode is on, entering or starting (Contacts), and it also reaches Space
  Missions while the layer is still starting.
- While the layer is going off (its Satellites restore may still run) a
  roster click, focus or replay does nothing.
- Stepping missions from the Data Layers row opens the panel, as a globe
  pick does.
- SHARE-LINK-FORMAT lists panel 11, space-missions-panel (token n).

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 16:03:51 -08:00
Manjunath PaparajuandSameh Khamis 0a6fd5f43f Make Space Missions an ordinary layer with its own panel
Space Missions no longer runs as a Context mode. The launches layer owns
its Satellites dependency, including the rule that a Satellites off
asked for after Space Missions was switched on ends it (request order
decides), and a small controller connects the layer to its own panel and
store. Context no longer isolates, snapshots or restores Space Missions
or Satellites, so Contacts and Space Missions run together in either
order, and scene playback no longer exits an isolating mode. Settled by
the owner: Contacts leaves Satellites as it is, and only a person's or
voice Satellites off ends Space Missions; a scene, story, preset or
other programmatic off does not.

Turning the layer on by hand or by voice, choosing it at first run, or
picking a mission on the globe opens the Space Missions panel, and on a
phone its Missions sheet. Asking voice to open the panel while the layer
is off is refused with a reason, and voice never opens it while the
Cockpit owns the screen. With no Context mode on, a voice Context off
switches Space Missions off. A failed Satellites restore no longer cuts
the layer's teardown short. Mission labels on the globe select their
mission. The layer names a failed first index load itself, so the
Context toast no longer imports Space Missions code.

Also carries the satellites request ordering and
DataLayerManager.waitForLayerIdle, the share token for the panel, voice
panel ids, Cockpit folding the panel away and the phone tab ellipsis.
The panel shares the rail gutters and hover border of the other side
panels.

On top of the Omnibar: "open space missions panel" reaches the new
panel, and Open Context no longer answers to "missions".

Co-authored-by: Sameh Khamis <[email protected]>
2026-11-18 16:03:51 -08:00
Sameh Khamis 8b2ca602e5 Merge pull request #1825 from bilawalsidhu/manjunath/sonar-style
Remove the Cyber HUD layout and keep its sonar as a visual style
2026-11-18 16:03:11 -08:00
Sameh KhamisandManjunath Paparaju d211b9dfc0 Lay the right panels out again once the Stories card has faded in
The card fades in from transparent, and the right column skips
transparent obstacles, so the layout run when the card arrived missed it
and the column stayed under it until something else moved the panels. The
end of the fade now lays the column out again; it also replays when the
card is shown again after the loading screen, recording or clean view.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 15:47:27 -08:00
Sameh KhamisandManjunath Paparaju f254c62704 Name the changelog entry for its pull request
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 15:47:27 -08:00
Sameh KhamisandManjunath Paparaju ea3d543e13 Keep right-to-left credits clear of the corner row and the readout
From review, checked in headless Chromium at 1100-1920px wide, Tactical
and Minimal, left to right and right to left, with a credit line long
enough to wrap:
- Right to left with the Minimal HUD the credits stayed bottom left,
  under the language picker and Power Up: the Minimal placement's two IDs
  outweighed the right-to-left rule, which now matches it.
- Right to left from 1200px a wrapped credit line ran into the Tactical
  bottom-right readout (AIS); the readout sits 1.5rem higher there.
- The left rail no longer reads a top pin no stylesheet sets since Cyber
  went; VUE-MIGRATION no longer lists the removed cyberTheme test, and
  CURRENT-STATE notes the narrow-screen credit line that does not wrap
  (as on main).

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 15:47:27 -08:00
Manjunath PaparajuandSameh Khamis d68adcea21 Remove the Cyber HUD layout and keep its sonar as a visual style
Display > HUD > Sonar now turns the sonar sweep on over Tactical or
Minimal. It is off by default, ON reveals its five sliders, and it keeps
its guards: an OFF control, the sweep only while the HUD is visible and
outside Cockpit, no animation under reduced motion, and repaint timers
re-armed only after a drawn frame that still shows contacts.

The Cyber layout, its shell skin and its Cockpit lanes are removed. Share
links, scenes, saved views and set_hud that name Cyber open Tactical with
Sonar on; links and scene shots record Tactical with Sonar under the same
code, and a restored state that names another layout turns Sonar off.
set_cyber_sonar keeps its name and works under any layout. A newer Sonar
toggle or voice setting wins over a share-link restore that lands later.

From 1200px wide the command dock and World Timeline sit 74px above the
bottom edge, as in the Omnibar layout, leaving the bottom row to the map
attribution (left) and the Power Up corner row (right). The attribution
moves to the bottom right when the page runs right to left, where the
corner row sits at the bottom left, and a long credit line wraps upward
before reaching the corner row. The Tactical bottom-right readout sits
8px above Power Up and the coordinates start level with it. The World
Timeline is narrowed to sit between the corners. Toasts keep clear of
the raised dock and the chat and voice panel height budgets subtract its
rise. Below 1200px the layout is unchanged. The left rail treats the
centered World Timeline and voice control as obstacles only where they
reach a laid-out panel.

On top of the Omnibar: sonar.css replaces cyber.css after the Omnibar
imports, the Omnibar's HUD guide step now says Layout picks Tactical or
Minimal, and the Omnibar's Tactical bottom-right readout keeps the same
8px above Power Up.

Co-authored-by: Sameh Khamis <[email protected]>
2026-11-18 15:47:27 -08:00
Sameh Khamis 35b87c75f2 Merge pull request #1824 from bilawalsidhu/manjunath/search-bar
Add the Omnibar: one field for places, layers, commands and questions
2026-11-18 15:44:16 -08:00
Sameh KhamisandManjunath Paparaju 9df858e9fe Start the right panels below the Stories card while it is up
With the Omnibar's lifted dock the right column rises level with the left
one, under the NEW GEV Stories card, whose buttons then took clicks meant
for the panel's controls (Street Level's FIT and FILL). The card is now an
obstacle for the right column, and its arrival or departure lays the
column out again.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 15:33:06 -08:00
Sameh KhamisandManjunath Paparaju 3d3382f786 Add the changelog entry for the Omnibar
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 15:00:28 -08:00
Sameh KhamisandManjunath Paparaju d7f10e4d2a Fix the search bar's stale errors, hidden-field shortcuts and repeated Enter
From review:
- An error goes when a chip is chosen, and a search's error shows only
  under the line it was for: a lookup that fails after the line was edited
  says nothing under the new text.
- With voice on the field is hidden: "/" and Cmd/Ctrl+K no longer focus
  it, and nothing is looked up for it.
- Without the action runner a refused or cancelled search keeps the line,
  as the plan path does (only true is success).
- Text an input method is still composing is read when it is committed.
- A held or repeated Enter does not restart the same line over its flight.
- A city chip for the city whose landmarks are open flies there instead
  of folding the landmarks.
- "villages around here" is looked up again for the current view.
- Data Layers takes the full lane only where the desktop dock is laid out,
  by the condition omnibar-dock.css uses.
- On short phones the HUD readout moves under the field it shared a row
  with.
- CURRENT-STATE says the phone gains a field and which places are kept.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 15:00:07 -08:00
Sameh KhamisandManjunath Paparaju 24731951a0 Fly a looked-up place by its coordinates alone, and adopt the bar's files
A place row sent its name with its coordinates, and a name that matches a
city preset wins over them: "Paris, Texas" flew to Paris, France. Only the
coordinates go now. The bar's styles and dock tests join the format scope
and the bar its package.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 15:00:07 -08:00
Manjunath PaparajuandSameh Khamis a3f4af91f8 Add the Omnibar: one field above the footer for places, layers and commands
On desktop the dock becomes one search bar (Omnibar.vue) that shows the
rows the line-reading pipeline makes: places with nearby suggestions,
coordinates, map items, layers, commands, plans such as "go to Austin and
show flights", guided walks through the real controls, and Ask GEV for
questions. Enter runs only what the line asks for outright. The map
credits move below the bar onto the Power Up row, the voice waveform
shows in the bar while voice is on, and the dock's Location and Visual
trays are hidden in this layout. The phone layout is unchanged. Long
place names are kept out of automatic Ask GEV.

Co-authored-by: Sameh Khamis <[email protected]>
2026-11-18 15:00:06 -08:00
Sameh Khamis 6e0baacd57 Merge pull request #1819 from bilawalsidhu/samehkhamis/place-privacy
Search box: keep more private text from place suggestions, and name houses by their street
2026-11-18 14:59:55 -08:00
Sameh KhamisandManjunath Paparaju 3404730d41 Let streets named for keys and codes through, and share a request in flight
From review of the first pass:
- Places again: "Secret Key Lake", "Access Token Road", "GATE CODE LANE",
  "OTP Bank", "Auth Code ABCD Street", "California 90210-1234",
  "Cambridge MA. 02139-4307", "12, 10115 Berlin". A key after a space must
  be long, a bare code must hold a digit or be capitals after a label
  that is not and end the line, and ZIP+4 follows a state's code or name.
- Private now: "gate code: abcd", "PIN A7B2", "OTP-ABCDEF", "login code
  ab-12-cd", "auth_token=abc".
- The same text asked while its request is out waits for that answer,
  however slow it is.
- A street without a house number is not named by the street alone.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 14:45:05 -08:00
Sameh KhamisandManjunath Paparaju 9539287a7c Add the changelog entry for the place privacy follow-up
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 14:45:05 -08:00
Sameh KhamisandManjunath Paparaju b7a9fa1c21 Keep more private text from place suggestions, and name houses by their street
- Not sent any more: "john @Gmail.com" (a capital after "@"), "030 12345"
  and "Alice 12345-6789" (read as a house number and postcode),
  "access_token=abcdef", a key in quotes or brackets, and letter codes
  after a code label ("OTP: ABCDEF", "verification code ABCDEF").
- Sent now: "10 Downing Street SW1A2AA, London" (the comma hid the
  postcode). "Pin Oak" and "Gate Code Lane" stay places.
- A house Photon returns without a name is named by its number and street,
  so 10 and 12 Downing Street are two suggestions, not one "London".
- The same text asked twice at once is sent once.
- The village pack's build finds twins near the poles and across 180°;
  the shipped tiles are unchanged.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 14:45:05 -08:00
Sameh Khamis 2b5900ae77 Merge pull request #1818 from bilawalsidhu/manjunath/line-reading
Search box, part 3: read a typed line into places, layers, actions and questions
2026-11-18 14:44:57 -08:00
Sameh KhamisandManjunath Paparaju 36264005a8 Keep panels, compound names and signed coordinates apart when reading a line
- "hide flights near Left Bank, Paris" closed the left panel: a side is
  closed only when the clause names nothing but the side.
- "flights near Trinidad and Tobago" looked up Trinidad alone, and "take me
  to New York City NY" nothing (the command's words counted against the
  name): the whole place is looked up, and the limit counts its words.
- "flights near 30.27, +97.74" and "30.27; -97.74" were split at the sign or
  semicolon; both stay coordinates.
- "hide flights, show ships" listed "No layers are on": several requests in
  a line are read as one plan, as with "and".

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 14:31:45 -08:00
Sameh KhamisandManjunath Paparaju 8dae95e4da Add the changelog entry for reading a search line
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 14:31:45 -08:00
Sameh KhamisandManjunath Paparaju 9a0bccf09b Fly to coordinates after "go to", and count a layer only in a place
- "go to 30.27, -97.74", "go to 14R PU 2090 4906" and "flights near
  30.27, -97.74" were refused as private (their digits) or sent to the
  place service as text; coordinates named as the line's place are now a
  spot to fly to, and the rest of the line is what the privacy rules read.
- A count ("flights over Texas") is offered only for a layer in or near
  a place: "Ship Bottom", "Radio City Music Hall" and "radio settings"
  are no longer counts that Enter would run.
- "go to ," sends nothing to the place service.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 14:31:45 -08:00
Sameh KhamisandManjunath Paparaju 8f577eb0c3 Adopt the line-reading tests into the format scope
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 14:31:45 -08:00
Manjunath PaparajuandSameh Khamis ca77ecfa1d Read a search box line into places, layers, actions and questions
A pure pipeline the search box will show its rows from: omnibarIntent.js
parses a line (a place, a layer, a verb, a question, a panel's text),
omnibarEnter.js picks what Enter does, omnibarGuide.js answers "how do
I" for each feature, and omnibarRows.js turns all of it into rows. Its
strings are translated into every shipped language.

Co-authored-by: Sameh Khamis <[email protected]>
2026-11-18 14:31:45 -08:00
Sameh Khamis edc64bdf9a feat(firms): export the layer's FRP and Confidence filter (#1822)
The fire layer module exports filterFires and DEFAULT_FIRE_FILTER, the filter its markers use, so an application drawing the same detections another way hides the same fires.
2026-11-18 14:29:57 -08:00
Sameh Khamis d6972f8b78 An estimated aircraft position stands in on the trail only until the next received one (#1817)
* An estimated aircraft position stands in on the trail only until the next received one

* Changelog fragment for #1817
2026-11-18 14:05:39 -08:00
Sameh Khamis 522f5b415d Merge pull request #1820 from bilawalsidhu/fleet-entry
Make the fleet models, their handover and the vessel sprites a public entry point
2026-11-18 13:50:29 -08:00
Sameh Khamis ec00773402 Merge branch 'main' into fleet-entry 2026-11-18 13:37:54 -08:00
Sameh Khamis 8074e5a1e4 Merge pull request #1805 from bilawalsidhu/timeline/real-time-label
Name the world timeline's real-time speed Real-time
2026-11-18 13:37:45 -08:00
Sameh Khamis d35f9e14ea Merge branch 'main' into timeline/real-time-label 2026-11-18 13:24:22 -08:00
German Khokhlov e7f4434119 Merge pull request #1787 from bilawalsidhu/fix/cockpit-subject-camera-hud
Keep an application's Cockpit subject steady in the camera and HUD
2026-11-19 01:20:26 +04:00
Sameh Khamis 49b2ac7043 Name the changelog fragment for its pull request 2026-11-18 13:12:34 -08:00
Sameh Khamis e19c84bae4 Make the fleet models, their handover and the vessel sprites a public entry point 2026-11-18 13:12:13 -08:00
Sameh Khamis 5234747b22 changelog: name PR #1805 2026-11-18 13:10:35 -08:00
Sameh Khamis 2c7b52cb7e Merge remote-tracking branch 'origin/main' into timeline/real-time-label 2026-11-18 13:10:20 -08:00
German Khokhlov 0fdfc3cf45 Merge branch 'main' into fix/cockpit-subject-camera-hud 2026-11-19 01:08:29 +04:00
German Khokhlov 20993b910a Merge pull request #1786 from bilawalsidhu/fix/cockpit-ride-transit-rail
Fix application Cockpit rides on Rail trains and Transit vehicles
2026-11-19 01:08:10 +04:00
German Khokhlov 81a6faca9a Merge branch 'main' into fix/cockpit-ride-transit-rail 2026-11-19 00:52:48 +04:00
Sameh Khamis 2a0a3a9b99 Merge pull request #1816 from bilawalsidhu/manjunath/wikidata-places
Search box, part 2: bundle smaller Wikidata settlements for nearby places
2026-11-18 12:50:35 -08:00
German Khokhlov 63817846fc Merge branch 'main' into fix/cockpit-ride-transit-rail 2026-11-19 00:40:42 +04:00
Sameh KhamisandManjunath Paparaju 88919f760f Keep a lookup's places when one tile fails, and ship every tile as its own file
- A tile that cannot be read is left out of placesNear's answer instead of
  failing it; without the pack's index the cities are still the answer.
- The build no longer inlines the small tiles into one chunk that loaded
  with the first lookup: all 732 are their own files.
- A row at latitude 90 or longitude 180 is tiled where the lookups read it.
- --min-population 0 is taken as 0, not as the default.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 12:36:16 -08:00
Sameh KhamisandManjunath Paparaju 2a01269b87 Add the changelog entry for the Wikidata places pack
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 12:36:16 -08:00
Manjunath PaparajuandSameh Khamis 78305411eb Bundle smaller Wikidata settlements for nearby-place lookups
137,662 places of 1,000 to 14,999 people that Wikidata gives a population
and coordinates for, none already in the cities pack, in 732 tiles of
5 x 5 degrees with an index of row counts (CC0). Nothing loads with the
app: a lookup reads the index once and then only the tiles it touches.
placesNear lists the places around a point, and findPlace finds a small
place by name near the view when no city of that name is near. The cities
build script writes the tiles with --tiles; the step from rows to files is
checked offline.

Co-authored-by: Sameh Khamis <[email protected]>
2026-11-18 12:36:16 -08:00
Sameh Khamis 328b8f5d1b Merge pull request #1814 from bilawalsidhu/manjunath/place-suggestions
Search box, part 1: suggest places from Photon while a place is typed
2026-11-18 12:33:50 -08:00
German Khokhlov ee0440e813 Merge branch 'main' into fix/cockpit-subject-camera-hud 2026-11-19 00:28:46 +04:00
German Khokhlov c5fede952f Merge branch 'main' into fix/cockpit-ride-transit-rail 2026-11-19 00:28:44 +04:00
German Khokhlov 83081730c0 Move only the anchor's height when the floor height arrives
- The first height that replaces the entry frame's now moves only the
  anchor's height. The anchor keeps its place and its eased lift, so the
  camera no longer jumps to a corrected fix or steps back.
- A detail line is measured with the title's glyph widths. They are a
  little wide for its smaller type, so a long detail line is no longer
  clipped.
- The first aircraft update is checked in the existing test, and the copy
  is removed; test fixtures are simpler.
- Comments, the release note and CURRENT-STATE match the code.
2026-11-19 00:26:57 +04:00
German Khokhlov e8ef4d1293 Reset a train's turn point on a new playback epoch
- A clock correction starts a new epoch, and playback may first draw its
  second report. The turn point now resets on a new epoch as well as on a
  break, so a standing train no longer turns around after a correction.
- recallDirection and earlierFixes are gone: comparing each earlier report
  with the newest turned a standing train on GPS jitter. A train bound when
  its line arrives late shows no direction until it has moved 15 m.
- Tests share reportDirections, iconOf and the playback helper.
- Comments and CURRENT-STATE match the code.
2026-11-19 00:26:57 +04:00
Sameh KhamisandManjunath Paparaju c06aa37ce2 Keep the place suggester's fair-use and privacy promises
- One spacing, pause and cache for the whole tab, so a search box put up
  again does not start afresh.
- A failed request or a timeout pauses suggestions for a minute, as a
  refusal does.
- A number named as a card, a phone or an account keeps its digits
  together, so no address is read out of them; a UK postcode written
  without its space is a place, not a password.
- The docs say exactly what is sent.

Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 12:20:42 -08:00
Sameh KhamisandManjunath Paparaju 9ec95102ca Add the changelog entry for the place suggester
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 12:20:42 -08:00
Sameh KhamisandManjunath Paparaju c11200976f Say what the place suggester sends to Photon
Co-authored-by: Manjunath Paparaju <[email protected]>
2026-11-18 12:20:42 -08:00
Manjunath PaparajuandSameh Khamis bd7b389cef Suggest places from Photon while a place is typed
The suggester asks Photon, the place search's keyless geocoder, for
candidates as a place is typed: at most one request every 500 ms, a six
second limit, and none for a minute after a refusal. Text that may be
private (an email address, seven or more digits however separated, an
IBAN shape, a password, PIN, token or key) is never sent. It also lists a
region's bundled cities and tells whether a place lies in an extent, for
the search box's place strip. The browser's Photon setting is read in one
place.

Co-authored-by: Sameh Khamis <[email protected]>
2026-11-18 12:20:42 -08:00
Sameh Khamis 2bbcc73f03 Let an application leave the Data Library out (#1815)
* Let an application leave the Data Library out

* Changelog fragment for #1815
2026-11-18 12:16:15 -08:00
Sameh Khamis 4f1a4a3f2a Let an application ask the library catalog with its own fetch (#1810)
createApplicationTools({ library: { fetchImpl } }) hands the fetch to the library source, so a server that wants the application's credentials on its library routes answers the catalog instead of refusing it.
2026-11-18 09:17:33 -08:00
German Khokhlov c190e662bc Stand an inertial subject on its floor once the floor arrives
- The first floor height that replaces the entry frame's height re-anchors
  the camera and resets the smoothed rise, so the subject stands on the
  floor within a second instead of hovering above it.
- A provider's thenable gets one rejection handler; frame fields and eye
  are read once each.
- A progress label's width counts the smaller detail line and full-width
  and astral glyphs.
- Tests cover the first camera update of an aircraft and a vessel, a
  double-click on a selected vessel, a tone-only Live Signals change and a
  getter that throws on its second read; repeated cases share helpers.
- Comments, the release note and CURRENT-STATE say which height the camera
  holds while it waits for the surface and how a Live Signals row keeps
  its time.
2026-11-18 20:49:21 +04:00
German Khokhlov 58afb169d1 Keep a standing train's direction through jitter and missing bearings
- GPS jitter under 15 m at a standing train no longer turns it, in reports
  and in playback; a reversal needs at least 15 m of movement.
- A standing train keeps its operator's last bearing through reports that
  leave it out.
- Playback resets its turn point at a break, so a jump to a corrected
  position is not a reversal.
- A train bound while its line is still loading takes its direction from
  the movement it already made.
- A vehicle in view that leaves a Transit hold goes on from its own clock
  instead of rewinding.
- Tests cover the 15 m boundary, the late line, the hold release and the
  icon after Transit is turned back on; duplicate jitter tests are merged.
- FOLLOW_MIN_MOVE_M is gone; comments and CURRENT-STATE match the code.
2026-11-18 20:49:15 +04:00
manjunath22466 7312280817 fix(earthquakes): address review follow-ups on click arbitration
A drifting touch tap or a cockpit-mode tap on a fire, quake or vessel card
beside an aircraft did nothing: the cards deferred to the aircraft, whose
click handler ignores such taps. Pick owners can now declare the clicks
they ignore (registerPickOwner(..., { declinesClick })); flights and
military decline a drag or a cockpit tap and CCTV declines any click that
is not clean, so a card over them keeps that tap.

Also from review:
- the selected quake's contour rings sit on the ground the disc is draped
  on, re-read through the heights service while they paint;
- a label's fly-to frames the whole disc for large quakes;
- a quake that ages out of the feed clears its selection as evicted;
- id-less quakes are named by their content, not their row;
- the Bhote Koshi trigger-record callout opens its source on a click, as
  its keyboard action does, and yields like the other cards;
- the card's place line is cut to 48 characters, its link hint shows only
  with an opener, and its accessible name carries depth, place and time; a
  link-less card's click and keyboard action fly to the quake;
- camera trace comparison scales its tolerance with the value and wraps
  heading and roll.
2026-11-18 19:19:41 +05:30
German Khokhlov 109bb0fd4f Tidy the Cockpit subject camera and HUD fixes after review
- A provider's look, height and speed are read once, so a getter that
  answers once is not lost; a Promise in a provider's words is refused and
  its rejection handled.
- A huge heading slew rate is capped at a half turn per step instead of
  overflowing to Infinity.
- A row changed in place keeps the time it first appeared; JSDoc,
  CURRENT-STATE and the ETA test say so.
- APPLICATION.md says the app page must load the entry icon's glyph.
- Tests check that entry succeeds, the vessel bridge is entered, a floor
  takes over from the entry height (also at 0 m), and share helpers;
  the provider unit test moves to the provider tests.
- WIDE_GLYPH uses escapes; comments, the release notes and CURRENT-STATE
  match the code.
2026-11-18 15:07:20 +04:00
German Khokhlov df4d76384c Tidy the Rail and Transit ride fixes after review
- A train first seen standing takes its direction from the operator's
  course, not from a course drawn out of GPS jitter.
- Moving a hold to another vehicle releases the first one the same way as
  ending the hold.
- repaint always goes through placeSample, which hides the held vehicle and
  puts it on its current segment, so setShown is no longer exported.
- Tests cover the icon right after a hold, a segment with one known floor,
  a known floor at 0 m and selection by click after the layer comes back;
  shared helpers replace repeated setup.
- Comments, CURRENT-STATE and the release note say what the code does
  without internal figures.
2026-11-18 15:07:06 +04:00
German Khokhlov a72c0ba237 Fix tone-only signal changes, the first anchor step, row order and emoji widths
- A provider's Live Signals row now changes when only its tone does; fields
  are compared one by one instead of through a joined signature.
- The frame that first sets an inertial subject's anchor puts it on the
  subject, so the view no longer jumps ahead after waiting for the floor.
- The subject HUD drops vanished rows before it adds new ones, so
  TRACK ACQUIRED and a steady warning keep their place.
- Progress labels give astral-plane glyphs such as emoji at least main's
  width, so they are not clipped.
2026-11-18 14:32:45 +04:00
German Khokhlov ee5a6ab317 Turn a train that backs away steadily, however small each step
The direction now follows how far a train has come back from the farthest
point it reached, so a slow reversal of under 15 m per report still turns it,
while GPS jitter around one spot does not. Rail policy takes the 15 m figure
from pathBinding instead of repeating it.
2026-11-18 14:32:36 +04:00
Sameh Khamis 747082a5eb Name the changelog entry for its pull request number 2026-11-17 21:46:37 -08:00
Sameh Khamis eb82842e0d Name the world timeline's real-time speed Real-time
The speed control's first entry runs the world clock at real time, which 1× did not say beside 1 min/s, 1 h/s, 1 d/s and 1 wk/s. It now reads Real-time, translated in every catalog.
2026-11-17 21:46:32 -08:00
German Khokhlov c2f73cdc04 Add the changelog fragment for #1787 2026-11-18 00:51:07 +04:00
German Khokhlov ebf2686e2f Number the changelog fragment for #1786 2026-11-18 00:51:07 +04:00
German Khokhlov 5cc217dd1c Correct the Cockpit subject docs and release note
The entry face icon must be one of the Material Symbols the page loads, and
under reduced motion the veil stays: only its light streaks stop.
2026-11-17 19:34:33 +04:00
German Khokhlov a2a61c506f Keep an application's Cockpit subject steady in the camera and HUD
- A height the entry frame gave holds while later frames give none and the
  floor is still cold, so the view no longer waits and ends.
- A subject's camera update advances by the time since the last one, up to
  its interval plus a second: at 5 frames a second an inertial subject no
  longer falls behind (700 m in a minute at 30 m/s), while a hidden tab
  still counts as one late update.
- A provider's Live Signals rows change where they stand and come back
  after newer rows pushed them off, so a changing ETA no longer hides a
  steady warning; the built-in rows log as before.
- Progress labels give full-width glyphs (CJK, kana, Hangul) about 1 em,
  so such stop names no longer overlap.
- A provider's labels, entry face and look start from the words checked at
  registration, so one that fails on its next read keeps them.

The double-click test on a selected vessel now projects through
SceneTransforms, as the scene query port does, with a control that enters
the bridge.
2026-11-17 19:34:32 +04:00
German Khokhlov ec9d5c9e06 Describe the cockpit ride fixes and add their changelog entry 2026-11-17 19:30:47 +04:00
German Khokhlov a7d966ae7e Rail cockpit rides: no height on an unknown floor, a standing train keeps its direction
- railHeightM is null while the train is drawn on the ellipsoid (floor
  quality 0) instead of -1.5 m, so a view waits for the surface.
- An arc step between two reports tells which way a train runs only above
  15 m, the layer's parked-train jitter (FOLLOW_MIN_MOVE_M). GPS jitter of
  a standing train no longer flips the direction through the playback
  segments, which turned a ride 180 degrees every poll.
- drawDirection, a copy of direction, becomes a directionPlayed flag.
2026-11-17 19:30:47 +04:00
German Khokhlov 134138931f Transit cockpit rides: hide the held icon, end a hold with the layer, no ellipsoid height
- A held vehicle's icon is hidden through the renderer (setShown, then
  flushMarkers). The icon sets draw a marker only as last pushed, so the
  direct marker.show write left a parked vehicle's icon drawn under the
  view's eye.
- disable() ends the hold: turned off and on again, the vehicle shows and
  clicks and Escape reach the layer.
- Far above the ground a vehicle with no floor is drawn on the ellipsoid.
  Its snapshot now reports groundHeightM null there, as near the ground,
  instead of -1.5 m.
- The uneven-ground test also checks the snapshot mid-segment, where a
  blend of the two reports' floors would read about 55 m instead of 10 m.
2026-11-17 19:30:47 +04:00
manjunath22466 fde5f95b45 docs(changelog): add earthquake selection entry 2026-11-17 18:34:00 +05:30
manjunath22466 99bd0443cd fix(touch): keep radio and Street Level contacts under a card
Under another layer's card, radio and Street Level yielded whenever their
own pick window found an item that was not the tap's touch contact. If the
contact was a different station or Street Level item of theirs, the card
yielded to that contact too, and the tap did nothing. Under a card they now
act on their own touch contact, and still yield when the contact is not
theirs. On bare map the window keeps its precedence.
2026-11-17 17:18:27 +05:30
manjunath22466 54fd3d3bed fix(picking): settle which layers act on a click when it resolves
The flights and military layers treat the aircraft they already track as
a passive pick, but they start tracking during the click itself. A card
handler running later in the same click then saw the plane as passive and
acted too: a quake card opened its source while the plane started
tracking, and fire, CCTV and vessel cards could do the same.

The pick registry now records the acting owners of a click's exact hit and
touch contact when the dispatcher first resolves them, and the quake,
FIRMS, CCTV, vessel and Context checks read that record for the rest of
the click. Calls without a click keep the live lookup.
2026-11-17 15:51:14 +05:30
manjunath22466 830c980ca6 fix(touch): give each tap to the layer that acts on it
On a coarse pointer the dispatcher can name a contact near the tap instead
of the exact pick. Only flights, military, vessels, radio and Street Level
act on such a contact, so they now register as expanded pick owners, and a
quake card or label yields only to them. A FIRMS fire or CCTV camera reached
only as a nearby contact no longer swallows a quake card, a quake label or
a vessel's own card tap, and FIRMS and CCTV cards yield to a contact whose
layer does act on it.

Radio and Street Level also pick through their own windows. A station or
Street Level item found only there, not as the touch contact, yields to
another layer's card painted over it, and Street Level takes its own touch
contact beyond its narrower window.

Fire, CCTV and vessel cards now act over a passive owner's pick (a flight
trail, the directions route), as the quake card does. The Context panel
leaves a passive route, or a fire or camera reached only as a nearby
contact, to the card painted over it.
2026-11-17 13:18:32 +05:30
manjunath22466 4804097ca1 Merge origin/main into fix/earthquake-click-details 2026-11-17 11:49:17 +05:30
manjunath22466 133d022b29 fix(picking): arbitrate card clicks over passive and background shapes
Flight trails register their ids so every layer reads a trail click as a
no-op, and the directions route claims its line and markers though it acts
only on its maneuver steps. The quake card and magnitude labels yielded to
any registered owner, so over a trail or a route they did nothing. Pick
owners can now name the picks they never act on (registerPickOwner(...,
{ passive })); isActedOnByOtherLayer leaves those out while
isOwnedByOtherLayer is unchanged, so they are still not empty space.

Submarine cables and rocket launches acted on any scene pick, so a card or
label over a cable or a launch marker made both layers act. Both now stand
aside when a world-overlay entry is under the click, as drone airspace and
fire perimeters do through the top-entry check. Each of these layers, and
the quake discs, registers its shapes with registerCardBackground. CCTV
asks isCardBackground instead of matching other layers' set and id formats,
so a live top CCTV card acts once over any of them, while unknown
identified objects and registered owners still block it.
2026-11-17 01:33:06 +05:30
manjunath22466 836daf82b3 fix(overlays): let only the topmost painted card act on a click
Card handlers hit-tested only their own source, so a card buried under
another layer's card still acted, and a click on a selected quake card over
a vessel or fire card made both layers act. Vessels, FIRMS, wildlife, news,
ghost maps and shipwrecks now read the unfiltered topmost painted entry:
their own card acts only when it is on top, and a click on another layer's
card is that layer's, so it neither acts here nor clears a selection.

A top news or wildlife card still acts over another layer's scene item, so
it never goes dead over a flight trail or a directions route; a registered
marker under a foreign card is still its layer's to select.
2026-11-17 01:32:47 +05:30
manjunath22466 5bc31ce08a Merge origin/main into fix/earthquake-click-details 2026-11-16 22:05:23 +05:30
manjunath22466 959698cff9 fix(drone-airspace, perimeters): yield area clicks to cards painted on top
Drone airspace and fire perimeters select a zone or incident from any
shape hit, so a quake card or magnitude label painted over one made both
layers act on a single click: the quake opened its USGS page or flew to the
quake while the area was selected too. Fire and vessel cards over an area
did the same.

The areas now stand aside when another layer's card or label is the topmost
overlay entry, the rule the quake handler already follows for cards painted
over its discs. Deselection and every other path are unchanged. Items of
layers that never act on clicks no longer matter: the quake card and labels
keep working over air-quality stations, traffic lines and OSM places.
2026-11-16 21:13:42 +05:30
manjunath22466 f6314884f7 fix(overlays): keep painted hit rectangles until the next paint
Every overlay change cleared the world overlay's hit rectangles at once, and
only the next paint rebuilt them. When one click subscriber published its
selection card, every later subscriber in the same click saw no overlay at
all, so the outcome of a click depended on listener order: a card or label
painted over another layer's item could lose to that item, or both acted.

Hit rectangles now stay what is painted on screen until the next paint
rebuilds them, so every subscriber reads the overlay the user clicked, and a
paint that draws nothing clears them.
2026-11-16 21:13:32 +05:30
manjunath22466 b2bc15e763 fix(earthquakes): keep quake discs out of pick ownership
Registering quake discs as pick owners changed how other layers read a click
anywhere over a quake: sibling layers yield to owned picks before their own
card hit-tests and treat an owned pick as not empty space. A fire card drawn
over a large quake could not be clicked and the quake beneath was selected,
radio near-miss taps found nothing, and a followed aircraft kept its camera
while the quake took the shared selection.

Leave the discs unregistered, as drone airspace and fire perimeters do, so a
disc reads as empty space to other layers. The quake handler finds its own
discs by draw set, reads the click's resolved hit, and yields when another
layer's card or label is the topmost overlay entry. Another layer's object
under the quake card or a label takes the click before either is read, so a
click on the card over an aircraft does not also open the USGS page. A feed
refresh inside the contour window no longer asks for a frame while the disc
is off screen.
2026-11-16 19:47:30 +05:30
manjunath22466 9f698779be test(track): follow the shared 3D toggle and draw-port trails
The tracked aircraft now takes its model under the same 3D toggle as the
fleet, and trails are drawn through draw-port line sets rather than viewer
entities, so the tracking regression read a contract that no longer exists.
Arm the toggle in the model scenarios and observe the trail head through the
draw port. A trail check with too few frames now fails instead of skipping,
and a missing tracked model before the exit check is an error.
2026-11-16 19:47:15 +05:30
manjunath22466 0a8899d439 test(camera): compare recorded camera traces within platform roundoff
The camera golden test compared the recorded traces byte for byte, so it
failed on arm64, where trigonometry differs from the committed traces in the
last bits (at most 2.1e-9 m on a height, 33 of 1,530 numbers). Compare
structure, keys, array lengths, counters and the viewport exactly, and other
numbers within 1e-8 m for positions and heights and 1e-14 otherwise; a
self-test rejects larger errors, NaN, null, strings and missing or extra
keys. The pose test compares pitch by its sine within 1e-12, as the
conformance suite does, and checks the canonical range. The golden file and
production camera code are unchanged.
2026-11-16 19:47:06 +05:30
manjunath22466 a8ac8eeb9b feat(earthquakes): select quakes by click and show their details
Clicking a quake's disc selects it and shows a card with its magnitude and
USGS class, a class meter with the depth band, place, UTC time and source.
With a USGS event id the card opens the event page. Clicking a magnitude
label, the part a far view can hit, also flies the camera to the quake. The
selection joins the shared context selection, so "what's selected" answers
with it.

The selected disc is painted with a gradient that fades to its outer circle,
and wavy contour lines run out from the marker for three cycles while it is
on screen, then rest as still contours, so a parked camera returns to idle.
A feed refresh updates the selection in place without restarting the lines
or taking back the shared selection.

The package takes input, picking, context, focus, the opener, the painter
and the translator by injection; without them it draws as before.
2026-11-16 17:55:29 +05:30
1192 changed files with 36331 additions and 8844 deletions

No files matched your search

+20
View File
@@ -287,6 +287,7 @@ The optional Local ADS-B layer and the broadcast-FM receiver use radio you recei
- **Acartia.** Keyless. `/api/acartia/sightings` reads the current 7-day marine-mammal feed for ALL, MAMMALS and WHALES views intersecting 45.5–50.5° N, 126–121° W in the Salish Sea. WHALES accepts recognized cetaceans; other identified marine mammals appear under ALL/MAMMALS. The server rounds positions to 0.01° and drops comments before caching projected records (10 min fresh, stale ≤24 h); raw responses are not retained. Selected text cards credit the reporting provider under CC BY 4.0 and show Be Whale Wise guidance. `/sightings/current` answers without a key today, but Acartia's README asks API users to create an account and generate an API key on the [Acartia dashboard](https://acartia.io/) and to follow its [community guidelines](https://acartia.io/register). Attribution also appears in the layer row and Data attribution popover. Opportunistic sightings, not a census.
- **Mapped installations.** OpenFreeMap military polygons use a bundled Overture/OSM name index; wide views show named points. Optional operator-configured Overpass and explicit Google Places searches keep their own source paths. Mapped data does not establish current activity or complete coverage.
- **Place search.** Named-place fly-to uses Google Geocoding when a Maps key is configured, then Photon (`PHOTON_URL`; unset uses the public instance, empty disables it), then `/api/geocode` (Nominatim search) when neither answers. `/api/geocode` and the voice outline route `/api/geocode/outline` share one Nominatim queue (`NOMINATIM_URL`; unset, empty and invalid values disable it; an operator must explicitly select an authorized endpoint): one request at a time at least 1.1 s apart, an identifying `User-Agent` and `Referer`, a short queue that refuses a burst, a pause after 429/403/5xx answers (honouring `Retry-After` in full), at most one retry after a network failure, and a per-install daily cap on public-instance requests (`NOMINATIM_DAILY_CAP`, default 50). Processes using the same installation state file hold one lock through the actual fetch invocation and recording the next public start, with the daily slot persisted before invocation; restarts share that count, spacing and any pause. An unfinished dispatch marker fails closed until operator recovery; it is never automatically reclaimed. Public access fails closed if the state file cannot be read, locked, written or semantically validated. This coordination does not span independent installations or state directories and does not establish an application-wide public-service allowance or authorize public use. An operator-selected non-public endpoint is outside the public cap, spacing and durable-state requirement; an upstream cooldown is kept with the endpoint that returned it rather than leaking across operator URLs. Answers are cached on disk (outlines 90 days, places 30 days, no-results 24 hours); failures are not cached. Outlines are looked up only for an explicit ask, after bundled data and any configured Overpass, and only results whose type suits the ask are used. Administrative outline responses expose country/admin-1/admin-2 identity only when the selected Nominatim row has a recognized, unambiguous address type consistent with its own name; numeric rank, ambiguous types, missing fields and contradictory names do not manufacture identity. It is not used for systematic or bulk queries.
- **Place suggestions.** The search box's suggester (`src/search/placeSuggestions.js`) asks Photon for a few candidates while a place is typed: at most one request every 500 ms per tab (shared by every search box), a six-second limit for the whole answer, none for a minute after a refusal, a failed request or a timeout, and text capped at 200 characters. Text that may be private is never sent: an email address, seven or more digits however separated (a street address's house number and postcode excepted, unless a word such as "card" or "phone" names the number), an IBAN shape, a password, PIN, token or key. An empty `PHOTON_URL` turns suggestions off along with the place search. Answers are cached in the tab.
- **Street and building outlines.** Voice street highlights, pointed-at buildings and grounds use the OpenFreeMap vector tiles the traffic layer already loads. Traffic and outlines share one bounded pending fetch/decode owner per immutable XYZ tile; materialized outline geometry is charged to the retained-byte ceiling and capped by coordinate count. Consumer result caches and request lifetimes remain independent, while eviction or explicit teardown cancels queued idle projections and releases their decoded owner. No Overpass request is made unless `OVERPASS_UPSTREAMS` is configured. Named grounds require a returned name matching the selected place, except that an ask whose head noun names a kind of grounds (a school, university or college, hospital, cemetery, stadium or zoo) may use the part of the smallest unnamed tile area of that class that holds the resolved place; a differently named area never answers. Other anonymous landcover polygons cannot establish identity, so unsupported grounds stay unavailable rather than borrowing a nearby POI name.
- **Voice areas and place search.** Voice areas (`resolve_area`) use the same outline sources as voice outlines. Voice place search (`osm_query`, `/api/osm/features`) runs only on an operator-configured Overpass: a fixed list of kinds, a bounded box and result count, one query at a time, answers cached for a day. It never uses Nominatim.
- **Cockpit regional briefing.** `/api/regional-brief` rounds aircraft coordinates into 0.1° cache cells, caches results for five minutes, and resolves physical regions from bundled public-domain Natural Earth polygons without reverse-geocoding requests. Google News RSS is queried with the resolved locality/region first; GDELT is used only when that RSS query fails or is empty. Google's published Google News terms restrict that source to personal, noncommercial use, so commercial deployments must disable/replace it or obtain separate permission; GDELT permits commercial dataset use with citation. The Data attribution popover identifies the active headline sources; article links retain publisher attribution. Headlines are location-query matches, not verified incidents, risk rankings, or evidence that a location is safe. Empty, partial, stale, and unavailable source states remain distinct. Open-Meteo supplies current conditions independently of the news source. `WX OFF` disables cockpit weather rendering only; the Local Info briefing still fetches its source-backed weather values and displays the required linked Open-Meteo credit.
@@ -424,6 +425,7 @@ The [Bhote Koshi event pack](public/events/bhote-koshi-2026/README.md), under `p
| **Natural Earth disputed areas** (11 of the source's 99 features, hand-picked; [list](src/data/local_data/natural_earth/README.md#disputed-areas-disputed_areasjson)) | `natural_earth/` | **Public domain** | ✅ (no restrictions) | "Made with Natural Earth" (courtesy credit — not legally required) |
| **Natural Earth populated places** (7,342 points: name, position, rank) | `natural_earth/` | **Public domain** | ✅ (no restrictions) | "Made with Natural Earth" (courtesy credit — not legally required) |
| **Wikidata cities** (31,827 settlements of 15,000 people or more: name, position, population, country) | `wikidata_cities/` | **CC0 1.0** (public domain dedication) | ✅ (no restrictions) | "City, town and village names from Wikidata (CC0)" (courtesy credit — not legally required) |
| **Wikidata places** (137,662 settlements of 1,000 to 14,999 people, none in the cities pack, in 732 tiles of 5°: name, position, population, country) | `wikidata_places/` | **CC0 1.0** (public domain dedication) | ✅ (no restrictions) | "City, town and village names from Wikidata (CC0)" (courtesy credit — not legally required) |
| **US Census Bureau counties** (3,235 county polygons) | `us_census_counties/` | **Public domain** | ✅ (no restrictions) | "U.S. Census Bureau" (courtesy — not legally required) |
| **US Census Bureau places** (32,629 city, town and CDP polygons) | `us_census_places/` | **Public domain** | ✅ (no restrictions) | "U.S. Census Bureau" (courtesy — not legally required) |
| **Who's On First neighborhoods** (61,441 polygons) | `wof_neighborhoods/` | Per source: CC BY, ODC-By, Open Government licences, CC0, PDDL, public domain (folder `ATTRIBUTION.md`) | ✅ (attribution) | "Neighborhood boundaries: Who's On First and contributors"; per-source credits in the folder |
@@ -537,6 +539,24 @@ CC0; credited "City, town and village names from Wikidata (CC0)" as a courtesy o
the pack is shown. Rebuild: `node scripts/build-wikidata-cities.mjs`; provenance in the folder
README. The app never calls Wikidata itself.
### Wikidata places (`wikidata_places/`)
Smaller settlements below the cities pack's cut-off: 137,662 places of 1,000 to 14,999 people
that Wikidata states a population and coordinates for, read once from the Wikidata Query Service
(built 2026-11-11), with the same columns as the cities pack. Items the cities pack already holds
(1,084 with another stated population of 15,000 or more) are left out, and so are 1,272 second
listings of one place (same name and country within 3 km). A lookup also prefers a city of the
same name within 3 km over a smaller listing. They are split into 732
tiles of 5 x 5 degrees (7,122,797 bytes of JSON, about 7.1 MB, with the index) named by their south-west corner, with an index of row counts.
Nothing loads with the app: the Omnibar's "places near" strip, the places under a selected item
and a small place found by name near the view read the index once and then only the tiles a
lookup touches. CC0; credited "City, town and village names from Wikidata (CC0)" as a courtesy
once a name from the packs is shown. Rebuild:
`node scripts/build-wikidata-cities.mjs --tiles --min-population 1000 --max-population 15000`;
the script that wrote the shipped tiles was not kept, and only the step from rows to files is
checked offline (provenance and limits in the folder README). The app never calls Wikidata
itself.
### Sky background (`sky/`)
Sources, licences, the changes CC BY asks to state, hashes and build commands
+7 -1
View File
@@ -258,6 +258,12 @@ export function createBrowserViteConfig({
mapillaryToken ?? '',
),
},
build: { chunkSizeWarningLimit: 1500 },
build: {
chunkSizeWarningLimit: 1500,
// The places pack's tiles stay files, read only when a lookup touches
// them; inlined, the small ones would all load with the first lookup.
assetsInlineLimit: (file) =>
file.includes('/wikidata_places/') ? false : undefined,
},
};
}
@@ -1,4 +0,0 @@
- `F` now collapses and reopens the Data Layers panel the way the panel's own
button does, and its rail entry stays. Before, `F` hid the panel together
with its rail entry, so only another `F` brought it back (asturksever,
#1598).
+8 -7
View File
@@ -3,10 +3,11 @@
heading and HUD (in the page's language, via `getLocale` and
`onLocaleChange` from `./i18n`); the camera can follow it without the
ground clamp, anchored exactly on it, and a generic HUD adds source rows, a
banner, a veil (off under reduced motion) and a bottom progress line. The
Rail and Transit layers expose read and hold APIs so a selected train or
vehicle can be ridden, and `./layers/rail/paths` is exported; that export
and the read APIs are experimental. `docs/APPLICATION.md` shows a minimal
provider. GEV itself registers none, and entry to the built-in aircraft,
satellite and vessel views is unchanged; a provider's subject takes entry
when it was selected after them (Denis Groshev, @ZloyS, #1686).
banner, a veil (its light streaks stand still under reduced motion) and a
bottom progress line. The Rail and Transit layers expose read and hold APIs
so a selected train or vehicle can be ridden, and `./layers/rail/paths` is
exported; that export and the read APIs are experimental.
`docs/APPLICATION.md` shows a minimal provider. GEV itself registers none,
and entry to the built-in aircraft, satellite and vessel views is
unchanged; a provider's subject takes entry when it was selected after them
(Denis Groshev, @ZloyS, #1686).
@@ -0,0 +1,7 @@
- Make earthquake discs and magnitude labels selectable, with magnitude, USGS
class, depth, location, time and source details. Labels also fly to the quake;
the selected disc shows a fading gradient and bounded contour animation. A
drag ending on a quake does nothing. The card or label painted on top now
takes a click in every layer: what is drawn under it neither acts nor loses
its selection, and the Context panel names nothing there
(Manjunath, @manjunath22466, #1781).
@@ -0,0 +1,5 @@
- Fix application Cockpit rides on Rail trains and Transit vehicles: a held
parked vehicle no longer leaves its icon under the view, turning Transit off
ends a hold, a view waits for the ground instead of standing on the
ellipsoid, and GPS jitter at a platform no longer turns a ride around
(German, @gekh, #1786).
@@ -0,0 +1,11 @@
- Keep an application's Cockpit subject steady. A subject whose entry frame
gives a height stands there until a later frame or the floor under it gives
another, so the view no longer ends while the floor loads. The camera keeps
up when the browser draws few frames: updated every frame at 5 frames a
second, it used to fall 700 m behind a 30 m/s subject in a minute. A
provider's Live Signals rows change where they stand, their tone included,
and rows it drops leave before new ones come in, so a changing ETA or a
replaced row no longer pushes a steady warning off the list. Progress labels
give CJK, kana and Hangul names the width they need. Labels, entry face and
look keep their last good words when a later read fails
(German, @gekh, #1787).
+1
View File
@@ -0,0 +1 @@
- The world timeline's speed control names its real-time speed **Real-time** instead of `1×`, beside `1 min/s`, `1 h/s`, `1 d/s` and `1 wk/s` (Sameh Khamis, @samehkhamis, #1805).
@@ -0,0 +1,4 @@
- An application can ask the Data Library's catalog with its own fetch
(`createApplicationTools({ library: { fetchImpl } })`), for a server that
wants the application's credentials on its library routes (samehkhamis,
#1810).
+6
View File
@@ -0,0 +1,6 @@
- The place suggester asks Photon for candidates while a place is typed: at
most one request every 500 ms per tab, none for a minute after a refusal
or a failed request, and never text that may be private (an email address,
long numbers, an IBAN shape, a password, PIN, token or key). An empty
`PHOTON_URL` turns it off along with the place search. The search box that
uses it follows (manjunath22466, samehkhamis, #1814).
+3
View File
@@ -0,0 +1,3 @@
- An application built with `createApplicationTools` can leave the Data Library
out with `library: false`: no catalog is asked and no Browse button is drawn
(samehkhamis, #1815).
+4
View File
@@ -0,0 +1,4 @@
- Bundle a pack of 137,662 smaller Wikidata settlements (1,000 to 14,999
people, CC0) in 5° tiles, read only for the tiles a lookup touches, so
nearby places and small places by name can be found without a place
service (manjunath22466, samehkhamis, #1816).
+4
View File
@@ -0,0 +1,4 @@
- An aircraft feed can mark estimated positions (`estimatedByIcao` beside state
vectors, `estimated: true` on a readsb-style row). Such a position still
places the aircraft, but stands in on the tracked trail only until the next
received one, so oceanic trails no longer zigzag (samehkhamis, #1817).
+4
View File
@@ -0,0 +1,4 @@
- Read a typed search line into places, layers, actions and questions,
and pick what Enter runs, ready for the search bar; coordinates after
"go to" are flown to, and text that may be private never leaves the
app (manjunath22466, samehkhamis, #1818).
+4
View File
@@ -0,0 +1,4 @@
- Place suggestions keep more private text to the browser (a capital
after "@", keys after "=" or in quotes, letter codes after a code label,
phone numbers that looked like a postcode), and a house is suggested by
its number and street (manjunath22466, samehkhamis, #1819).
+6
View File
@@ -0,0 +1,6 @@
- The fleet model set and its loader, the aircraft and vessel model
resolvers, the icon-to-model handover distances, model lighting and part
posing, and the vessel hull sprites are part of the package's public entry
points as `gods-eye-view/fleet`, with declarations, so contacts can be drawn
exactly as the Flights and Vessels layers draw them (Sameh Khamis,
@samehkhamis, #XXXX).
+3
View File
@@ -0,0 +1,3 @@
- The fire layer module exports the FRP and Confidence filter its markers use
(`filterFires`, `DEFAULT_FIRE_FILTER`), so an application that draws the same
detections another way can apply the same filter.
+12
View File
@@ -0,0 +1,12 @@
- Add the Omnibar: one field for places, coordinates, map items, layers
and commands, with a strip of nearby places, guided walks through the
real controls (found by everyday wording such as "how do I change the
map style"), plans such as "go to Austin and show flights", and Ask GEV
for questions. On desktop the dock rises to a bar above the bottom with
the map credits below it on the Power Up row, World Time hides while
suggestions or chat are open, and the dock's Location and Visual trays
and the HUD's mode readout give way to the Omnibar and the Visual panel.
Phones get the field too, with the HUD readout under it on short
screens. The last 20 places you went to from the Omnibar are kept in
this browser (`localStorage` `gev:omnibar:recent-places`)
(manjunath22466, samehkhamis, #1824).
+10
View File
@@ -0,0 +1,10 @@
- Remove the Cyber HUD layout and keep its sonar as a visual style. Display >
HUD > Sonar turns it on over Tactical or Minimal; it is off by default and
ON reveals its five sliders. Share links, scenes and saved views that name
Cyber open in Tactical with Sonar on, links and scene shots carry Tactical
with Sonar the same way, and the `set_cyber_sonar` voice action works under
any layout. A newer Sonar choice takes precedence over a pending share-link
restore. From 1200px wide the command dock and World Timeline sit 74px up,
the map attribution sits on the Power Up baseline, and the coordinates start
level with the bottom-right readout instead of overlapping the attribution
and Power Up (manjunath22466, samehkhamis, #1825).
+16
View File
@@ -0,0 +1,16 @@
- Space Missions moves out of the Context panel into its own right-rail panel,
with its own tab on phones, and becomes an ordinary layer. It no longer
switches other layers off or refuses them while it runs, and Context leaves
it and Satellites alone, so it runs beside Contacts in either order
(Contacts no longer switches Satellites off). On desktop, opening Context or
Space Missions collapses the other. Mission labels on the globe are
clickable and select their mission, even where they sit over aircraft or
ships, and picking a mission on the globe opens the panel. The Data Layers
row gets previous and next mission controls. Share links keep the panel
open or closed (a short link made from an older long link, which does not
mention the panel, is two bytes longer), voice can open it, and Cockpit
folds it away like the other map panels. An explicit user or voice
Satellites off request made after Space Missions was switched on ends it
and keeps Satellites off afterwards; scene, story, preset and other
programmatic Satellites changes leave Space Missions running
(manjunath22466, samehkhamis, #1826).
+5
View File
@@ -0,0 +1,5 @@
- Replace the first-run launcher with a three-step welcome: an introduction to
the modes, where to start (Space Missions, Environmental or Explore
manually), then quick tips and links. The Live Contacts starting choice is
gone. GEV Stories opens in the app from the last step, and a light tint (no
blur) sits over the globe while the card is up (manjunath22466, samehkhamis, #1827).
@@ -0,0 +1,5 @@
- The fire layer takes a stand-in for its markers (`setMarkerStandIn`), for an
application that draws the same detections another way: the markers,
heatmap and ambient cards hide, and a click on a fire the application draws
selects it and moves the camera to it, with its card, as a click on its
marker does (samehkhamis, #1828).
+9
View File
@@ -0,0 +1,9 @@
- Space Missions going off no longer acts on a launch hovered, selected or
replayed meanwhile, and Satellites keeps the state it was saved with when
it is still busy (unless it was switched on or off by hand meanwhile); a
Satellites setting changed during a mission, such as a place search ending
tracking, is kept when the mission ends. A click on a mission label is a
click on the card on top, so no layer selects, turns on, flies to or opens
the link of what lies under it; in the cockpit a mission chosen by its
label, its dot or the row's arrows is selected without moving the camera
(manjunath22466, samehkhamis, #1829).
+7
View File
@@ -0,0 +1,7 @@
- More private text typed into the Omnibar or Location search stays off the
place service: emails spelled out or spaced, IP addresses, wallet recovery
phrases, door, alarm and lockbox numbers, codes after their labels,
document and ID numbers, SSNs, more API token shapes and codes in links.
More real places get through: "Boise ID 83702", house numbers in the
order their country writes them, addresses of up to ten words, and long
questions for Ask GEV (manjunath22466, samehkhamis, #1830).
+7
View File
@@ -0,0 +1,7 @@
- The Omnibar reads more lines the way they are meant: a country named with
"and" stays whole ("flights near Trinidad and Tobago"), places show as they
were typed, "hide everything except flights" switches off every other
layer that is on, "remove flights from the map" and a doubled verb are
understood, a grid reference after "near" is the place, and a layer word
that begins a name ("Fire Island") no longer offers a plan to the rest of
it (manjunath22466, samehkhamis, #1831).
@@ -0,0 +1,3 @@
- The fire layer's marker stand-in can set how far the camera stands from a
fire it draws (`focusRangeM`), and a world focus request may carry its own
range (samehkhamis, #1832).
@@ -0,0 +1,4 @@
- Keep the HUD's bottom corners, the Omnibar dock and the corner row clear of
the map credits at every desktop width, also right to left and when the
credits wrap onto several lines; and carry Sonar with the Minimal HUD layout
in share links and scene shots (manjunath22466, samehkhamis, #1833).
+5
View File
@@ -0,0 +1,5 @@
- Renderer contract: a timed imagery source can be `decoded` (the
`imageryDecoded` capability), tiles the application makes itself and hands
over as finished images, slot by slot; the Cesium renderer draws each slot
as an imagery layer of its own, and the check `globe.imagery.decoded` covers
it (Sameh Khamis, #1834).
@@ -0,0 +1,3 @@
- Icons drawn over depth (aircraft, vessels) no longer vanish for a frame now
and then in dense far-away clusters: they sit just past the near plane instead
of exactly on it, where rounding could discard them (samehkhamis, #1835).
+3
View File
@@ -0,0 +1,3 @@
- The delayed-live aircraft icon test holds the clock still while it compares
drawn and read positions, so it no longer fails on a busy machine
(samehkhamis, #1836).
+4
View File
@@ -0,0 +1,4 @@
- Keep the left and right panel rails clear of obstacles across the middle
of a short window, such as the World Timeline or a card: both rails put
the panels on the side with more room, whatever order the obstacles come
in (manjunath22466, samehkhamis, #1837).
@@ -0,0 +1,4 @@
- "Villages near" a name picks the place of that name in view over a far
bigger namesake, a place lookup reads the detail tiles within 500 km at
most, and rebuilding the places pack never leaves it half removed
(manjunath22466, samehkhamis, #1838).
+4
View File
@@ -0,0 +1,4 @@
- The Vue kit's button, chip, badge, empty state and segmented control now
carry Core's standard looks, so controls can be built from the kit without
restyling them; nothing in the app changes look (manjunath22466,
samehkhamis, #1839).
+3
View File
@@ -0,0 +1,3 @@
- Every close, dismiss and clear button in the views is now one kit
component, `UiCloseButton`, with the same look and behaviour as before
(manjunath22466, samehkhamis, #1840).
+3
View File
@@ -0,0 +1,3 @@
- The Context panel search and the Layer Finder search are now one kit
component, `UiSearchField`, with the same look and behaviour as before
(manjunath22466, samehkhamis, #1841).
+4
View File
@@ -0,0 +1,4 @@
- The Visual panel's toggles, the voice settings, the Data Library's
"available only" box and the welcome screen's "Don't show this again" are
now one kit component, `UiCheckbox`, with the same look and behaviour as
before (manjunath22466, samehkhamis, #1842).
+3 -1
View File
@@ -396,7 +396,9 @@ their `this`; one that throws or returns a promise is treated as having
failed. What a method returns may carry getters: one that throws when read
makes a candidate none, a frame malformed (the view ends) and a HUD view keep
the last; a worded member (labels, entry face, look) that throws keeps its
last good words.
last good words. An entry face's `icon` is a Material Symbols name whose glyph
the application's page must load (GEV's own `index.html` loads a subset, its
`icon_names`); a glyph the page does not load renders as its name.
```js
import { getLocale, onLocaleChange } from 'gods-eye-view/i18n';
+1 -2
View File
@@ -781,8 +781,7 @@ palettes use `--gev-field-background`, `--gev-field-border-color`,
`--gev-field-color` and `--gev-field-disabled-opacity`. Radio retains its own
compact density and arrow space. CCTV owns calibration editor width in
`cctv.css`; the shared inline density does not impose a feature-specific width.
Cyber supplies a shared-field palette explicitly and keeps its legacy native
field rules separate, so Radio's palette remains an intentional exception.
Radio's palette remains an intentional exception.
### Read-only status badges
+653 -171
View File
File diff suppressed because it is too large. Load diff
+18 -1
View File
@@ -28,7 +28,12 @@ own `.d.ts`:
- `gods-eye-view/render/recession`: how a set that recedes shrinks and
fades its items toward the limb;
- `gods-eye-view/render/windStreamlines`: the wind field's streamlines;
- `gods-eye-view/geo/screenCluster`: screen-space clustering.
- `gods-eye-view/geo/screenCluster`: screen-space clustering;
- `gods-eye-view/fleet`: fleet contacts as the Flights and Vessels layers
draw them: the fleet model set and its loader, which model and size an
aircraft or a vessel takes, the distances a contact's icon hands over to
its model at, how a model is lit, tinted and posed, and the vessel hull
sprites.
`src/render/neutralExports.test.mjs` checks that each is declared, that its
names match what it exports, that it type-checks under strict TypeScript and
@@ -356,6 +361,18 @@ names the nearest frame's time once every globe tile drawn shows that
frame's own imagery (`src/render/cesium/imageryFrames.js`). The checks
`globe.imagery.frames` and `globe.imagery.video` cover both.
It also draws `decoded` sources (`imageryDecoded`): tiles the application
makes itself and hands over as finished images. Their slots are times: the
source's `slotAt` names the slot a time shows and `prefetch` the slots held
ahead, of which the first `prefetch` (the option, 1 by default) load unseen.
Each slot is a Cesium imagery layer in the layer's tiling whose tiles are the
images the source's `tile` answers, asked as `shown` or `prefetch`; a
deferred tile is asked again on a later frame, a missing one draws its
parent's, and a slot let go aborts the tiles it still waits on and closes an
image that arrives after. A time with no slot draws nothing and announces
nothing; `frameReady` names the slot shown once it is drawn. The check
`globe.imagery.decoded` covers it.
Every Cesium draw set takes `setColumns` (`columns`): icon sets on the GPU,
any other as the rows the columns make over the items it holds, each row the
item of that id with the columns' fields over it, replacing every item as
+7 -1
View File
@@ -54,8 +54,14 @@ fallback for zero; holds may be zero.
Visual fields are `style`, `mapStack`, `styleParams`, `bloom`, `sharpen`, `hud`, and
`detection`, and `scope`. Bloom has `enabled`, `intensity`, `version`; sharpen has `enabled`,
`intensity`; HUD has `visible`, `variant`; detection has `mode`, `density`,
`intensity`; HUD has `visible`, `variant` and an optional `sonar`; detection has `mode`, `density`,
`allocation`, `fadePct` and `outsideOpacityPct`. Scope has `enabled`, `featherPct`.
HUD `sonar: true` is Sonar on beside a layout that cannot say it (Minimal); it
is written only then, so Tactical with Sonar stays the variant `cyber` and a
shot without Sonar has no `sonar`. A shot without it opens with Sonar on only
when its variant is `cyber`. A build from before `sonar` refuses a project
that has it, as it refuses any field it does not know; every other project
still opens there.
The latter settings were written by Update Shot but previously lost during
normalization; they now survive import and capture.
Version-1/2 bloom without an explicit scale version uses the original inverted
+7 -2
View File
@@ -134,7 +134,7 @@ probability of about 255 in 256 (many of them already fail as base64url).
| 13 | thing | LEN | none | sub-message, see thing views |
| 14 | `style` | enum | `normal` | normal, retro, surveillance, thermal, anime, noir, snow (retired) |
| 15 | `mapStack` | enum | `photoreal` | photoreal, bing-aerial, bing-labels, esri-imagery, osm |
| 16 | `hudVariant` | enum | style | tactical, operator (retired), minimal, cyber |
| 16 | `hudVariant` | enum | style | tactical, operator (retired), minimal, cyber (Tactical + Sonar) |
| 17 | `bloomIntensity` | uint | style | |
| 18 | `bloomVersion` | uint | 2 | |
| 19 | `sharpenIntensity` | uint | style | |
@@ -176,7 +176,11 @@ Opacity slider (the long form's `sco`). It is written only below 100, so a
link made before it, which opens at full opacity, keeps its code.
Flag bits (field 9): 0 `bloom`, 1 `sharpen`, 2 `hudVisible`, 3
`celestialRing` (each defaulting by style), 4 `scopeEnabled` (default on).
`celestialRing` (each defaulting by style), 4 `scopeEnabled` (default on), 5
`hudSonar` (default off). `hudSonar` is Sonar on beside a HUD layout whose code
cannot say so, Minimal (the long form's `hs=1`); Tactical with Sonar stays the
`cyber` layout code alone. A link made before the bit has it off, and opens
with Sonar on only when it names `cyber`, as before.
### Style defaults
@@ -282,6 +286,7 @@ reserved: a decoder ignores that entry, as for collapsed 0.
| 8 | `global-context-panel` | `g` | collapsed |
| 9 | `pp-toggles` | `p` | collapsed |
| 10 | `param-slider-panel` | `m` | expanded |
| 11 | `space-missions-panel` | `n` | collapsed |
### Style parameters (field 27)
+71 -13
View File
@@ -37,14 +37,39 @@ one-panel rule too. Share links continue to record which panels are open.
## Component kit
`src/ui/kit/` holds the generic components: `UiRail`, `UiTooltip`, `UiIcon`,
`UiButton`, `UiPanel`, `UiSegmented`, `UiSlider`, `UiChip`, `UiSelect`,
`UiBadge` and `UiEmpty` so far, with more joining as the controls they serve
are converted. One component
`UiButton`, `UiCloseButton`, `UiPanel`, `UiSegmented`, `UiSlider`, `UiChip`,
`UiSelect`, `UiSearchField`, `UiCheckbox`, `UiBadge` and `UiEmpty` so far, with more
joining as the controls they serve are converted. One component
serves every use of a control, with props for the differences (`UiPanel`'s
`sideways`, `glow`, `scroll`), rather than a copy per panel. The components
are styled by the existing stylesheet and custom properties; a kit class such as
`ui-button--icon` carries no Core style yet, and a converted control keeps
its own classes beside it. They contain no application state.
are styled by the existing stylesheet and custom properties, and they contain
no application state. The kit's own classes wear Core's standard looks, each
sharing one selector list with the Core skin it comes from, so the rules are
never copied:
| Kit class | Look | Rules |
| --- | --- | --- |
| `UiButton` `variant="ghost"` (default) | none: the caller's classes style it | — |
| `UiButton` `variant="action"` | the action surface (`gev-action-button`); `tone="danger"` hovers red, `size="compact"` is the shot-row footprint (on this variant only) | `src/ui/styles/action-button.css` |
| `UiButton` `variant="primary"` | the action surface with a group's main-action accent | `src/ui/styles/action-button.css` |
| `UiButton` `variant="icon"` | the 22px square glyph button of a panel's collapse toggle | `src/ui/styles/controls.css` |
| `UiCloseButton` | a close, dismiss or clear button: a bare glyph (× with `glyph="times"`, the Material `close` symbol with `glyph="icon"`) with no padding, border or background of its own and a pointer; the site's feature class sets size, colour, hover and any surface, and `bare` leaves the look off for a skin that sets its own padding and border | `src/ui/styles/close-button.css` |
| `UiSearchField` | a search field: the Material `search` glyph and a search input in a flex row, the input bare (no border or background, free to shrink); the site's feature classes set the frame's size, surface and focus ring and the input's type and outline, and the browser's own cancel button is left to each skin | `src/ui/styles/search-field.css` |
| `UiCheckbox` | a checkbox: a label wrapping a native box and its words in a centred flex row; the box keeps each site's size, margin and accent colour, and the site's feature class sets the row's gap, direction and colour | `src/ui/styles/checkbox.css` |
| `UiChip` | the read-only chip (a pill of uppercase mono text); `selected` takes the accent | `src/ui/styles/chip.css` |
| `UiEmpty` | the one-line empty state (dim mono text), its hint on a line below | `src/ui/styles/empty-state.css` |
| `UiBadge` | the read-only badge (`gev-status-badge`) | `src/ui/styles/status-badge.css` |
| `UiSegmented` | the segmented control (`gev-segmented`, `gev-segment`) | `src/ui/styles/segmented-control.css` |
A pressed action, primary or icon button looks as a hovered regular one does
(a compact action's quieter hover is for an unpressed button), and a disabled
one dims and ignores hover and press. `tone` is `accent` or `danger`, and
`size` styles the action variant only. Each look's resting rule selects one
kit class; the button, chip and empty-state skins load before the feature
stylesheets that restyle them, so a feature class still wins. The badge and
segmented skins are the stylesheets their Core classes always used. A
converted control keeps its own classes beside the kit's.
`src/ui/kit/kitStyles.test.mjs` pins these rules.
`UiPanel` takes a `title`, slots and `v-model:collapsed`, but its
`collapsed` drives only the button and `ui-panel--collapsed`: the root's
`collapsed` class, which hides the body, is drawn at once by `v-panel-state`
@@ -74,9 +99,43 @@ gain) takes `hold`. Every select in the views is a `UiSelect`.
density variants and colours stay caller classes, and it renders the CCTV
source and calibration badges and the rail card badges. `UiEmpty` takes
a `title` and `hint`, but Core's empty states are one line, so the title
is the text itself rather than a bold heading; the Scene shot list, mission
roster and imagery strip use it. The locale picker's and the mission tables'
is the text itself rather than a bold heading; the News feed, Scene shot
list, mission roster and imagery strip use it. The locale picker's and the mission tables'
empty rows stay a paragraph and table cells.
`UiCloseButton` is a `UiButton` with a fixed glyph, a required `label` and
no tip unless the site passes a `title`; attributes and classes pass through,
so each site keeps its id, feature class and look. Every close, dismiss and
clear button in the views is one (`src/ui/kit/closeButtons.test.mjs` pins
it); Street Level's and the space mission's keep `bare`, since their skins
set their own padding and border. The close buttons built in script (credits, the
Quebec CCTV overlay, the guide) are not converted yet.
`UiSearchField` takes `v-model`, a required `label` (the input's
accessible name), `placeholder` and `tag` (`div`, given `role="search"` by
the site, or `label`); attributes and classes go to the frame, and
`inputId`, `inputClass`, `autocomplete` and `spellcheck` to the input. With
`clearLabel` it shows a `UiCloseButton` (`clearClass`, its label as its tip)
while text is typed, which empties the field and focuses the input again.
Escape stops at the input and is emitted with its event, so a site that also
keeps the browser from clearing the field prevents it there; `focus()`
focuses the input. The Context search and the Layer Finder's are
`UiSearchField`s; the locale picker's combobox, the Omnibar's location
field and the Data Library's labelled search are other controls. Its kit rules hold the declarations both search
skins had in common, moved rather than copied, and load before them.
`UiCheckbox` is a `<label>` wrapping a native `<input type="checkbox">` and
its default slot; `trailing` puts the box after the words, as the Visual
panel's rows have it. It takes `v-model` (the change emits the checked state)
and emits `change` with its event; without a `modelValue` the box is the
browser's own, as the welcome card's "Don't show this again" is, whose
owner puts a refused save back itself. `restore` puts the box back to
`modelValue` once a change has rendered without the owner taking it, so the
voice panel's quick commands and Voice Preview show the applied value after
a refused change. Attributes and classes go to the label; `inputId` and
`inputAttrs` (such as `aria-describedby` or a data hook) to the box. The
Visual panel's Scope, sky and application toggles, the voice and chat
preferences, the Data Library's filter and the welcome card's box are
`UiCheckbox`es (`src/ui/kit/checkboxes.test.mjs` pins it); Story Explore's
filters are not converted yet. Its kit rule holds the centred row the
checkbox-only labels drew, moved rather than copied.
`UiSlider` keeps the native range input rather than drawing a
`role="slider"` track, so Core's keyboard, form behaviour and styling stay;
it takes `v-model`, `min`, `max`, `step` and `disabled`, emits a
@@ -92,8 +151,7 @@ a functional component would not render again.
Controls share one skin, so every panel reads the same. Every scrolling
surface carries the kit's `.ui-scroll`, which draws the thin
themed scrollbar from `--scroll-thumb` and `--scroll-track`; the Cyber theme
sets those two tokens, and Cockpit's HUD windows keep their accent tint. A
themed scrollbar from `--scroll-thumb` and `--scroll-track`, and Cockpit's HUD windows keep their accent tint. A
surface without it would draw the platform's light scrollbar, because the
page declares no dark `color-scheme`. Selects and number fields are
`.gev-field`, which draws its own chevron in place of the platform's arrow
@@ -338,8 +396,8 @@ a feature supplying only its accent.
records surface by surface; [Building UI](../CONTRIBUTING.md#building-ui)
now requires the pattern for new UI. The page-level markup tests read
`renderApplicationHtml()`, the real views rendered on the server, and new
tests mount components; three tests still read a `.vue` file's source
(`cyberTheme`, `panelStorageDocs`, `geoFileImport`). The views translate with `t()`
tests mount components; two tests still read a `.vue` file's source
(`panelStorageDocs`, `geoFileImport`). The views translate with `t()`
while rendering, and vue-i18n holds the locale they read; the attribute
translation pass is left for static page markup (the loading screen and a
host's own markup). An explicit API for hosts to register panels and rail items is
@@ -361,7 +419,7 @@ a feature supplying only its accent.
- Panels lifted out of a view keep its verbatim markup in
`src/ui/views/panels/`, which Prettier leaves alone like the views.
- Visual parity: before/after screenshots of every panel at desktop and phone
widths, in the default and Cyber themes, with the rail as the only expected
widths, in the default theme, with the rail as the only expected
difference.
- Browser QA: the selector-based `scripts/qa-*.mjs` suites keep passing.
- `npm run format:check`, `npm run check:boundaries`, `npm run i18n` and
+9 -11
View File
@@ -1,9 +1,8 @@
# Panel surface contract
`src/ui/styles/panel-surfaces.css` supplies an opt-in visual surface for new
panels. It uses the application's default color, font, border and radius tokens;
Cyber supplies its existing red/slate palette, monospace typography and shaped
frame. This is CSS shared by the existing panel system, not a panel registry or
panels. It uses the application's default color, font, border and radius tokens.
This is CSS shared by the existing panel system, not a panel registry or
a controller. A panel ID does not need a new theme selector.
## Markup
@@ -57,13 +56,12 @@ fit when those contents should instead scroll.
| Mount | Shared contract | Owner responsibilities |
| ------------------------------------- | --------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Direct child of `#left-panel-stack` | An owner with a direct `[data-panel-surface]` child receives relative positioning and allocated height; inner surface/body skin | Add the wrapper shown above, use the existing layout/disclosure owners, and retain left-rail focus/auto-collapse rules. |
| Direct child of `#right-context-rail` | The same hooks with right-rail allocation and intrinsic measurement | Keep `data-rail-scroller` on the body so measurement preserves its scroll position. Respect Cyber's one-expanded-panel policy. |
| Direct child of `#right-context-rail` | The same hooks with right-rail allocation and intrinsic measurement | Keep `data-rail-scroller` on the body so measurement preserves its scroll position. |
| Surface inside `#command-dock` | Surface, controls, popup decoration and inherited dock concealment | Supply geometry, stacking, disclosure, pin behavior if wanted, safe viewport bounds and dismissal. This CSS does not extend the existing Location/Visual Presets tray stack manager to arbitrary panels. |
| `dialog[data-panel-surface]` | The same surface/body skin; a closed dialog remains hidden | Set width/max-height, use `showModal()` or `show()` and `close()`, and own labels, initial/return focus and dismissal. Do not put `panel-collapsible` on a dialog. |
For rails, `--panel-expanded-width` and `--panel-collapsed-width` customize
the desired widths within the rail; otherwise Cyber uses its existing left,
right and collapsed panel widths. `--left-panel-allocated-height` and
the desired widths within the rail. `--left-panel-allocated-height` and
`--right-panel-allocated-height` belong
to the existing layout owner, not to individual panels. The surface must be
the wrapper's first non-glow child because left-rail intrinsic measurement
@@ -121,9 +119,9 @@ dismiss open popups/dialogs and restore focus before removing a dynamic panel.
## Decoration, popups and visibility
The shared surface reserves `::before` for its non-interactive background. The
Cyber frame clips this pseudo-element only; the surface stays unclipped with
visible overflow. This follows the existing Display and Global Context pattern.
The shared surface reserves `::before` for its non-interactive background; the
surface stays unclipped with visible overflow. This follows the existing
Display and Global Context pattern.
Putting the shape on an interactive ancestor clips all descendant popups even
if their `z-index` is high. A scrolling body also clips descendants by design,
so outward popups must be siblings of the body, or use an explicitly owned
@@ -148,8 +146,8 @@ visible.
## Check an addition
Use the real application with the default and Cyber themes. Check open,
collapsed, hidden, disabled/error, theme round trips, clean UI/recording and
Use the real application with the Tactical and Minimal HUD layouts. Check open,
collapsed, hidden, disabled/error, layout round trips, clean UI/recording and
the intended Cockpit behavior. Exercise keyboard focus, Escape, pointer input,
the last scrolling item, resize without reload and any pin/unpin controls.
For an outward popup, test visible pixels and pointer hit-testing outside the
-1
View File
@@ -65,7 +65,6 @@ The `many` form is the `other` text with «de» after the number: «{count} de c
| detection overlay | superposición de detección |
| pin (Draw tool) | marcador |
| Bloom / Glow (visual effect) | resplandor |
| Cyber (HUD layout, effect) | Ciber |
| heading, course / altitude / ground speed | rumbo / altitud / velocidad respecto al suelo (short: VEL. SUELO) |
| HDG / BRG / CRS / FOV / DEST / SPD / RANGE | HDG / BRG / CRS / FOV / DEST / SPD / RANGE (unchanged) |
| PREV / NEXT | ANT. / SIG. |
-1
View File
@@ -82,7 +82,6 @@ The `many` form is the `other` text with « de » (« d' » before a vowel) afte
| Recent Imagery / box | imagerie récente / zone |
| Daily overview / overview (Recent Imagery VIIRS product) | vue quotidienne (one name for the product, not « vue d'ensemble ») |
| pin (Draw tool) / pin (Recent Imagery) | épingle / épingler |
| Cyber (HUD layout, effect) | Cyber |
| heading / course (ground track) / altitude / ground speed | cap / route / altitude / vitesse sol |
| HDG / BRG / CRS / FOV / DEST / SPD / ALT | unchanged |
| RANGE / PITCH / HGT (CCTV calibration chips) | PORTÉE / INCL. / HAUT. |
+1 -1
View File
@@ -82,7 +82,7 @@ The `many` form is the `other` text with «di» after the number when a noun fol
| briefing / panel / dock | briefing / pannello / dock |
| cockpit | cockpit |
| preset / visual preset | preset / preset visivo |
| Tactical / Minimal / Cyber | Tattico / Minimale / Cyber |
| Tactical / Minimal | Tattico / Minimale |
| Scope (circular viewport mask) / keyhole | scope / foro |
| feather / fade | sfumatura / dissolvenza |
| detection overlay | overlay di rilevamento |
+1 -1
View File
@@ -61,7 +61,7 @@ Translation source: abiyeenzo (#913).
| scene / shot | シーン / ショット |
| briefing / panel / dock | ブリーフィング / パネル / ドック |
| preset / visual preset | プリセット / ビジュアルプリセット |
| Tactical / Minimal / Cyber | タクティカル / ミニマル / サイバー |
| Tactical / Minimal | タクティカル / ミニマル |
| Scope (circular viewport mask) / keyhole | スコープ / キーホール |
| Clean UI | クリーンUI |
| cockpit | コックピット |
-1
View File
@@ -91,7 +91,6 @@ The `many` form is the `other` text with «de» after the number: «{count} de c
| feather / fade | suavização / esmaecimento |
| detection overlay | sobreposição de detecção |
| pin (Draw tool) / box (Recent Imagery) | marcador / área |
| Cyber (HUD layout, effect) | Ciber |
| heading / course / altitude / ground speed | rumo / curso (a ship's course: rumo) / altitude / velocidade solo (VELOC. SOLO) |
| map heading / bearing (compass, north up) | orientação (do mapa) |
| HDG / BRG / CRS / FOV / DEST / SPD / RANGE | HDG / BRG / CRS / FOV / DEST / SPD / RANGE (unchanged) |
+1 -1
View File
@@ -43,7 +43,7 @@ Translation sources: abiyeenzo (#914) and EDIT-Aeterna (#979).
| briefing / panel / dock | 简报 / 面板 / 停靠栏 |
| preset / visual preset | 预设 / 视觉预设 |
| Display / HUD layout | 显示 / HUD 布局 |
| Tactical / Minimal / Cyber | 战术 / 精简 / 赛博 |
| Tactical / Minimal | 战术 / 精简 |
| Scope (circular viewport mask) / keyhole | 视域 |
| Clean UI | 纯净界面 |
| cockpit | 座舱 |
+1
View File
@@ -350,6 +350,7 @@
"./render/weather": "./src/render/weather.js",
"./weather/effects": "./src/weatherEffectsMath.js",
"./geo/screenCluster": "./src/geo/screenCluster.js",
"./fleet": "./src/fleet/index.js",
"./layers/wildlife-sightings": "./src/layers/wildlifeSightings/index.js",
"./layers/wildlife-sightings/source": "./src/layers/wildlifeSightings/source.js"
}
+84 -7
View File
@@ -20,13 +20,31 @@
* request runs at a time, with a pause between requests, and a refusal's
* Retry-After is honoured.
*
* With `--tiles`, the same query between `--min-population` and
* `--max-population` (1,000 and 15,000 by default) builds the detail tiles
* instead, and writes only to:
*
* src/data/local_data/wikidata_places/
*
* replacing that folder's tiles, `index.json` and `files.js` (see
* scripts/wikidataPlaceTiles.mjs). The checks that well-known cities are
* present apply to the cities pack only.
*
* Usage:
* node scripts/build-wikidata-cities.mjs [--min-population 15000]
* node scripts/build-wikidata-cities.mjs --tiles [--min-population 1000] [--max-population 15000]
*/
import { mkdir, writeFile } from 'node:fs/promises';
import { mkdir, readdir, readFile, rm, writeFile } from 'node:fs/promises';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
import {
keepBuiltIfUnchanged,
keepPackBuiltIfUnchanged,
placeTileFiles,
withoutCities,
withoutNearTwins,
} from './wikidataPlaceTiles.mjs';
const ENDPOINT = 'https://query.wikidata.org/sparql';
const USER_AGENT =
@@ -37,11 +55,23 @@ const LABEL_BATCH = 400;
const args = process.argv.slice(2);
const flag = (name) =>
args.includes(name) ? Number(args[args.indexOf(name) + 1]) : NaN;
const minPopulation = flag('--min-population') || 15000;
args.includes(name) ? Number(args[args.indexOf(name) + 1]) : undefined;
const tilesMode = args.includes('--tiles');
const minPopulation = flag('--min-population') ?? (tilesMode ? 1000 : 15000);
const maxPopulation =
flag('--max-population') ?? (tilesMode ? 15000 : Infinity);
if (!(maxPopulation > minPopulation))
throw new Error('--max-population must be above --min-population');
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const outDir = path.join(root, 'src/data/local_data/wikidata_cities');
const outDir = path.join(
root,
tilesMode
? 'src/data/local_data/wikidata_places'
: 'src/data/local_data/wikidata_cities',
);
/** A file's text, or undefined when there is none yet. */
const readIfThere = (file) => readFile(file, 'utf8').catch(() => undefined);
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
const qid = (uri) => uri.slice(uri.lastIndexOf('/') + 1);
@@ -222,7 +252,7 @@ const grouped = new Set();
const settled = new Set();
const places = new Map();
for (const [low, high] of bands(minPopulation, Infinity)) {
for (const [low, high] of bands(minPopulation, maxPopulation)) {
console.log(`Population ${low}–${Number.isFinite(high) ? high : '∞'}…`);
const rows = await bandRows(low, high);
let kept = 0;
@@ -434,7 +464,7 @@ if (intruders.length) {
`Groupings got in: ${intruders.map(([id, name]) => `${name} (${id})`).join(', ')}`,
);
}
if (missing.length) {
if (missing.length && !tilesMode) {
throw new Error(
`Expected cities are missing: ${missing.map(([id, name]) => `${name} (${id})`).join(', ')}`,
);
@@ -450,6 +480,53 @@ const meta = {
};
await mkdir(outDir, { recursive: true });
if (tilesMode) {
// Places the cities pack already has stay out of the tiles: an item with
// one stated population under the cut-off and another over it is in both
// query ranges. Build the cities pack first.
const citiesFile = path.join(
root,
'src/data/local_data/wikidata_cities/cities.json',
);
const cityIds = JSON.parse(await readFile(citiesFile, 'utf8')).rows.map(
(row) => row[5],
);
const outsideCities = withoutCities(rows, cityIds);
console.log(
`${rows.length - outsideCities.length} places left to the cities pack`,
);
// One place listed twice nearby under one name keeps its larger listing.
const tileRows = withoutNearTwins(outsideCities);
console.log(`${outsideCities.length - tileRows.length} near twins left out`);
const files = placeTileFiles(tileRows, {
...meta,
count: tileRows.length,
maxPopulation,
});
// The new files are all written before tiles from an earlier build that
// this one has no rows for go, so a build that stops part way never leaves
// an index naming a removed tile.
const earlier = new Map();
for (const name of await readdir(outDir))
if (/^-?\d+_-?\d+\.json$|^index\.json$|^files\.js$/.test(name))
earlier.set(name, await readFile(path.join(outDir, name), 'utf8'));
keepPackBuiltIfUnchanged(files, earlier);
for (const [name, text] of files)
await writeFile(path.join(outDir, name), text);
for (const name of await readdir(outDir))
if (/^-?\d+_-?\d+\.json$/.test(name) && !files.has(name))
await rm(path.join(outDir, name));
console.log(
`Wrote ${tileRows.length} places in ${files.size - 2} tiles to ${path.relative(root, outDir)}`,
);
process.exit(0);
}
const file = path.join(outDir, 'cities.json');
await writeFile(file, `${JSON.stringify({ meta, rows })}\n`);
await writeFile(
file,
keepBuiltIfUnchanged(
`${JSON.stringify({ meta, rows })}\n`,
await readIfThere(file),
),
);
console.log(`Wrote ${rows.length} places to ${path.relative(root, file)}`);
+46 -2
View File
@@ -227,6 +227,7 @@
"src/ui/panelMeasurement.js",
"src/ui/panelRailGeometry.js",
"src/ui/panelRails.test.mjs",
"src/ui/hudSonarStyle.test.mjs",
"src/panelStackLayout.js",
"src/ui/applicationShortcuts.js",
"src/ui/styleParameters.js",
@@ -296,6 +297,9 @@
"src/ui/contextControls.js",
"src/ui/contextControls.test.mjs",
"src/ui/contextLayerChanges.js",
"src/ui/spaceMissionsControls.js",
"src/ui/spaceMissionsControls.test.mjs",
"src/ui/stores/spaceMissions.js",
"src/ui/contextPresentation.js",
"src/ui/contextSession.js",
"src/ui/contextSubscriptions.js",
@@ -437,6 +441,12 @@
"src/layers/earthquakes/model.js",
"src/layers/earthquakes/source.js",
"src/layers/earthquakes/ownership.test.mjs",
"src/layers/earthquakes/selection.test.mjs",
"src/layers/submarineCables/interaction.test.mjs",
"src/ui/entityContextBridge.test.mjs",
"src/layers/launches/clickYield.test.mjs",
"src/app/layers/earthquakeRipples.js",
"src/app/layers/earthquakeRipples.test.mjs",
"src/layers/perimeters/index.js",
"src/layers/perimeters/records.js",
"src/layers/perimeters/source.js",
@@ -520,6 +530,10 @@
"src/layers/launches/source.test.mjs",
"src/layers/launches/ingestion.test.mjs",
"src/layers/launches/failedEntry.test.mjs",
"src/layers/launches/labelClick.test.mjs",
"src/layers/launches/missionCycler.test.mjs",
"src/layers/launches/satelliteIntents.js",
"src/layers/launches/satelliteIntents.test.mjs",
"src/layers/installations/lifecycle.js",
"src/layers/installations/viewport.js",
"src/layers/installations/controls.js",
@@ -652,6 +666,7 @@
"src/layers/alpr/model.js",
"src/layers/alpr/policy.js",
"src/layers/alpr/presentation.js",
"src/layers/alpr/presentation.test.mjs",
"src/layers/alpr/visuals.js",
"src/layers/alpr/overlay.js",
"src/layers/alpr/overlay.test.mjs",
@@ -1313,6 +1328,20 @@
"src/ui/kit/UiBadge.vue",
"src/ui/kit/UiBadge.test.mjs",
"src/ui/kit/UiEmpty.vue",
"src/ui/kit/kitStyles.test.mjs",
"src/ui/kit/UiCloseButton.vue",
"src/ui/kit/UiCloseButton.test.mjs",
"src/ui/kit/closeButtons.test.mjs",
"src/ui/styles/close-button.css",
"src/ui/kit/UiSearchField.vue",
"src/ui/kit/UiSearchField.test.mjs",
"src/ui/styles/search-field.css",
"src/ui/kit/UiCheckbox.vue",
"src/ui/kit/UiCheckbox.test.mjs",
"src/ui/kit/checkboxes.test.mjs",
"src/ui/styles/checkbox.css",
"src/ui/styles/chip.css",
"src/ui/styles/empty-state.css",
"src/ui/rail/RailChips.vue",
"src/ui/displayPanelActions.test.mjs",
"src/testSupport/vueDom.mjs",
@@ -1476,7 +1505,7 @@
"src/overlays/worldOverlayDraw.test.mjs",
"src/sources/rateLimit.js",
"src/ui/layerNames.js",
"src/ui/styles/cyber.css",
"src/ui/styles/sonar.css",
"src/voice/layerManifest.js",
"src/worldFocus.js",
"src/worldFocus.test.mjs",
@@ -1550,6 +1579,8 @@
"dev/stub-app/main.js",
"scripts/qa-stub-boot.mjs",
"src/ui/creditsView.js",
"src/ui/creditLineHeight.js",
"src/ui/creditLineHeight.test.mjs",
"src/ui/creditsView.test.mjs",
"src/cockpitSubjectProviders.js",
"src/cockpitSubjectProviders.test.mjs",
@@ -1583,5 +1614,18 @@
"src/ui/layerFinder.test.mjs",
"src/data/wikidataCities.js",
"src/data/wikidataCities.test.mjs",
"scripts/build-wikidata-cities.mjs"
"scripts/build-wikidata-cities.mjs",
"src/search/bip39Words.js",
"src/search/placeSuggestions.test.mjs",
"scripts/wikidataPlaceTiles.mjs",
"src/tooling/wikidataPlaceTiles.test.mjs",
"src/ui/omnibarIntent.test.mjs",
"src/ui/omnibarRows.test.mjs",
"src/ui/styles/omnibar-dock.css",
"src/ui/styles/guide.css",
"src/ui/commandDock.test.mjs",
"src/layers/firms/selection.test.mjs",
"src/layers/vessels/selection.test.mjs",
"src/layers/bikeshare/selection.test.mjs",
"src/layers/satellites/interaction.test.mjs"
]
+72 -8
View File
@@ -130,6 +130,7 @@
"src/ui/radioTunerModel.js",
"src/ui/views/panels/MissionDetail.vue",
"src/ui/views/panels/MissionRoster.vue",
"src/ui/views/panels/SpaceMissionsPanel.vue",
"src/ui/views/panels/AwarenessPanel.vue",
"src/ui/views/panels/AwarenessNames.vue",
"src/ui/views/DisplayControlsView.vue",
@@ -163,6 +164,7 @@
"src/ui/stores/cctv.js",
"src/ui/stores/radio.js",
"src/ui/stores/context.js",
"src/ui/stores/spaceMissions.js",
"src/ui/stores/cockpit.js",
"src/ui/stores/locale.js",
"src/ui/stores/providerSettings.js",
@@ -239,6 +241,9 @@
"src/ui/kit/UiSelect.js",
"src/ui/kit/UiEmpty.vue",
"src/ui/kit/UiBadge.vue",
"src/ui/kit/UiCloseButton.vue",
"src/ui/kit/UiSearchField.vue",
"src/ui/kit/UiCheckbox.vue",
"src/ui/stores/globeActions.js",
"src/ui/views/panels/GlobeActions.vue",
"src/ui/views/panels/RenderFailure.vue",
@@ -287,7 +292,26 @@
"src/data/vesselTypes.js",
"src/data/fleetModels.js",
"src/render/modelParts.js",
"src/ui/views/panels/AircraftModelHero.vue"
"src/ui/views/panels/AircraftModelHero.vue",
"src/data/retryableLoad.js",
"src/data/local_data/wikidata_places/files.js",
"src/ui/views/panels/Omnibar.vue",
"src/exclusiveSurfaces.js",
"src/geoDistance.js",
"src/ui/omnibarGuide.js",
"src/cityPois.js",
"src/search/photonSetting.js",
"src/sources/requestDeadline.js",
"src/ui/omnibarEnter.js",
"src/ui/omnibarIntent.js",
"src/data/placeNames.js",
"src/search/plusCode.js",
"src/keylessGeocoder.js",
"src/ui/omnibarRows.js",
"src/search/gridReference.js",
"src/search/coordinateParser.js",
"src/search/placeSuggestions.js",
"src/search/bip39Words.js"
],
"external": ["vue", "pinia", "vue-i18n"]
},
@@ -818,7 +842,6 @@
"exports": ["./ui/layout"],
"modules": [
"src/ui/panelRails.js",
"src/ui/displayPanelScroll.js",
"src/ui/leftPanelRail.js",
"src/ui/rightPanelRail.js",
"src/ui/panelMeasurement.js",
@@ -994,6 +1017,8 @@
"src/ui/kit/UiSelect.js",
"src/ui/kit/UiButton.vue",
"src/ui/kit/UiBadge.vue",
"src/ui/kit/UiCloseButton.vue",
"src/ui/kit/UiIcon.vue",
"src/ui/rail/fieldValue.js",
"src/ui/kit/UiSlider.js",
"src/ui/kit/UiSegmented.vue"
@@ -1193,7 +1218,6 @@
"src/ui/cockpitController.js",
"src/data/followed.js",
"src/ui/cockpitDisplayPortal.js",
"src/ui/displayPanelScroll.js",
"src/ui/cockpitInput.js",
"src/ui/cockpitInstruments.js",
"src/cockpitSubjectProviders.js",
@@ -1416,7 +1440,6 @@
"src/ui/cockpitContext.js",
"src/ui/cockpitController.js",
"src/ui/cockpitDisplayPortal.js",
"src/ui/displayPanelScroll.js",
"src/ui/cockpitInput.js",
"src/ui/cockpitInstruments.js",
"src/cockpitSubjectProviders.js",
@@ -1434,6 +1457,7 @@
"src/ui/contextSession.js",
"src/ui/contextSubscriptions.js",
"src/ui/contextTransactions.js",
"src/ui/spaceMissionsControls.js",
"src/ui/displayControls.js",
"src/ui/effects.js",
"src/ui/frameRateMonitor.js",
@@ -1562,6 +1586,7 @@
"src/ui/stores/cctv.js",
"src/ui/stores/radio.js",
"src/ui/stores/context.js",
"src/ui/stores/spaceMissions.js",
"src/ui/stores/cockpit.js",
"src/ui/stores/locale.js",
"src/ui/stores/providerSettings.js",
@@ -1582,6 +1607,7 @@
"src/ui/kit/UiSlider.js",
"src/ui/kit/UiButton.vue",
"src/ui/kit/UiBadge.vue",
"src/ui/kit/UiCloseButton.vue",
"src/ui/stores/globeActions.js",
"src/ui/stores/recording.js",
"src/ui/i18n.js",
@@ -1655,7 +1681,8 @@
"src/ui/entityContextBridge.js",
"src/data/trackingClickGesture.js",
"src/ui/stores/sceneSharing.js",
"src/maps/attribution.js"
"src/maps/attribution.js",
"src/data/dataCredits.js"
],
"external": [
"cesium",
@@ -1888,6 +1915,7 @@
"src/data/vesselTypes.js",
"src/data/fleetTrailAnchors.js",
"src/data/fleetModelInstances.js",
"src/data/fleetModelDraw.js",
"src/data/modelPartDrivers.js",
"src/data/headingDegrees.js",
"src/i18n/marker.js",
@@ -2039,6 +2067,7 @@
"src/data/vesselTypes.js",
"src/data/fleetTrailAnchors.js",
"src/data/fleetModelInstances.js",
"src/data/fleetModelDraw.js",
"src/data/modelPartDrivers.js",
"src/data/headingDegrees.js",
"src/i18n/marker.js",
@@ -2222,6 +2251,7 @@
"src/data/aircraftClass.js",
"src/i18n/marker.js",
"src/data/fleetModelInstances.js",
"src/data/fleetModelDraw.js",
"src/data/modelPartDrivers.js",
"src/data/aircraftModelLighting.js",
"src/data/modelEligibility.js",
@@ -2567,7 +2597,8 @@
"src/layers/earthquakes/model.js",
"src/layers/earthquakes/source.js",
"src/layers/earthquakes/records.js",
"src/time/worldClock.js"
"src/time/worldClock.js",
"src/data/trackingClickGesture.js"
],
"external": ["cesium"]
},
@@ -2856,6 +2887,7 @@
"src/data/entityRecords.js",
"src/render/cesium/follow.js",
"src/layers/launches/ingestion.js",
"src/layers/launches/satelliteIntents.js",
"src/layers/launches/launchPad.js",
"src/layers/launches/lifecycle.js",
"src/layers/launches/model.js",
@@ -4118,6 +4150,7 @@
"src/render/modelParts.js",
"src/data/fleetTrailAnchors.js",
"src/data/fleetModelInstances.js",
"src/data/fleetModelDraw.js",
"src/app/layers/fleetModels.js",
"src/sources/adsbFields.js",
"src/data/headingDegrees.js",
@@ -4164,6 +4197,7 @@
"src/app/layers/bikeshare.js",
"src/app/layers/cctv.js",
"src/app/layers/cyclones.js",
"src/app/layers/earthquakeRipples.js",
"src/app/layers/earthquakes.js",
"src/app/layers/firms.js",
"src/app/layers/flights.js",
@@ -4514,6 +4548,7 @@
"src/layers/launches/controls.js",
"src/layers/launches/index.js",
"src/layers/launches/ingestion.js",
"src/layers/launches/satelliteIntents.js",
"src/layers/launches/launchPad.js",
"src/layers/launches/lifecycle.js",
"src/layers/launches/model.js",
@@ -4727,7 +4762,6 @@
"src/ui/cockpitContext.js",
"src/ui/cockpitController.js",
"src/ui/cockpitDisplayPortal.js",
"src/ui/displayPanelScroll.js",
"src/ui/cockpitInput.js",
"src/ui/cockpitInstruments.js",
"src/cockpitSubjectProviders.js",
@@ -4746,6 +4780,7 @@
"src/ui/contextSession.js",
"src/ui/contextSubscriptions.js",
"src/ui/contextTransactions.js",
"src/ui/spaceMissionsControls.js",
"src/ui/displayControls.js",
"src/ui/effects.js",
"src/ui/frameRateMonitor.js",
@@ -5308,6 +5343,7 @@
"src/ui/stores/cctv.js",
"src/ui/stores/radio.js",
"src/ui/stores/context.js",
"src/ui/stores/spaceMissions.js",
"src/ui/stores/cockpit.js",
"src/ui/stores/locale.js",
"src/ui/stores/providerSettings.js",
@@ -5340,6 +5376,7 @@
"src/ui/kit/UiButton.vue",
"src/ui/kit/UiEmpty.vue",
"src/ui/kit/UiBadge.vue",
"src/ui/kit/UiCloseButton.vue",
"src/ui/stores/globeActions.js",
"src/ui/stores/recording.js",
"src/ui/i18n.js",
@@ -5448,6 +5485,7 @@
"src/render/applicationHooks.js",
"src/maps/globeEngine.js",
"src/render/cesium/viewers.js",
"src/ui/creditLineHeight.js",
"src/ui/creditsView.js",
"src/data/planespottersPhoto.js",
"src/maps/keylessTerrain.js",
@@ -5519,6 +5557,7 @@
"src/data/fleetModels.js",
"src/data/fleetTrailAnchors.js",
"src/data/fleetModelInstances.js",
"src/data/fleetModelDraw.js",
"src/app/layers/fleetModels.js",
"src/data/feedState.js",
"src/loadingFeedback.js",
@@ -5576,6 +5615,7 @@
"src/app/layers/bikeshare.js",
"src/app/layers/cctv.js",
"src/app/layers/cyclones.js",
"src/app/layers/earthquakeRipples.js",
"src/app/layers/earthquakes.js",
"src/app/layers/firms.js",
"src/app/layers/flights.js",
@@ -5795,6 +5835,7 @@
"src/layers/launches/controls.js",
"src/layers/launches/index.js",
"src/layers/launches/ingestion.js",
"src/layers/launches/satelliteIntents.js",
"src/layers/launches/launchPad.js",
"src/layers/launches/lifecycle.js",
"src/layers/launches/model.js",
@@ -6674,7 +6715,6 @@
"ui-panel-chrome": {
"exports": ["./ui/panel-chrome"],
"modules": [
"src/ui/displayPanelScroll.js",
"src/ui/radioPanelPlacement.js",
"src/panelStackLayout.js",
"src/ui/leftPanelRail.js",
@@ -7260,6 +7300,7 @@
"src/data/aircraftClass.js",
"src/i18n/marker.js",
"src/data/fleetModelInstances.js",
"src/data/fleetModelDraw.js",
"src/data/modelPartDrivers.js",
"src/data/modelEligibility.js",
"src/data/fleetTrailAnchors.js",
@@ -7413,6 +7454,7 @@
"src/render/modelParts.js",
"src/data/vesselTypes.js",
"src/data/fleetModelInstances.js",
"src/data/fleetModelDraw.js",
"src/data/modelPartDrivers.js",
"src/data/aircraftClass.js",
"src/data/aircraftModelLighting.js",
@@ -8190,6 +8232,28 @@
],
"external": []
},
"fleet": {
"exports": ["./fleet"],
"modules": [
"src/fleet/index.js",
"src/data/fleetModels.js",
"src/data/aircraftClass.js",
"src/i18n/marker.js",
"src/render/modelParts.js",
"src/data/fleetTrailAnchors.js",
"src/data/vesselTypes.js",
"src/layers/flights/modelSpec.js",
"src/layers/flights/policy.js",
"src/data/aircraftEmergency.js",
"src/render/color.js",
"src/data/aircraftModelLighting.js",
"src/data/modelPartDrivers.js",
"src/data/modelEligibility.js",
"src/data/fleetModelDraw.js",
"src/data/vesselSprites.js"
],
"external": []
},
"sky": {
"exports": ["./sky"],
"modules": [
+108 -382
View File
@@ -193,41 +193,74 @@ try {
});
const contactMissionHandoff = await page.evaluate(async () => {
const { styleManager, dataManager } = window.__godsEyeView;
// Launch Library is not contacted: the layer's own work is stubbed so the
// check covers only how Space Missions sits beside Context.
const stubMissions = (rocketEntry) => {
const original = {
initialized: rocketEntry.initialized,
lifecycleState: rocketEntry.lifecycleState,
init: rocketEntry.module.init,
enable: rocketEntry.module.enable,
update: rocketEntry.module.update,
disable: rocketEntry.module.disable,
};
rocketEntry.initialized = true;
rocketEntry.module.init = async () => true;
rocketEntry.module.enable = async () => true;
rocketEntry.module.update = async () => true;
rocketEntry.module.disable = async () => true;
return () => {
rocketEntry.initialized = original.initialized;
rocketEntry.lifecycleState = original.lifecycleState;
rocketEntry.module.init = original.init;
rocketEntry.module.enable = original.enable;
rocketEntry.module.update = original.update;
rocketEntry.module.disable = original.disable;
};
};
const originalShowToast = styleManager._showToast;
const toasts = [];
styleManager._showToast = (message) => { toasts.push(String(message)); };
const restoreMissions = stubMissions(dataManager.layers.get('rocket-launches'));
try {
if (styleManager._contextControls._contextMode) await styleManager._contextControls._selectContextMode(null);
const contactsResult = await styleManager._contextControls._selectContextMode('flights');
const missionResult = await styleManager._contextControls._selectContextMode('space-missions');
const switched = {
const missionResult = await dataManager.setEnabled('rocket-launches', true, { origin: 'user' });
await styleManager._waitForContextLayerSettlement();
const together = {
contactsResult,
missionResult,
mode: styleManager._contextControls._contextMode,
missionsEnabled: dataManager.isEnabled('rocket-launches'),
toasts: [...toasts],
};
const missionOff = await dataManager.setEnabled('rocket-launches', false, { origin: 'user' });
await styleManager._waitForContextLayerSettlement();
const modeAfterMissions = styleManager._contextControls._contextMode;
const exitResult = await styleManager._contextControls._selectContextMode(null);
return {
...switched,
...together,
missionOff,
modeAfterMissions,
exitResult,
modeAfterExit: styleManager._contextControls._contextMode,
missionsOffAfterExit: !dataManager.isEffectivelyEnabled('rocket-launches'),
};
} finally {
restoreMissions();
styleManager._showToast = originalShowToast;
}
});
check(
'Contacts hands off to Space Missions on the first request without a failure toast',
'Space Missions runs beside Contacts, and switching it off leaves Contacts on',
contactMissionHandoff.contactsResult === true
&& contactMissionHandoff.missionResult === true
&& contactMissionHandoff.mode === 'space-missions'
&& contactMissionHandoff.mode === 'flights'
&& contactMissionHandoff.missionsEnabled
&& contactMissionHandoff.toasts?.length === 0
&& contactMissionHandoff.missionOff === true
&& contactMissionHandoff.modeAfterMissions === 'flights'
&& contactMissionHandoff.exitResult === true
&& contactMissionHandoff.modeAfterExit === null
&& contactMissionHandoff.missionsOffAfterExit,
&& contactMissionHandoff.modeAfterExit === null,
JSON.stringify(contactMissionHandoff),
);
const cancelledMissionEntry = await page.evaluate(async () => {
@@ -330,7 +363,7 @@ try {
}
});
check(
'cancelled direct Space Missions entry restores its exact isolated sibling state',
'a cancelled Space Missions start leaves its sibling layer on and opens no Context session',
cancelledMissionEntry.exercised
&& cancelledMissionEntry.transitionResult === false
&& !cancelledMissionEntry.timedOut
@@ -341,214 +374,45 @@ try {
JSON.stringify(cancelledMissionEntry),
);
check(
'successful Space Missions cancellation rollback stays silent',
'a cancelled Space Missions start stays silent',
cancelledMissionEntry.exercised && cancelledMissionEntry.toasts?.length === 0,
JSON.stringify(cancelledMissionEntry.toasts || []),
);
const replacementMissionEntry = await page.evaluate(async () => {
const styleManager = window.__godsEyeView.styleManager;
const dataManager = window.__godsEyeView.dataManager;
const rocketEntry = dataManager.layers.get('rocket-launches');
if (!rocketEntry || dataManager.isEffectivelyEnabled('rocket-launches')) {
return { exercised: false, reason: 'Space Missions was not in a clean OFF state' };
}
const siblingId = 'qa-cockpit-replacement-sibling';
window.__gevQaRegisterLayer(dataManager, {
id: siblingId,
name: 'QA replacement sibling',
icon: 'science',
source: 'QA',
updateInterval: -1,
async init() { return true; },
async enable() { return true; },
async update() { return true; },
async disable() { return true; },
async destroy() {},
getStats() { return { count: 1, status: 'live' }; },
});
await dataManager.setEnabled(siblingId, true, { origin: 'programmatic' });
const original = {
siblingInitialized: dataManager.layers.get(siblingId)?.initialized,
initialized: rocketEntry.initialized,
lifecycleState: rocketEntry.lifecycleState,
init: rocketEntry.module.init,
enable: rocketEntry.module.enable,
update: rocketEntry.module.update,
disable: rocketEntry.module.disable,
showToast: styleManager._showToast,
};
let firstUpdate = true;
let releaseUpdate;
let markUpdateStarted;
const updateStarted = new Promise((resolve) => { markUpdateStarted = resolve; });
const updateGate = new Promise((resolve) => { releaseUpdate = resolve; });
const toasts = [];
rocketEntry.initialized = true;
rocketEntry.module.enable = async () => true;
rocketEntry.module.update = async () => {
if (!firstUpdate) return true;
firstUpdate = false;
markUpdateStarted();
await updateGate;
return true;
};
rocketEntry.module.disable = async () => true;
styleManager._showToast = (message) => { toasts.push(String(message)); };
try {
const entry = styleManager._contextControls._selectContextMode('space-missions');
await updateStarted;
const replacement = dataManager.setEnabled('rocket-launches', true, { origin: 'programmatic' });
releaseUpdate();
const [entryResult, replacementResult] = await Promise.all([entry, replacement]);
const committed = {
entryResult,
replacementResult,
mode: styleManager._contextControls._contextMode,
entering: styleManager._contextControls._contextModeEntering,
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
siblingIsolated: !dataManager.isEffectivelyEnabled(siblingId),
missionEnabled: dataManager.isEnabled('rocket-launches'),
missionEffective: dataManager.isEffectivelyEnabled('rocket-launches'),
toasts: [...toasts],
};
const exitResult = await styleManager._contextControls._selectContextMode(null);
return {
exercised: true,
...committed,
exitResult,
siblingRestored: dataManager.isEnabled(siblingId),
missionRestoredOff: !dataManager.isEffectivelyEnabled('rocket-launches'),
};
} finally {
styleManager._showToast = original.showToast;
rocketEntry.module.init = original.init;
rocketEntry.module.enable = original.enable;
rocketEntry.module.update = original.update;
rocketEntry.module.disable = original.disable;
rocketEntry.initialized = original.initialized;
rocketEntry.lifecycleState = original.lifecycleState;
await dataManager.setEnabled(siblingId, false, { origin: 'programmatic' });
await window.__gevQaUnregisterLayer(dataManager, siblingId);
}
});
check(
'right-rail Space Missions adopts a newer authoritative ON without stale restoration',
replacementMissionEntry.exercised
&& replacementMissionEntry.entryResult === true
&& replacementMissionEntry.replacementResult === true
&& replacementMissionEntry.mode === 'space-missions'
&& replacementMissionEntry.entering === null
&& replacementMissionEntry.snapshotRetained
&& replacementMissionEntry.siblingIsolated
&& replacementMissionEntry.missionEnabled
&& replacementMissionEntry.missionEffective
&& replacementMissionEntry.toasts?.length === 0
&& replacementMissionEntry.exitResult === true
&& replacementMissionEntry.siblingRestored
&& replacementMissionEntry.missionRestoredOff,
JSON.stringify(replacementMissionEntry),
);
const supersededMissionEntry = await page.evaluate(async () => {
const styleManager = window.__godsEyeView.styleManager;
const dataManager = window.__godsEyeView.dataManager;
const rocketEntry = dataManager.layers.get('rocket-launches');
if (!rocketEntry || dataManager.isEffectivelyEnabled('rocket-launches')) {
return { exercised: false, reason: 'Space Missions was not in a clean OFF state' };
}
const siblingId = 'qa-cockpit-superseded-sibling';
window.__gevQaRegisterLayer(dataManager, {
id: siblingId,
name: 'QA superseded sibling',
icon: 'science',
source: 'QA',
updateInterval: -1,
async init() { return true; },
async enable() { return true; },
async update() { return true; },
async disable() { return true; },
async destroy() {},
getStats() { return { count: 1, status: 'live' }; },
});
await dataManager.setEnabled(siblingId, true, { origin: 'programmatic' });
const original = {
initialized: rocketEntry.initialized,
lifecycleState: rocketEntry.lifecycleState,
init: rocketEntry.module.init,
enable: rocketEntry.module.enable,
update: rocketEntry.module.update,
disable: rocketEntry.module.disable,
showToast: styleManager._showToast,
};
let releaseUpdate;
let markUpdateStarted;
const updateStarted = new Promise((resolve) => { markUpdateStarted = resolve; });
const updateGate = new Promise((resolve) => { releaseUpdate = resolve; });
const toasts = [];
rocketEntry.initialized = true;
rocketEntry.module.enable = async () => true;
rocketEntry.module.update = async () => {
markUpdateStarted();
await updateGate;
return true;
};
rocketEntry.module.disable = async () => true;
styleManager._showToast = (message) => { toasts.push(String(message)); };
try {
const entry = styleManager._runUserFacingContextAction(
(notificationToken) => styleManager._contextControls._selectContextMode(
'space-missions',
{ notificationToken },
),
'Space Missions could not complete the requested transition; try again',
);
await updateStarted;
const supersedingOff = dataManager.setEnabled('rocket-launches', false, {
origin: 'programmatic',
});
releaseUpdate();
const [entryResult, offResult] = await Promise.all([entry, supersedingOff]);
return {
exercised: true,
entryResult,
offResult,
mode: styleManager._contextControls._contextMode,
entering: styleManager._contextControls._contextModeEntering,
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
siblingRestored: dataManager.isEnabled(siblingId),
missionEffective: dataManager.isEffectivelyEnabled('rocket-launches'),
toasts,
};
} finally {
styleManager._showToast = original.showToast;
rocketEntry.module.init = original.init;
rocketEntry.module.enable = original.enable;
rocketEntry.module.update = original.update;
rocketEntry.module.disable = original.disable;
rocketEntry.initialized = original.initialized;
rocketEntry.lifecycleState = original.lifecycleState;
await dataManager.setEnabled(siblingId, false, { origin: 'programmatic' });
await window.__gevQaUnregisterLayer(dataManager, siblingId);
}
});
check(
'right-rail Space Missions superseded by OFF restores exactly without a failure toast',
supersededMissionEntry.exercised
&& supersededMissionEntry.entryResult === null
&& supersededMissionEntry.mode === null
&& supersededMissionEntry.entering === null
&& !supersededMissionEntry.snapshotRetained
&& supersededMissionEntry.siblingRestored
&& !supersededMissionEntry.missionEffective
&& supersededMissionEntry.toasts?.length === 0,
JSON.stringify(supersededMissionEntry),
);
const voiceMissionEntry = await page.evaluate(async () => {
const ordinaryMissionLayer = await page.evaluate(async () => {
const { dataManager, styleManager } = window.__godsEyeView;
const siblingId = '__qa_voice_context_sibling__';
const rocketEntry = dataManager.layers.get('rocket-launches');
if (!rocketEntry || dataManager.isEffectivelyEnabled('rocket-launches')) {
return { exercised: false, reason: 'Space Missions was not in a clean OFF state' };
}
// Launch Library is not contacted: the layer's own work is stubbed so the
// check covers only how Space Missions sits beside Context.
const stubMissions = (rocketEntry) => {
const original = {
initialized: rocketEntry.initialized,
lifecycleState: rocketEntry.lifecycleState,
init: rocketEntry.module.init,
enable: rocketEntry.module.enable,
update: rocketEntry.module.update,
disable: rocketEntry.module.disable,
};
rocketEntry.initialized = true;
rocketEntry.module.init = async () => true;
rocketEntry.module.enable = async () => true;
rocketEntry.module.update = async () => true;
rocketEntry.module.disable = async () => true;
return () => {
rocketEntry.initialized = original.initialized;
rocketEntry.lifecycleState = original.lifecycleState;
rocketEntry.module.init = original.init;
rocketEntry.module.enable = original.enable;
rocketEntry.module.update = original.update;
rocketEntry.module.disable = original.disable;
};
};
const siblingId = '__qa_space_missions_sibling__';
window.__gevQaRegisterLayer(dataManager, {
id: siblingId,
name: 'QA voice Context sibling',
name: 'QA Space Missions sibling',
icon: 'science',
source: 'QA',
updateInterval: -1,
@@ -559,94 +423,48 @@ try {
async destroy() {},
getStats() { return { count: 1, status: 'live' }; },
});
const original = {
initialized: rocketEntry.initialized,
lifecycleState: rocketEntry.lifecycleState,
init: rocketEntry.module.init,
enable: rocketEntry.module.enable,
update: rocketEntry.module.update,
disable: rocketEntry.module.disable,
};
const siblingLayerEntry = dataManager.layers.get(siblingId);
siblingLayerEntry.initialized = true;
await dataManager.setEnabled(siblingId, true, { origin: 'programmatic' });
rocketEntry.initialized = true;
rocketEntry.module.init = async () => true;
rocketEntry.module.enable = async () => true;
rocketEntry.module.update = async () => true;
rocketEntry.module.disable = async () => true;
const restoreMissions = stubMissions(rocketEntry);
try {
const voiceOn = await dataManager.setEnabled('rocket-launches', true, { origin: 'voice' });
await new Promise((resolve) => setTimeout(resolve, 80));
const voiceState = {
voiceOn,
mode: styleManager._contextControls._contextMode,
entering: styleManager._contextControls._contextModeEntering,
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
siblingIsolated: !dataManager.isEffectivelyEnabled(siblingId),
};
const snapshotBeforeOff = [...(styleManager._contextControls._contextSessionSnapshot?.enabledLayerIds || [])];
const voiceOff = await dataManager.setEnabled('rocket-launches', false, { origin: 'voice' });
const reactionCountAfterOff = styleManager._contextControls._contextLayerReactionPromises.size;
await styleManager._waitForContextLayerSettlement();
const restoredSiblingEntry = dataManager.layers.get(siblingId);
const voiceExit = {
voiceOff,
snapshotBeforeOff,
reactionCountAfterOff,
mode: styleManager._contextControls._contextMode,
entering: styleManager._contextControls._contextModeEntering,
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
siblingRestored: dataManager.isEffectivelyEnabled(siblingId),
siblingEnabled: restoredSiblingEntry?.enabled,
siblingLifecycle: restoredSiblingEntry?.lifecycleState,
restoreActive: Boolean(styleManager._contextControls._contextRestoreState),
};
await dataManager.setEnabled('rocket-launches', true, { origin: 'programmatic' });
await new Promise((resolve) => setTimeout(resolve, 40));
const internalState = {
mode: styleManager._contextControls._contextMode,
entering: styleManager._contextControls._contextModeEntering,
snapshotRetained: Boolean(styleManager._contextControls._contextSessionSnapshot),
missionEnabled: dataManager.isEffectivelyEnabled('rocket-launches'),
};
await dataManager.setEnabled('rocket-launches', false, { origin: 'programmatic' });
return { exercised: true, voiceState, voiceExit, internalState };
const results = {};
for (const origin of ['user', 'voice', 'programmatic']) {
const on = await dataManager.setEnabled('rocket-launches', true, { origin });
await styleManager._waitForContextLayerSettlement();
const during = {
on,
mode: styleManager._contextControls._contextMode,
snapshot: Boolean(styleManager._contextControls._contextSessionSnapshot),
siblingOn: dataManager.isEffectivelyEnabled(siblingId),
};
const off = await dataManager.setEnabled('rocket-launches', false, { origin });
await styleManager._waitForContextLayerSettlement();
results[origin] = {
...during,
off,
siblingOnAfter: dataManager.isEffectivelyEnabled(siblingId),
snapshotAfter: Boolean(styleManager._contextControls._contextSessionSnapshot),
};
}
return { exercised: true, results };
} finally {
rocketEntry.module.init = original.init;
rocketEntry.module.enable = original.enable;
rocketEntry.module.update = original.update;
rocketEntry.module.disable = original.disable;
rocketEntry.initialized = original.initialized;
rocketEntry.lifecycleState = original.lifecycleState;
restoreMissions();
await dataManager.setEnabled(siblingId, false, { origin: 'programmatic' });
siblingLayerEntry.initialized = original.siblingInitialized;
await window.__gevQaUnregisterLayer(dataManager, siblingId);
}
});
check(
'voice Space Missions uses the same Context snapshot and exact-restore transaction as UI entry',
voiceMissionEntry.exercised
&& voiceMissionEntry.voiceState?.voiceOn
&& voiceMissionEntry.voiceState.mode === 'space-missions'
&& voiceMissionEntry.voiceState.entering === null
&& voiceMissionEntry.voiceState.snapshotRetained
&& voiceMissionEntry.voiceState.siblingIsolated
&& voiceMissionEntry.voiceExit?.voiceOff
&& voiceMissionEntry.voiceExit.mode === null
&& voiceMissionEntry.voiceExit.entering === null
&& !voiceMissionEntry.voiceExit.snapshotRetained
&& voiceMissionEntry.voiceExit.siblingRestored,
JSON.stringify(voiceMissionEntry),
);
check(
'internal programmatic Space Missions activation does not create a user Context session',
voiceMissionEntry.internalState?.missionEnabled
&& voiceMissionEntry.internalState.mode === null
&& voiceMissionEntry.internalState.entering === null
&& !voiceMissionEntry.internalState.snapshotRetained,
JSON.stringify(voiceMissionEntry),
'Space Missions is an ordinary layer: no Context session, no isolation, from any origin',
ordinaryMissionLayer.exercised
&& Object.values(ordinaryMissionLayer.results || {}).length === 3
&& Object.values(ordinaryMissionLayer.results).every((entry) =>
entry.on === true
&& entry.mode === null
&& !entry.snapshot
&& entry.siblingOn
&& entry.off === true
&& entry.siblingOnAfter
&& !entry.snapshotAfter),
JSON.stringify(ordinaryMissionLayer),
);
await page.evaluate(() => window.__godsEyeView.dataManager.setEnabled(
'flights',
@@ -1998,98 +1816,6 @@ try {
}),
);
// Cyber relocates its collapsed briefing header into the expanded utility
// lane. Exercise actual height changes without reload and measure both cards.
await page.evaluate(() => {
const manager = window.__godsEyeView.styleManager;
manager._setHudVariant('cyber');
manager.hud.setMode('on');
manager._setCockpitDisclosure('display', false);
manager._setCockpitDisclosure('radio', true);
});
const cyberRadioOrder = await page.evaluate(() => {
const manager = window.__godsEyeView.styleManager;
manager.cockpitView.syncSignalLayout();
const display = document
.getElementById('cockpit-display-toggle-btn')
.closest('.cockpit-utility-control');
const radio = document
.getElementById('cockpit-radio-toggle-btn')
.closest('.cockpit-utility-control');
const displayRect = display.getBoundingClientRect();
const radioRect = radio.getBoundingClientRect();
return {
display: displayRect.toJSON(),
radio: radioRect.toJSON(),
displayExpanded: display.classList.contains('is-expanded'),
radioExpanded: radio.classList.contains('is-expanded'),
gap: radioRect.top - displayRect.bottom,
};
});
check(
'Cyber expanding Radio preserves the authored Display-then-Radio order',
!cyberRadioOrder.displayExpanded
&& cyberRadioOrder.radioExpanded
&& cyberRadioOrder.display.height > 0
&& cyberRadioOrder.radio.height > 0
&& cyberRadioOrder.gap >= 7,
JSON.stringify(cyberRadioOrder),
);
await page.screenshot({ path: path.join(shotsDir, 'cyber-radio-order.png') });
await page.evaluate(() => {
const manager = window.__godsEyeView.styleManager;
manager._setCockpitDisclosure('radio', false);
manager._setCockpitDisclosure('display', true);
});
const cyberStyleStates = await page.evaluate(() => {
const manager = window.__godsEyeView.styleManager;
const states = [];
for (const style of ['normal', 'surveillance', 'thermal', 'retro']) {
document.querySelector(`.style-btn[data-style="${style}"]`).click();
states.push({
requestedStyle: style,
activeStyle: manager.activeStyle,
hud: manager.hud.getVariant(),
theme: document.documentElement.dataset.uiTheme,
selector: document.getElementById('hud-layout-select').value,
savedHud: manager.getVisualState().hud.variant,
});
}
return states;
});
check('Cockpit visual-style controls retain Cyber HUD, selector, shell and saved layout',
cyberStyleStates.every(state => state.activeStyle === state.requestedStyle
&& state.hud === 'cyber' && state.theme === 'cyber'
&& state.selector === 'cyber' && state.savedHud === 'cyber'),
JSON.stringify(cyberStyleStates));
for (const height of [987, 720, 640, 900]) {
await page.setViewport({ width: 1440, height, deviceScaleFactor: 1 });
await new Promise((resolve) => setTimeout(resolve, 400));
const geometry = await page.evaluate(() => {
const signal = document.getElementById('cockpit-signal-stream');
const utility = document.getElementById('cockpit-utility-controls');
const expanded = utility.querySelector('.cockpit-utility-control.is-expanded');
const s = signal.getBoundingClientRect();
const u = expanded.getBoundingClientRect();
const toggle = document.getElementById('cockpit-signal-toggle');
const t = toggle.getBoundingClientRect();
const hit = document.elementFromPoint(t.x + t.width / 2, t.y + t.height / 2);
return { height: innerHeight, theme: document.documentElement.dataset.uiTheme,
collapsed: signal.dataset.collapsed, signal: s.toJSON(), utility: u.toJSON(),
reachable: Boolean(hit && toggle.contains(hit)),
contained: u.bottom <= s.top - 7 && s.bottom < innerHeight,
};
});
check(`Cyber collapsed Live Signals remains visible and reachable after resize to ${height}px`,
geometry.theme === 'cyber' && geometry.collapsed === 'true'
&& geometry.signal.width > 0 && geometry.signal.height > 0
&& geometry.reachable && geometry.contained, JSON.stringify(geometry));
if (height === 640 || height === 900) {
await page.screenshot({ path: path.join(shotsDir, `cyber-resize-${height}.png`) });
}
}
await page.evaluate(() => window.__godsEyeView.styleManager._setHudVariant('tactical'));
const signalTransition = await page.evaluate(async () => {
const manager = window.__godsEyeView.styleManager;
const cockpit = manager.cockpitView;
+25 -26
View File
@@ -276,21 +276,21 @@ const MUTATIONS = [
},
{
defect: 'the tile stops promising the fires it actually turns on',
file: 'html',
file: 'module',
from: " 'Live earthquakes and active fires, from USGS and NASA',",
to: " 'Live earthquakes worldwide, straight from USGS',",
},
{
defect: 'the owner-authored first-run line is quietly rewritten',
defect: 'the maintainer-authored first-run line is quietly rewritten',
file: 'html',
from: 'It feels like a forbidden cockpit—then you realize the sources are public and the data is real.',
to: "It feels like a forbidden cockpit. It isn't — every feed is public, and every contact is live.",
to: 'A live 3D globe of public data. Pick a view to begin.',
},
{
defect: 'the ledgered global-chip defect loses its pointer to the real fix',
file: 'module',
from: ' // means a KEY REQUIRED terminal state in src/loadingFeedback.js, a state',
to: ' // (note removed)',
from: ' // ends KEY REQUIRED (src/loadingFeedback.js), and the quakes half of the',
to: ' // ends KEY REQUIRED, and the quakes half of the',
},
{
defect: 'the globe missions never pull the camera out',
@@ -307,14 +307,14 @@ const MUTATIONS = [
{
defect: 'a cancelled globe flight fails the whole mission',
file: 'module',
from: ' .catch(() => null);',
to: ' .catch(() => { throw new Error("flight failed"); });',
from: ' .catch(() => null)\n : null;',
to: ' .catch(() => { throw new Error("flight failed"); })\n : null;',
},
{
defect: 'Explore manually quietly runs a mission instead of nothing',
file: 'module',
from: "if (mission.kind === 'none') return { ok: true, choice };",
to: "if (mission.kind === 'none') return { ok: true, choice, ran: await setContextMode('contacts') };",
to: "if (mission.kind === 'none') return { ok: true, choice, ran: await setLayerEnabled('rocket-launches') };",
},
{
defect: 'an unknown choice is treated as a success',
@@ -348,15 +348,14 @@ const MUTATIONS = [
{
defect: 'a mission persists a 3D-models choice nobody made',
file: 'module',
from: ' const result = await styleManager.setContextMode(mode);',
to: ' styleManager._setModels3dEnabled?.(true);\n const result = await styleManager.setContextMode(mode);',
from: " setLayerEnabled: (layerId) =>\n dataManager.setEnabled(layerId, true, { origin: 'user' }),",
to: " setLayerEnabled: (layerId) => {\n styleManager._setModels3dEnabled?.(true);\n return dataManager.setEnabled(layerId, true, { origin: 'user' });\n },",
},
{
defect:
'the Context panel is left collapsed, hiding the mode that just started',
defect: 'a mission writes panel chrome nobody chose',
file: 'module',
from: " styleManager.setPanelCollapsed?.('global-context-panel', false, {\n explicit: true,\n });",
to: ' // panel reveal removed',
from: ' flyToGlobe: () => styleManager.resetToGlobeView(),',
to: " flyToGlobe: () => {\n styleManager.setPanelCollapsed?.('global-context-panel', false, { explicit: true });\n return styleManager.resetToGlobeView();\n },",
},
{
defect:
@@ -371,8 +370,8 @@ const MUTATIONS = [
defect:
'disabling the focused tile drops the keyboard to <body> mid-flight',
file: 'html',
from: ':aria-disabled="launcher?.busy ?? undefined" @click="controls?.choose(\'contacts\')"',
to: ':disabled="launcher?.busy === \'true\'" @click="controls?.choose(\'contacts\')"',
from: ':aria-disabled="String(settling || launcher?.busy === \'true\')" @click="onPrimary"',
to: ':disabled="launcher?.busy === \'true\'" @click="onPrimary"',
},
{
defect: 'Tab escapes into an app the visitor has not seen yet',
@@ -421,8 +420,8 @@ const MUTATIONS = [
defect:
'the card loses its viewport cap and clips on a short landscape phone',
file: 'css',
from: ' max-height: calc(100dvh - 1.5rem);',
to: ' /* cap removed */',
from: ' body.mobile-shell #first-run-launcher {\n bottom: 5.8rem;\n max-height: calc(100vh - 6.55rem);\n max-height: calc(100dvh - 6.55rem);\n }',
to: ' body.mobile-shell #first-run-launcher {\n bottom: 5.8rem;\n /* cap removed */\n }',
},
{
defect:
@@ -437,7 +436,7 @@ const MUTATIONS = [
// those instead and prove nothing about this feature.
defect: "the launcher's reduced-motion opt-out is dropped",
file: 'css',
from: ' #first-run-launcher,\n .first-run-choices button,\n .first-run-arrow {\n transition: none;\n }\n /* Scrolling a tile into view must not animate either. */\n .first-run-choices {\n scroll-behavior: auto;\n }',
from: ' #first-run-launcher,\n .first-run-backdrop,\n .first-run-back,\n .first-run-missions button,\n .first-run-link-card,\n .first-run-link-button,\n .first-run-enter {\n transition: none;\n }\n /* Scrolling a tile into view must not animate either. */\n .first-run-choices {\n scroll-behavior: auto;\n }',
to: ' .first-run-nothing {\n transition: none;\n }',
},
@@ -445,20 +444,20 @@ const MUTATIONS = [
{
defect: 'a mission tile is dropped from the menu',
file: 'html',
from: ' <button type="button" data-first-run-choice="space-missions"',
to: ' <button type="button" data-first-run-choice-disabled="space-missions"',
from: ' <button type="button" data-first-run-start="space-missions"',
to: ' <button type="button" data-first-run-start-disabled="space-missions"',
},
{
defect: "the menu order stops matching the owner's",
file: 'html',
from: '<button type="button" data-first-run-choice="environmental"',
to: '<button type="button" data-first-run-choice="zzz-environmental"',
from: '<button type="button" data-first-run-start="environmental"',
to: '<button type="button" data-first-run-start="zzz-environmental"',
},
{
defect: 'the "don\'t show again" checkbox is removed',
defect: 'the "don\'t show again" checkbox loses its hook',
file: 'html',
from: '<input type="checkbox" data-first-run-suppress @change="onSuppress" />',
to: '<span data-first-run-suppress-removed></span>',
from: '<UiCheckbox class="first-run-suppress" :input-attrs="suppressBoxAttrs" @change="onSuppress">',
to: '<UiCheckbox class="first-run-suppress" @change="onSuppress">',
},
{
defect: 'the status line stops being a polite live region',
+108 -42
View File
@@ -33,7 +33,7 @@ const TEETH = args.includes('--teeth');
const HEADFUL = args.includes('--headful');
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
const SHOT_DIR = path.join(ROOT, 'qa-shots', 'firstrun');
const SHOT_DIR = process.env.QA_OUTPUT_DIR || path.join(ROOT, 'qa-shots', 'firstrun');
const CHROME_CANDIDATES = [
process.env.PUPPETEER_EXECUTABLE_PATH,
@@ -109,7 +109,7 @@ const appState = (page) => page.evaluate(() => {
const gev = window.__godsEyeView || {};
const sm = gev.styleManager;
const dm = gev.dataManager;
const carto = sm?.viewer?.camera?.positionCartographic;
const carto = gev.viewer?.camera?.positionCartographic;
const layers = {};
const counts = {};
const all = dm?.getAll?.() || [];
@@ -170,8 +170,22 @@ async function watchLoadingChip(page) {
const readLoadingChip = (page) => page.evaluate(() => window.__chipSeen || []);
async function nextStep(page, readySelector) {
await page.click('[data-first-run-next]');
await page.waitForSelector(readySelector, { visible: true });
await page.waitForFunction(() => {
const steps = [...document.querySelectorAll('#first-run-launcher .first-run-step')];
return steps.length === 1
&& !/first-run-step-(forward|back)-(enter|leave)-/.test(steps[0].className)
&& document.querySelector('[data-first-run-primary]')?.getAttribute('aria-disabled') !== 'true';
});
}
async function pick(page, choice, { timeout = 40000, settle = [] } = {}) {
await page.click(`[data-first-run-choice="${choice}"]`);
await nextStep(page, '[data-first-run-start]');
await page.click(`[data-first-run-start="${choice}"]`);
await nextStep(page, '[data-first-run-choice]');
await page.click('[data-first-run-choice]');
await page.waitForFunction(
(sel) => !document.querySelector(sel) || !document.querySelector(sel).classList.contains('visible'),
{ timeout },
@@ -190,8 +204,8 @@ async function pick(page, choice, { timeout = 40000, settle = [] } = {}) {
/** Every section the run is expected to reach; the teeth verdict requires all. */
const EXPECTED_SECTIONS = [
'show-policy', 'esc-arbitration',
'mission-environmental', 'mission-contacts', 'mission-space', 'mission-explore',
'viewports', 'console',
'mission-environmental', 'mission-space', 'mission-explore',
'stories-card', 'viewports', 'console',
];
/*
@@ -482,8 +496,8 @@ async function main() {
record('a fresh session gets the launcher', freshVisible);
if (freshVisible) shots.push(await shoot(page, 'launcher-desktop'));
const focused = await page.evaluate(() => document.activeElement?.dataset?.firstRunChoice ?? null);
record('focus lands on the first mission tile', focused === 'contacts', `activeElement=${focused}`);
const focused = await page.evaluate(() => document.activeElement?.hasAttribute('data-first-run-next') ?? false);
record('focus lands on Next', focused === true, `activeElement=${focused}`);
// The card is a flex column (so its list can scroll on short viewports),
// and an author `display` on this id outranks the UA's `[hidden]` rule.
@@ -500,10 +514,11 @@ async function main() {
record('the hidden attribute still hides the flex card', hiddenHonored === 'none',
`computed display while hidden = ${hiddenHonored}`);
const tiles = await page.$$eval('[data-first-run-choice]', (nodes) => nodes.map((n) => n.dataset.firstRunChoice));
await nextStep(page, '[data-first-run-start]');
const tiles = await page.$$eval('[data-first-run-start]', (nodes) => nodes.map((n) => n.dataset.firstRunStart));
record(
'four tiles in the owner\'s order',
JSON.stringify(tiles) === JSON.stringify(['contacts', 'space-missions', 'environmental', 'explore']),
'three tiles in the owner\'s order',
JSON.stringify(tiles) === JSON.stringify(['space-missions', 'environmental', 'explore']),
tiles.join(' · '),
);
@@ -558,7 +573,7 @@ async function main() {
// ── Mission outcomes ────────────────────────────────────────────────────
// One section PER MISSION: a throw in one (a tile that never rendered under
// --teeth, say) must not take the other four down with it, or the teeth
// --teeth, say) must not take the other two down with it, or the teeth
// tally reports "reached" for assertions that never ran.
let state;
let before;
@@ -642,47 +657,93 @@ async function main() {
shots.push(await shoot(page, 'mission-environmental'));
});
await section('mission-contacts', async () => {
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
await pick(page, 'contacts');
state = await appState(page);
record('LIVE CONTACTS activates the Contacts context mode', state.contextMode === 'flights',
`contextMode=${state.contextMode}`);
const panelOpen = await page.evaluate(() => {
const panel = document.getElementById('global-context-panel');
return !!panel && !panel.classList.contains('collapsed');
});
record('LIVE CONTACTS reveals the Context panel', panelOpen);
record('LIVE CONTACTS still leaves the detection override untouched',
state.detectionOverridden === false, `_detectionUserOverridden=${state.detectionOverridden}`);
shots.push(await shoot(page, 'mission-contacts'));
});
await section('mission-space', async () => {
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
await pick(page, 'space-missions');
state = await appState(page);
record('SPACE MISSIONS activates its context mode', state.contextMode === 'space-missions',
`contextMode=${state.contextMode}`);
const missions = await page.evaluate(() => {
const panel = document.getElementById('space-missions-panel');
return {
layerOn: window.__godsEyeView.dataManager.isEffectivelyEnabled('rocket-launches'),
panelOpen: !!panel && !panel.hidden && !panel.classList.contains('collapsed'),
};
});
record('SPACE MISSIONS switches its layer on without a Context mode',
missions.layerOn && state.contextMode == null,
`layerOn=${missions.layerOn} contextMode=${state.contextMode}`);
record('SPACE MISSIONS opens its own panel', missions.panelOpen,
`panelOpen=${missions.panelOpen}`);
record('SPACE MISSIONS still leaves the detection override untouched',
state.detectionOverridden === false, `_detectionUserOverridden=${state.detectionOverridden}`);
shots.push(await shoot(page, 'mission-space-missions'));
});
await section('mission-explore', async () => {
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
// Start below the mission overview so an accidental overview flight is observable.
await page.evaluate(() => {
const camera = window.__godsEyeView.viewer.camera;
camera.cancelFlight();
camera.setView({ destination: camera.position.constructor.fromDegrees(-97.7431, 30.2672, 100000) });
});
const beforeExplore = await appState(page);
await pick(page, 'explore');
state = await appState(page);
record('EXPLORE MANUALLY enables no layer and no context mode',
Object.values(state.layers).every((on) => !on) && state.contextMode === null,
Object.entries(state.layers).filter(([, on]) => on).map(([id]) => id).join(', ') || 'nothing enabled');
// The real claim is that Explore issues no camera command of its own: the
// arrival fly-in owns the camera and must still be heading down, not out.
record('EXPLORE MANUALLY never commandeers the camera',
(state.heightKm ?? 0) < 12000 && (state.heightKm ?? 1e9) <= (beforeExplore.heightKm ?? 1e9),
`${beforeExplore.heightKm} → ${state.heightKm} km (globe would be 18000)`);
beforeExplore.heightKm === 100 && state.heightKm === beforeExplore.heightKm,
`${beforeExplore.heightKm} → ${state.heightKm} km (expected 100 → 100 km)`);
shots.push(await shoot(page, 'mission-explore'));
});
await section('stories-card', async () => {
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
const backdrop = await page.evaluate(() => {
const el = document.querySelector('.first-run-backdrop');
if (!el) return null;
const style = getComputedStyle(el);
return {
filter: style.backdropFilter || style.webkitBackdropFilter || 'none',
background: style.backgroundColor,
pointerEvents: style.pointerEvents,
};
});
record('the welcome backdrop tints the globe without blurring it',
!!backdrop && backdrop.filter === 'none' && backdrop.background !== 'rgba(0, 0, 0, 0)'
&& backdrop.pointerEvents === 'none',
JSON.stringify(backdrop));
await nextStep(page, '[data-first-run-start]');
await nextStep(page, '[data-first-run-choice]');
const button = await page.evaluate(() => {
const el = document.querySelector('#first-run-launcher [data-first-run-stories]');
return el ? { tag: el.tagName, href: el.getAttribute('href'), target: el.getAttribute('target') } : null;
});
record('the GEV Stories card offers an in-app BROWSE STORIES button',
button?.tag === 'BUTTON' && button.href === null && button.target === null,
JSON.stringify(button));
const pagesBefore = (await browser.pages()).length;
await page.click('#first-run-launcher [data-first-run-stories]');
const opened = await page.waitForFunction(
() => document.body.classList.contains('stories-mode')
&& !!document.querySelector('#gev-stories .app'),
{ timeout: 30000 },
).then(() => true, () => false);
const after = await page.evaluate((sel) => ({
launcherVisible: !!document.querySelector(sel)?.classList.contains('visible'),
session: sessionStorage.getItem('gev:first-run-mission-session:v1'),
query: location.search,
}), LAUNCHER);
record('BROWSE STORIES opens Stories Explore in this tab',
opened && (await browser.pages()).length === pagesBefore,
`stories-mode=${opened}, query=${after.query}`);
record('BROWSE STORIES closes the welcome card for the session',
!after.launcherVisible && after.session !== null,
`visible=${after.launcherVisible}, session=${after.session}`);
shots.push(await shoot(page, 'stories-card-explore'));
});
// ── Viewports ───────────────────────────────────────────────────────────
await section('viewports', async () => {
// Portrait phone, LANDSCAPE phone (the short viewport that clipped the card
@@ -695,6 +756,8 @@ async function main() {
for (const vp of VIEWPORTS) {
await page.setViewport({ width: vp.width, height: vp.height, deviceScaleFactor: vp.dpr });
await open(page, { query: "?welcome=1", errorSink: consoleErrors });
for (let step = 1; step <= 3; step++) {
if (step > 1) await nextStep(page, step === 2 ? '[data-first-run-start]' : '[data-first-run-choice]');
const box = await page.evaluate((sel) => {
const node = document.querySelector(sel);
if (!node) return null;
@@ -715,22 +778,23 @@ async function main() {
const fits = !!box && box.top >= 0 && box.bottom <= box.vh
&& box.left >= 0 && box.right <= box.vw;
record(
`the launcher fits a ${vp.label} with no clipping`,
`step ${step} fits a ${vp.label} with no clipping`,
fits,
box ? `${box.left},${box.top} → ${box.right},${box.bottom} in ${box.vw}x${box.vh}${box.listScrolls ? ' (list scrolls)' : ''}` : 'absent',
);
record(`"Don't show this again" stays on screen at ${vp.width}x${vp.height}`,
record(`step ${step} checkbox stays on screen at ${vp.width}x${vp.height}`,
!!box?.checkboxOnScreen);
// Discoverability: if the list scrolls, the LAST tile must still peek
// above the fold. A fold that lands exactly between tiles looks like a
// complete list of four, and the fifth mission is simply never found.
// complete list, and the last mission is simply never found.
if (step === 2) {
const peek = await page.evaluate((sel) => {
const node = document.querySelector(sel);
const list = node?.querySelector('.first-run-choices');
if (!list) return null;
list.scrollTop = 0;
const tiles = [...list.querySelectorAll('[data-first-run-choice]')];
const tiles = [...list.querySelectorAll('[data-first-run-start]')];
const last = tiles[tiles.length - 1];
if (!last) return null;
const listBox = list.getBoundingClientRect();
@@ -739,7 +803,7 @@ async function main() {
return {
scrolls: list.scrollHeight > list.clientHeight + 1,
fraction: lastBox.height ? visible / lastBox.height : 0,
label: last.dataset.firstRunChoice,
label: last.dataset.firstRunStart,
};
}, LAUNCHER);
record(
@@ -755,7 +819,7 @@ async function main() {
const reach = await page.evaluate(async (sel) => {
const node = document.querySelector(sel);
if (!node) return null;
const targets = [...node.querySelectorAll('[data-first-run-choice], [data-first-run-suppress]')];
const targets = [...node.querySelectorAll('[data-first-run-start], [data-first-run-suppress]')];
const offscreen = [];
for (const target of targets) {
target.focus();
@@ -764,7 +828,7 @@ async function main() {
const host = node.getBoundingClientRect();
if (document.activeElement !== target
|| rect.bottom <= host.top || rect.top >= host.bottom) {
offscreen.push(target.dataset.firstRunChoice || 'suppress-checkbox');
offscreen.push(target.dataset.firstRunStart || 'suppress-checkbox');
}
}
return { count: targets.length, offscreen };
@@ -773,7 +837,7 @@ async function main() {
// A hardcoded count silently turns into a failure the day the menu
// changes, which is exactly what it did when a tile was removed.
const expectedFocusable = await page.$$eval(
'[data-first-run-choice]', (nodes) => nodes.length,
'[data-first-run-start]', (nodes) => nodes.length,
) + 1;
record(
`every tile and the checkbox are keyboard-reachable at ${vp.width}x${vp.height}`,
@@ -782,6 +846,7 @@ async function main() {
? `${reach.count}/${expectedFocusable} focusable${reach.offscreen.length ? `, unreachable: ${reach.offscreen.join(', ')}` : ''}`
: 'absent',
);
}
// The reachability probe above tabs to the last tile and scrolls the list
// with it. Put it back to the top so the taste-pass shot shows what a
// visitor actually opens on.
@@ -791,7 +856,8 @@ async function main() {
document.activeElement?.blur?.();
}, LAUNCHER);
await sleep(250);
shots.push(await shoot(page, `launcher-${vp.name}`));
shots.push(await shoot(page, `launcher-${vp.name}-step-${step}`));
}
}
await page.setViewport({ width: 1440, height: 900, deviceScaleFactor: 1 });
});
+1 -1
View File
@@ -111,7 +111,7 @@ await page.waitForFunction(() => window.__godsEyeView?.viewer && window.__godsEy
{ timeout: 150000 });
await sleep(12000); // let the boot fly-to settle before pinning
await page.evaluate(() => {
document.querySelector('#first-run-launcher:not([hidden]) [data-first-run-choice="explore"]')?.click();
document.querySelector('#first-run-launcher:not([hidden]) [data-first-run-dismiss]')?.click();
});
await sleep(600); // let the launcher dismissal finish before taking evidence
-10
View File
@@ -314,17 +314,7 @@ try {
}
await page.evaluate(() => {
document.documentElement.lang = 'en';
document.documentElement.dataset.uiTheme = 'cyber';
});
const cyber = await page.$eval(
'#scene-select',
(node) => getComputedStyle(node).backgroundColor,
);
check(
'Cyber keeps its native field theme',
cyber === 'rgba(26, 35, 39, 0.96)',
cyber,
);
await begin('heading');
await page.evaluate(() => {
const owner = window.__godsEyeView.styleManager._cctvControls;
+9 -11
View File
@@ -845,7 +845,7 @@ async function main() {
params: {},
};
let failureUsed = false;
const entryLayerId = mode === 'flights' ? 'military-awareness' : 'rocket-launches';
const entryLayerId = 'military-awareness';
dataManager.setEnabled = async (layerId, shouldEnable) => {
const failsIsolation = phase === 'isolation' && layerId === 'local-datacenters' && !shouldEnable;
const failsActivation = phase === 'activation' && layerId === entryLayerId && shouldEnable;
@@ -872,7 +872,6 @@ async function main() {
priorLayerRestored: enabled.has('local-datacenters'),
entryEnabled: enabled.has(entryLayerId),
flightsButtonDisabled: document.getElementById('global-context-flights-btn').disabled,
missionsButtonDisabled: document.getElementById('global-context-missions-btn').disabled,
message: document.getElementById('toast').textContent,
};
};
@@ -893,7 +892,7 @@ async function main() {
}
};
const contextFailures = [];
for (const mode of ['flights', 'space-missions']) {
for (const mode of ['flights']) {
for (const phase of ['isolation', 'activation']) {
for (const outcome of ['false', 'reject']) {
contextFailures.push(await runContextFailure(mode, phase, outcome));
@@ -902,7 +901,7 @@ async function main() {
}
const directEntryFailures = [];
for (const layerId of ['military-awareness', 'rocket-launches']) {
for (const layerId of ['military-awareness']) {
for (const outcome of ['false', 'reject']) {
enabled.clear();
enabled.add('local-datacenters');
@@ -971,7 +970,7 @@ async function main() {
styleManager._showToast = originalShowToast;
const directActivationFailures = [];
for (const layerId of ['military-awareness', 'rocket-launches']) {
for (const layerId of ['military-awareness']) {
enabled.clear();
styleManager._contextControls._contextMode = null;
styleManager._contextControls._contextSessionSnapshot = {
@@ -1001,7 +1000,7 @@ async function main() {
}
const directActivationRollbackFailures = [];
for (const layerId of ['military-awareness', 'rocket-launches']) {
for (const layerId of ['military-awareness']) {
enabled.clear();
styleManager._contextControls._contextMode = null;
styleManager._contextControls._contextSessionSnapshot = {
@@ -1211,7 +1210,7 @@ async function main() {
check(
'user-facing chip, real Context entry rollback, and installation Search failures settle safely',
userFacingFailures.semanticFalseMessage === 'Radio could not stop cleanly'
&& userFacingFailures.contextFailures.length === 8
&& userFacingFailures.contextFailures.length === 4
&& userFacingFailures.contextFailures.every((failure) => (
failure.result === false
&& failure.visibleMode === null
@@ -1219,10 +1218,9 @@ async function main() {
&& failure.priorLayerRestored
&& !failure.entryEnabled
&& !failure.flightsButtonDisabled
&& !failure.missionsButtonDisabled
&& failure.message.includes('QA transition failed')
))
&& userFacingFailures.directEntryFailures.length === 4
&& userFacingFailures.directEntryFailures.length === 2
&& userFacingFailures.directEntryFailures.every((failure) => (
failure.reason.includes('could not start')
&& failure.retryReason === null
@@ -1233,14 +1231,14 @@ async function main() {
&& failure.priorLayerRestored
&& !failure.modeChanging
))
&& userFacingFailures.directActivationFailures.length === 2
&& userFacingFailures.directActivationFailures.length === 1
&& userFacingFailures.directActivationFailures.every((failure) => (
failure.mode === null
&& failure.snapshotCleared
&& failure.priorLayerRestored
&& failure.failedLayerDisabled
))
&& userFacingFailures.directActivationRollbackFailures.length === 2
&& userFacingFailures.directActivationRollbackFailures.length === 1
&& userFacingFailures.directActivationRollbackFailures.every((failure) => (
failure.toastMessages.length === 1
&& failure.toastMessages[0] === `${failure.layerId} could not start cleanly`
+1 -1
View File
@@ -345,7 +345,7 @@ try {
(await readScope()).feather === 2,
);
await page.click('#scope-toggle');
for (const layout of ['minimal', 'cyber', 'tactical']) {
for (const layout of ['minimal', 'tactical']) {
await page.select('#hud-layout-select', layout);
const state = await readScope();
check(
-29
View File
@@ -276,35 +276,6 @@ try {
.every((group) => group.scrollWidth <= group.clientWidth + 1),
),
);
const cyber = await page.evaluate(() => {
const root = document.documentElement;
const previous = root.getAttribute('data-ui-theme');
root.setAttribute('data-ui-theme', 'cyber');
const selected = [
...document.querySelectorAll('.gev-segment[aria-checked="true"]'),
];
// Check the final theme colors, independent of software-GL frame cadence.
for (const button of selected)
for (const animation of button.getAnimations()) animation.finish();
const backgrounds = selected.map(
(button) => getComputedStyle(button).backgroundColor,
);
const radii = [...document.querySelectorAll('.gev-segmented')].map(
(group) => getComputedStyle(group).borderRadius,
);
const consistent =
selected.length === 6 &&
backgrounds.every((color) => color === backgrounds[0]) &&
radii.every((radius) => radius === '1px');
if (previous === null) root.removeAttribute('data-ui-theme');
else root.setAttribute('data-ui-theme', previous);
return { consistent, count: selected.length, backgrounds, radii };
});
check(
'Cyber theme styles every selected segment consistently',
cyber.consistent,
JSON.stringify(cyber),
);
await page.evaluate(async () => {
const { dataManager, styleManager } = window.__godsEyeView;
await dataManager.setEnabled('recent-imagery', true);
+1 -1
View File
@@ -194,7 +194,7 @@ try {
result,
);
}
for (const theme of ['tactical', 'cyber']) {
for (const theme of ['tactical', 'minimal']) {
await page.evaluate(
(theme) => window.__godsEyeView.styleManager._setHudVariant(theme),
theme,
-3
View File
@@ -231,9 +231,6 @@ async function boot(page, url) {
await page.waitForFunction(() => Boolean(window.__godsEyeView?.dataManager), {
timeout: 150_000,
});
await page.evaluate(() =>
document.querySelector('.first-run-explore')?.click(),
);
await page.keyboard.press('Escape');
await page.evaluate(() => {
for (const el of document.querySelectorAll(
+17 -17
View File
@@ -1980,16 +1980,19 @@ try {
await wait(12_000);
check('leaving Contacts restores Transit', await isOn());
// SPACE MISSIONS
await page.evaluate(() =>
window.__godsEyeView.dataManager.setEnabled('transit', false, {
origin: 'user',
}),
);
await wait(2_000);
await page.click('#global-context-missions-btn');
// SPACE MISSIONS: an ordinary layer. It neither refuses nor puts away
// Transit, so a Transit switched on while it runs stays on after it ends.
const setMissions = (enabled) =>
page.evaluate(
(on) =>
window.__godsEyeView.dataManager.setEnabled('rocket-launches', on, {
origin: 'user',
}),
enabled,
);
await setMissions(true);
await wait(20_000);
const blocked = await page.evaluate(async () => {
const beside = await page.evaluate(async () => {
const settled = await window.__godsEyeView.dataManager.setEnabled(
'transit',
true,
@@ -2001,16 +2004,13 @@ try {
};
});
check(
'Space Missions refuses to enable Transit while it isolates replay data',
blocked.enabled === false,
JSON.stringify(blocked),
'Transit can be switched on while Space Missions runs',
beside.settled !== false && beside.enabled === true,
JSON.stringify(beside),
);
await page.click('#global-context-missions-btn');
await setMissions(false);
await wait(12_000);
check(
'leaving Space Missions leaves Transit off, as it was on entry',
(await isOn()) === false,
);
check('switching Space Missions off leaves Transit on', await isOn());
check(
'no uncaught page errors',
+57 -31
View File
@@ -1637,19 +1637,48 @@ async function main() {
// The fixture planes repeat one position, so the icon holds and draws no
// head. Fly the tracked one east for this check; the display runs 30 s
// behind, so give it time to reach the moving reports.
await evalPage((icao) => {
await evalPage(async (icao) => {
const { rendererOf } = await import(`${window.__gevQaSourceBase || '/src'}/render/rendererOf.js`);
const app = window.__godsEyeView;
const fl = app.dataManager.layers.get('flights').module;
// Observe this selection's actual draw-port submissions: trails no
// longer live in viewer.entities. Disabling destroys the reused trail
// set, so this selection creates one the probe can identify.
await app.dataManager.setEnabled('flights', false);
const draw = rendererOf(app.viewer).draw;
const createLines = draw.lines;
let head = null;
let trail = null;
draw.lines = function (spec) {
const set = createLines.call(this, spec);
if (!spec.id.startsWith('trail:')) return set;
draw.lines = createLines;
trail = set;
const upsert = set.upsert;
set.upsert = function (items) {
const result = upsert.call(this, items);
for (const item of items)
if (/^gev-trail:\d+:head$/.test(item.id)) head = item;
return result;
};
const clear = set.clear;
set.clear = function () { head = null; return clear.call(this); };
const dispose = set.dispose;
set.dispose = function () { head = null; trail = null; return dispose.call(this); };
return set;
};
window.__qaTrailHead = () => trail?.show && head?.show !== false ? head?.positions : null;
window.__qaRestoreTrailProbe = () => { draw.lines = createLines; };
await app.dataManager.setEnabled('flights', true);
if (!fl.trackById(icao)) throw new Error('trail fixture could not reselect its aircraft');
const f = window.__SYNTH.flights.find((p) => p.icao === icao);
f.moveFromMs = Date.now();
}, trackedIcao);
await sleep(55_000);
const headSamples = await sampleFrames(page, 40, (icao) => {
const viewer = window.__godsEyeView.viewer;
const fl = window.__godsEyeView.dataManager.layers.get('flights').module;
const ent = viewer.trackedEntity;
const time = viewer.clock.currentTime;
const head = viewer.entities.values.find((e) => String(e.id).startsWith('gev-trail:fl-head-'));
const line = head?.polyline?.positions?.getValue(time);
const drawn = ent?.position?.getValue(time);
const line = window.__qaTrailHead();
const drawn = window.__qaFollowed()?.position?.();
if (!line?.length || !drawn) return null;
const end = line[line.length - 1];
const dist = (a, b) => Math.hypot(a.x - b.x, a.y - b.y, a.z - b.z);
@@ -1695,10 +1724,8 @@ async function main() {
for (let i = 0; i < 8; i++) {
await sleep(600);
betweenFrames.push(await evalPage((icao) => {
const viewer = window.__godsEyeView.viewer;
const head = viewer.entities.values.find((e) => String(e.id).startsWith('gev-trail:fl-head-'));
const line = head?.polyline?.positions?.getValue(viewer.clock.currentTime);
const drawn = viewer.trackedEntity?.position?.getValue(viewer.clock.currentTime);
const line = window.__qaTrailHead();
const drawn = window.__qaFollowed()?.position?.();
if (!line?.length || !drawn) return null;
const end = line[line.length - 1];
return Math.hypot(end.x - drawn.x, end.y - drawn.y, end.z - drawn.z);
@@ -1712,10 +1739,11 @@ async function main() {
f.lon += (f.vel * (Date.now() - f.moveFromMs)) / 1000
/ (111320 * Math.cos((f.lat * Math.PI) / 180));
delete f.moveFromMs;
window.__qaRestoreTrailProbe();
}, trackedIcao);
const headUsable = headSamples.values.filter((v) => v != null);
if (headUsable.length < 10) {
skip('trail head: ends at the drawn icon on every frame',
record('trail head: ends at the drawn icon on every frame', false,
`only ${headUsable.length} frames with a drawn head (timedOut=${headSamples.timedOut})`);
} else {
const worst = Math.max(...headUsable.map((v) => v.end));
@@ -3681,6 +3709,9 @@ async function main() {
} while (Date.now() < fleetClampDeadline
&& (!Number.isFinite(fleetH) || fleetH < seeded + 1));
if (!fl.trackById('aaa097')) return { error: 'trackById(aaa097) failed' };
// The tracked contact obeys the same 3D toggle as the fleet. Arm it
// before testing the cold-ground gate and the warm model handoff.
fl.setParams({ models3d: true });
await window.__dfSettle(1500);
// Read the tracked entity's rendered height plus the floor under it and
// the sensor value the data APIs report, at whatever regime the camera
@@ -3770,6 +3801,7 @@ async function main() {
};
const trackedEntity = window.__qaFollowed();
const trackedModel = findOwnModel();
if (!trackedModel) return { error: 'tracked model absent before exit' };
const achievedOut = await window.__dfZoomAbove(window.__dfRegime.exit + 5000);
const zoomedOut = await window.__dfObserveTrackedExit({
scene: v.scene, trackedEntity, trackedModel, getTrackedModel: findOwnModel,
@@ -3908,10 +3940,8 @@ async function main() {
// the tracked billboard becomes the visual again. Gating the clamp on
// model EXISTENCE put the burial straight back in exactly that state.
//
// This scenario also pins the toggle contract itself. The DISPLAY-rail
// "3D" toggle stays OFF for the whole block on purpose: it governs the
// FLEET's draw-call budget only, and the tracked contact must still take
// its model on zoom without the operator arming anything.
// The tracked contact obeys the shared 3D toggle. Keep it enabled
// while zoom alone hands the visual between model and billboard.
const dfRetained = await evalPage(async () => {
const v = window.__godsEyeView.viewer;
const Cesium = await import('/node_modules/cesium/Build/Cesium/index.js');
@@ -3924,13 +3954,13 @@ async function main() {
// and there would otherwise hand an open skin to the seeded scenarios
// that follow; closing an already-closed skin is inert.
try {
// Toggle OFF throughout — the tracked model must not need it.
fl.setParams({ models3d: false });
const toggleOff = fl.getParams().models3d === false;
// Arm the shared toggle so the zoom regime can retain a hidden model.
fl.setParams({ models3d: true });
const toggleOn = fl.getParams().models3d === true;
if (!fl.trackById('aaa097')) return { error: 'trackById(aaa097) failed' };
await window.__dfSettle(600);
// Below the ENTER ceiling (trackById re-frames to the close follow
// range): the tracked model arrives on zoom alone, toggle still off.
// range): the tracked model arrives on zoom alone, 3D enabled.
const belowH = await window.__dfZoomBelow(window.__dfRegime.enter - 20000);
const withModel = await window.__dfAwaitTrackedModel('aaa097', 20000);
// Same split as the regime scenario: a browser with no usable GLB
@@ -3980,7 +4010,7 @@ async function main() {
const ent2 = window.__qaFollowed()?.position?.();
const c2 = ent2 ? window.__dfCarto(ent2) : null;
const out = {
toggleOff,
toggleOn,
enter: window.__dfRegime.enter,
exit: window.__dfRegime.exit,
belowH,
@@ -4015,23 +4045,19 @@ async function main() {
record('display-floor/T7: while the tracked MODEL is the visual, the clamp stands aside',
!dfRetained.error && dfRetained.modelsRenderingBelow > 0,
dfRetained.error
|| `${dfRetained.modelsRenderingBelow} aaa097 model(s) rendering at ${(dfRetained.belowH / 1000).toFixed(0)} km with the 3D toggle OFF; entity at ${Number(dfRetained.withModelH).toFixed(1)} m (ground-snap owns it)`);
|| `${dfRetained.modelsRenderingBelow} aaa097 model(s) rendering at ${(dfRetained.belowH / 1000).toFixed(0)} km with the 3D toggle ON; entity at ${Number(dfRetained.withModelH).toFixed(1)} m (ground-snap owns it)`);
// The toggle contract after auto-3D (2026-08-20): the DISPLAY-rail "3D"
// switch owns the FLEET only. The tracked contact's model is default-on
// and decided purely by camera distance, so with the toggle OFF it is
// SHOWN below the enter ceiling and handed back above the exit ceiling —
// and handed back by HIDING, not destroying, which is the retained state
// the floor pin below depends on.
record('display-floor/regime: the 3D toggle governs the FLEET only — the tracked model follows the zoom',
!dfRetained.error && dfRetained.toggleOff === true
// With 3D enabled, zooming out hides rather than destroys the
// tracked model: the retained state the floor check depends on.
record('display-floor/regime: with 3D enabled the tracked model follows the zoom',
!dfRetained.error && dfRetained.toggleOn === true
&& dfRetained.modelsRenderingBelow > 0
&& dfRetained.belowH < dfRetained.enter
&& dfRetained.shownModelsAbove === 0
&& dfRetained.hiddenModelsAbove > 0
&& dfRetained.aboveH > dfRetained.exit,
dfRetained.error
|| `toggle OFF throughout: at ${(dfRetained.belowH / 1000).toFixed(0)} km (< ${(dfRetained.enter / 1000).toFixed(0)} km enter) ${dfRetained.modelsRenderingBelow} aaa097 model(s) rendering; at ${(dfRetained.aboveH / 1000).toFixed(0)} km (> ${(dfRetained.exit / 1000).toFixed(1)} km exit) ${dfRetained.shownModelsAbove} shown / ${dfRetained.hiddenModelsAbove} retained-hidden`);
|| `toggle ON throughout: at ${(dfRetained.belowH / 1000).toFixed(0)} km (< ${(dfRetained.enter / 1000).toFixed(0)} km enter) ${dfRetained.modelsRenderingBelow} aaa097 model(s) rendering; at ${(dfRetained.aboveH / 1000).toFixed(0)} km (> ${(dfRetained.exit / 1000).toFixed(1)} km exit) ${dfRetained.shownModelsAbove} shown / ${dfRetained.hiddenModelsAbove} retained-hidden`);
record('display-floor: a retained-but-hidden tracked model does NOT suppress the floor',
Number.isFinite(dfRetained.afterSeedH)
+181
View File
@@ -0,0 +1,181 @@
/**
* The files of the Wikidata places detail pack
* (`src/data/local_data/wikidata_places/`), from its rows. Used by
* `scripts/build-wikidata-cities.mjs --tiles`; kept apart from the query so
* the tiling can be checked offline against the shipped pack.
*
* Rows are `[name, lat, lon, population, country, wikidata]`. Each goes into
* the 5 x 5 degree tile named by its south-west corner (`30_-100` covers 30
* to 35 N, 100 to 95 W). Rows keep the order they are given in, largest
* first; tiles without a row get no file.
*/
import { foldName } from '../src/data/wikidataCities.js';
import { greatCircleKm } from '../src/geoDistance.js';
export const TILE_DEGREES = 5;
/** How near two rows of one name in one country are taken as one, in km. */
export const TWIN_KM = 3;
/**
* The rows the cities pack does not already hold. An item with several
* stated populations can fall in both packs (one figure under the cut-off,
* another over it); the cities pack keeps it, so the detail tiles never name
* a place twice.
* @param {Array<Array>} rows Detail rows, `[name, lat, lon, population, country, wikidata]`.
* @param {Iterable<string>} cityIds Wikidata ids in the cities pack.
*/
export function withoutCities(rows, cityIds) {
const cities = new Set(cityIds);
return rows.filter((row) => !cities.has(row[5]));
}
/** The tile a point falls in, named by its south-west corner. */
export function tileKey(lat, lon) {
const corner = (value) => Math.floor(value / TILE_DEGREES) * TILE_DEGREES;
// As the lookups read them: latitude 90 is in the top row of tiles, and
// longitude 180 is longitude -180.
const top = 90 - TILE_DEGREES;
return `${Math.min(top, corner(lat))}_${corner((((lon % 360) + 540) % 360) - 180)}`;
}
/**
* Every file of the pack, by file name.
* @param {Array<Array>} rows Largest first.
* @param {object} meta The build's `source`, `license`, `built`,
* `minPopulation`, `maxPopulation` and `columns`.
* @returns {Map<string, string>}
*/
export function placeTileFiles(rows, meta) {
const tiles = new Map();
for (const row of rows) {
const key = tileKey(row[1], row[2]);
if (!tiles.has(key)) tiles.set(key, []);
tiles.get(key).push(row);
}
// In locale order, as the shipped pack was written.
const keys = [...tiles.keys()].sort((a, b) => a.localeCompare(b, 'en'));
const files = new Map();
for (const key of keys)
files.set(`${key}.json`, `${JSON.stringify({ rows: tiles.get(key) })}\n`);
const index = {
meta: {
source: meta.source,
license: meta.license,
built: meta.built,
minPopulation: meta.minPopulation,
maxPopulation: meta.maxPopulation,
count: rows.length,
columns: meta.columns,
tileDegrees: TILE_DEGREES,
tiles: keys.length,
},
tiles: Object.fromEntries(keys.map((key) => [key, tiles.get(key).length])),
};
files.set('index.json', `${JSON.stringify(index)}\n`);
files.set(
'files.js',
[
'// Generated by scripts/build-wikidata-cities.mjs --tiles; do not edit.',
"export const INDEX_URL = () => new URL('./index.json', import.meta.url);",
'export const TILE_URLS = {',
...keys.map(
(key) => ` '${key}': () => new URL('./${key}.json', import.meta.url),`,
),
'};',
'',
].join('\n'),
);
return files;
}
/**
* A pack file's new text, keeping the earlier build's `meta.built` when
* nothing else in the file changed, so rebuilding unchanged data leaves the
* file as it was. A file that does not hold all of its pack's data (the
* places index) is passed through this only when the rest of the pack is
* unchanged too.
* @param {string} text The new file, JSON with a `meta.built` stamp.
* @param {string | undefined} earlier The file as it is now, if there is one.
*/
export function keepBuiltIfUnchanged(text, earlier) {
if (!earlier) return text;
let before;
try {
before = JSON.parse(earlier);
} catch {
return text;
}
const after = JSON.parse(text);
if (typeof before?.meta?.built !== 'string' || !after.meta) return text;
const unstamped = (value) =>
JSON.stringify({ ...value, meta: { ...value.meta, built: null } });
if (unstamped(before) !== unstamped(after)) return text;
return `${JSON.stringify({ ...after, meta: { ...after.meta, built: before.meta.built } })}\n`;
}
/**
* Keeps the earlier build's `meta.built` in the places pack's index when the
* rebuild changed nothing: every tile and `files.js` the same text, no tile
* of the earlier build left out, and nothing else in the index changed. The
* index holds only row counts, so it alone cannot tell.
* @param {Map<string, string>} files The new pack, as placeTileFiles gives it; its index is replaced in place.
* @param {Map<string, string>} earlier The pack's files on disk now, by name.
*/
export function keepPackBuiltIfUnchanged(files, earlier) {
for (const name of earlier.keys())
if (name !== 'index.json' && !files.has(name)) return files;
for (const [name, text] of files)
if (name !== 'index.json' && earlier.get(name) !== text) return files;
files.set(
'index.json',
keepBuiltIfUnchanged(files.get('index.json'), earlier.get('index.json')),
);
return files;
}
const kmBetween = (a, b) =>
greatCircleKm({ lat: a[1], lon: a[2] }, { lat: b[1], lon: b[2] });
/**
* The rows without a second listing of one place: a row whose name (folded,
* as lookups compare names) and country match a row already kept within
* TWIN_KM is left out, so the larger of the two, given first, stays.
* Namesakes across a border both stay.
* @param {Array<Array>} rows Largest first.
*/
export function withoutNearTwins(rows) {
// Cells of 0.05 degrees (about 5 km of latitude), searched with their
// neighbours. A cell narrows toward the poles, so as many longitude cells
// are searched as TWIN_KM spans there, wrapping at the antimeridian.
const CELLS = 20;
const AROUND = 360 * CELLS;
const kept = new Map();
return rows.filter((row) => {
const name = foldName(row[0]);
const la = Math.floor(row[1] * CELLS);
const lo = Math.floor(row[2] * CELLS);
const cos = Math.cos(
(Math.min(89.9, Math.abs(row[1]) + 0.1) * Math.PI) / 180,
);
const span = Math.min(
AROUND / 2,
Math.ceil((TWIN_KM / (111.32 * cos)) * CELLS) + 1,
);
for (let i = -1; i <= 1; i++)
for (let j = -span; j <= span; j++)
for (const other of kept.get(
`${la + i}_${(((lo + j) % AROUND) + AROUND) % AROUND}`,
) || [])
if (
other.name === name &&
other.row[4] === row[4] &&
kmBetween(other.row, row) <= TWIN_KM
)
return false;
const key = `${la}_${((lo % AROUND) + AROUND) % AROUND}`;
if (!kept.has(key)) kept.set(key, []);
kept.get(key).push({ name, row });
return true;
});
}
+2 -2
View File
@@ -58,8 +58,8 @@ function realtimeDirectives(
'For visual filter requests, call set_visual_style with one of the allowed style IDs.',
'SHIPS vs STYLES: "vessels" is easily heard as "visuals". "Show me vessels", "turn on vessels", "the vessels", "visuals" or "vestibules" said WITHOUT a style name means the ships layer: set_layer_visibility{layerId:"ais-live-vessels"}, exactly as "ships" or "boats" does. Call set_visual_style only when the user names a style (retro/CRT, surveillance/night vision, thermal, anime, noir, normal) or says filter, effect or look. Never turn on a different data layer (such as fires) for a ships request.',
'Disambiguation table — basemap vs layer vs style: basemap switching requires an explicit stack name — "Bing aerial" means set_map_stack bing-aerial, "aerial with labels" means bing-labels, "OSM"/"road map" means osm, "Esri"/"Esri imagery" means esri-imagery, "Google 3D"/"photorealistic" means photoreal. Any other mention of "satellite" or "satellites" means the satellites DATA LAYER via set_layer_visibility, never a basemap — except "recent/latest satellite imagery" (the recent-imagery layer) and "weather satellite"/clouds (weather-satellite). "surveillance"/"night vision"/"thermal" are visual STYLES via set_visual_style.',
'HUD requests ("hud on/off", "switch to minimal/tactical/cyber layout") use set_hud. Detection requests ("detection on", "dense mode", "balanced mode", "sparse mode", "set density to 25", "use weighted allocation") use set_detection. Density snaps to 0/25/50/75/100 and derives Sparse/Balanced/Dense; panoptic is a legacy alias for Dense.',
'Cyber sonar requests use set_cyber_sonar: enabled, rings, rangePct, intensityPct (Power), opacityPct, sectorDeg. For settings questions read get_current_view_state.controls.hud.sonar. Sonar is not detection. Do not silently switch themes, reveal the HUD or enable sonar when changing a slider. If the user explicitly requests Cyber plus sonar settings, call set_hud first, wait for success, then set_cyber_sonar. Confirm returned values; mapSweepActive and contactSweepActive distinguish saved settings from active map effects, including in Cockpit or reduced motion. Do not claim visible contacts solely because enabled is true.',
'HUD requests ("hud on/off", "switch to minimal/tactical layout") use set_hud. Detection requests ("detection on", "dense mode", "balanced mode", "sparse mode", "set density to 25", "use weighted allocation") use set_detection. Density snaps to 0/25/50/75/100 and derives Sparse/Balanced/Dense; panoptic is a legacy alias for Dense.',
'Sonar is a visual style over any HUD layout. Sonar requests (including "cyber mode", which was replaced by sonar) use set_cyber_sonar: enabled, rings, rangePct, intensityPct (Power), opacityPct, sectorDeg. For settings questions read get_current_view_state.controls.hud.sonar. Sonar is not detection. Do not silently switch layouts, reveal the HUD or enable sonar when changing a slider. Confirm returned values; mapSweepActive and contactSweepActive distinguish saved settings from active map effects, including in Cockpit or reduced motion. Do not claim visible contacts solely because enabled is true.',
'Bloom/sharpen requests use set_post_processing. Scene requests ("play orbital watch", "stop the scene", "what scenes are there") use control_scene. CCTV camera requests ("next camera", "nearest camera", "select the Congress camera", "show coverage") use control_cctv — the CCTV layer must be enabled first.',
'Radio playback requests use control_radio. "Turn on/start the radio" means action=play; action=enable only reveals Radio markers and must be reserved for explicit "show/enable the Radio layer/markers" requests. After a prepared playback result, briefly confirm any other completed actions and say "Turning on the radio"—never claim it is already playing. The client keeps Radio muted until playback is verified, then closes voice before restoring Radio volume. Examples: "play news near Austin" → select category=news locationId=austin; "play US news" → select category=news country=US; "Radio volume 30" → volume; pause/resume/stop/next/previous use the matching action. Radio selection never moves the camera.',
'"Track/follow <something specific>" (a callsign, ship name, satellite name) uses track_entity. "Take me to the biggest fire" uses track_entity with query "biggest fire" (the fires layer must be enabled). Bare "orbit" means camera orbit of the current landmark. "Stop following/tracking" uses stop_tracking.',
+1 -1
View File
@@ -225,7 +225,7 @@ export const ACTION_DESCRIPTIONS = {
},
set_cyber_sonar: {
description:
'Adjust Cyber-only sonar controls. Requires the Cyber HUD layout; never switches layout or HUD visibility. Omitted fields stay unchanged. Returns actual settings and separate map/contact sweep activity. A saved setting does not mean the effect is active.',
'Adjust the Sonar visual style, which works over any HUD layout. Never switches layout or HUD visibility. Omitted fields stay unchanged. Returns actual settings and separate map/contact sweep activity. A saved setting does not mean the effect is active.',
$position: 1,
parameters: {
properties: {
+428
View File
@@ -0,0 +1,428 @@
import { registerWorldOverlayPaintLane } from '../../overlays/worldOverlay.js';
import { fromDegrees } from '../../geo/ellipsoid.js';
import {
earthquakeContourRings,
earthquakeContourScale,
earthquakeContourShape,
earthquakeRippleRings,
EARTHQUAKE_RIPPLE_PERIOD_MS,
} from '../../layers/earthquakes/model.js';
/** Points around each contour line: smooth at the largest disc on screen. */
export const RIPPLE_RING_SEGMENTS = 96;
/** An index contour's width, and every other line's. */
const INDEX_WIDTH_PX = 2;
const LINE_WIDTH_PX = 1.1;
/**
* The overlay lane the lines paint in: the magnitude labels' own. A lane's
* custom painters run before its entries, so the lines sit under the labels
* and under the selected quake's card.
*/
export const RIPPLE_PAINT_LANE = 'ambient-label';
/**
* The selected disc's fill, [offset, alpha] from the epicentre (0) to its
* outer circle (1): strongest in the middle, fading out to nothing at the
* edge.
*/
export const DISC_FADE = Object.freeze([
[0, 0.42],
[0.35, 0.26],
[0.75, 0.1],
[1, 0],
]);
/**
* Each contour wave's fill, out to its own line: clear inside, tinting
* toward the line; times the wave's own fade.
*/
export const WAVE_FADE = Object.freeze([
[0, 0],
[0.55, 0],
[1, 0.2],
]);
/**
* `rgb(r,g,b)` (or `rgba`) as a function of alpha, for gradient stops; any
* other colour keeps its own alpha.
*/
export function cssWithAlpha(color) {
const m = /^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)/.exec(String(color));
if (!m) return () => color;
const rgb = `${m[1]},${m[2]},${m[3]}`;
return (alpha) => `rgba(${rgb},${Math.max(0, Math.min(1, alpha))})`;
}
/**
* How many times the lines run out to the edge after a quake is selected
* before they rest as still contours and stop asking for frames: earthquakes
* otherwise hold no render (docs/CURRENT-STATE.md, "Earthquake discs are
* STATIC geometry"), and a quake can stay selected for hours.
*/
export const RIPPLE_ACTIVE_CYCLES = 3;
let reducedMotionQuery;
/**
* The viewer's reduced-motion setting, live: the media query is kept, so a
* change mid-session is read at the next paint and tick.
*/
const reducedMotion = () => {
try {
reducedMotionQuery ??=
globalThis.matchMedia?.('(prefers-reduced-motion: reduce)') ?? null;
return reducedMotionQuery?.matches === true;
} catch {
return false;
}
};
/** How often the rings re-read the ground height under the quake. */
const HEIGHT_READ_INTERVAL_MS = 500;
/**
* A ground height the rings accept, in metres: the Dead Sea shore to above
* Everest. Anything else is a bad sample (a hit on something drawn above
* the ground, or a broken tile), and the rings stay where they are.
*/
const groundHeightOk = (h) => Number.isFinite(h) && h >= -500 && h <= 9000;
/**
* The selected earthquake's contour lines, painted on the world overlay:
* wavy closed lines, shaped by the quake's id (earthquakeContourShape), run
* from the marker out to the disc's edge and fade there, one after another,
* for RIPPLE_ACTIVE_CYCLES runs after a quake is selected and only while it
* is on screen, then rest as still contours. They never cross, and every third is
* a heavier index contour, as on a topographic map. Nothing is drawn, and no
* frame is asked for, while no quake is selected. With reduced motion the
* lines hold still.
*
* A line is drawn in the tangent plane at the epicentre: at the largest
* disc (M6, 64 km) it sits about 320 m above the curved ground at its edge
* (64² / 2R), about 1.5 px off the drawn disc at the 220 km, -45° framing a
* label click flies to (900 px tall, 35° field of view); less for smaller
* quakes, as the offset grows with the square of the radius.
* @param {object} [deps]
* @param {Function} [deps.registerLane] `registerWorldOverlayPaintLane`.
* @param {() => number} [deps.now] Steady clock, ms.
* @param {(cb: Function) => number} [deps.requestFrame]
* @param {(handle: number) => void} [deps.cancelFrame]
* @param {() => boolean} [deps.prefersReducedMotion]
* @returns {{show: Function, hide: Function, dispose: Function}}
*/
export function createEarthquakeRipples({
registerLane = registerWorldOverlayPaintLane,
now = () => globalThis.performance?.now?.() ?? Date.now(),
requestFrame = (cb) => globalThis.requestAnimationFrame?.(cb) ?? null,
cancelFrame = (handle) => globalThis.cancelAnimationFrame?.(handle),
prefersReducedMotion = reducedMotion,
} = {}) {
let lane = null;
let target = null;
let frameHandle = null;
// When the running lines settle into still contours (the selection's
// bound), and whether the last paint found the quake on screen.
let startedAt = 0;
let settlesAt = 0;
let onScreen = false;
/** Whether the lines run now: in the window, and motion allowed. */
const running = () => now() < settlesAt && !prefersReducedMotion();
// Unit offsets around the line in the epicentre's tangent plane, packed
// x, y, z per point: north·cos + east·sin.
const offsets = new Float64Array((RIPPLE_RING_SEGMENTS + 1) * 3);
const angles = new Float64Array(RIPPLE_RING_SEGMENTS + 1);
for (let i = 0; i <= RIPPLE_RING_SEGMENTS; i++)
angles[i] = (2 * Math.PI * i) / RIPPLE_RING_SEGMENTS;
// Screen points, reused every frame.
const at = { x: 0, y: 0 };
const centerAt = { x: 0, y: 0 };
const eastAt = { x: 0, y: 0 };
const northAt = { x: 0, y: 0 };
/** Project an ECEF point to CSS pixels; false when it is behind the eye. */
function project(frame, px, py, pz, out) {
const m = frame.viewProjectionMatrix;
const w = m[3] * px + m[7] * py + m[11] * pz + m[15];
if (w <= 0) return false;
out.x =
((m[0] * px + m[4] * py + m[8] * pz + m[12]) / w / 2 + 0.5) * frame.width;
out.y =
(0.5 - (m[1] * px + m[5] * py + m[9] * pz + m[13]) / w / 2) *
frame.height;
return true;
}
/**
* Trace one closed line at `fraction` of the disc's radius (`shaped`:
* as a contour, else the disc's own circle). True when all of it is in
* front of the eye, so it can be filled.
*/
function trace(frame, fraction, shaped) {
const { ctx } = frame;
const center = target.center;
const reach = fraction * target.radiusM;
ctx.beginPath();
let pen = false;
let whole = true;
for (let i = 0; i <= RIPPLE_RING_SEGMENTS; i++) {
// The last point repeats the first angle, so the line closes.
const r = shaped
? reach * earthquakeContourScale(target.shape, angles[i], fraction)
: reach;
const visible = project(
frame,
center.x + offsets[i * 3] * r,
center.y + offsets[i * 3 + 1] * r,
center.z + offsets[i * 3 + 2] * r,
at,
);
if (!visible) {
pen = false;
whole = false;
continue;
}
if (pen) ctx.lineTo(at.x, at.y);
else ctx.moveTo(at.x, at.y);
pen = true;
}
return whole;
}
/**
* Fill the traced path with a radial gradient laid on the ground: the
* canvas places a path when it is traced and a gradient when it fills, so
* under the disc's ground-to-screen transform the gradient's circle
* becomes the disc's ellipse on screen while the path stays exact.
* @param {Array<[number, number]>} stops [offset, alpha], out to `reach`.
*/
function fillGround(ctx, reach, stops) {
ctx.save();
ctx.transform(
eastAt.x - centerAt.x,
eastAt.y - centerAt.y,
northAt.x - centerAt.x,
northAt.y - centerAt.y,
centerAt.x,
centerAt.y,
);
const gradient = ctx.createRadialGradient(0, 0, 0, 0, 0, reach);
for (const [offset, alpha] of stops)
gradient.addColorStop(offset, target.rgba(alpha));
ctx.fillStyle = gradient;
ctx.globalAlpha = 1;
ctx.fill();
ctx.restore();
}
/**
* Whether any of the disc is in the viewport: its centre's screen point,
* padded by its larger screen radius (or, seen edge-on, the centre alone).
*/
function discOnScreen(frame, c, e, n) {
if (!Number.isFinite(c.x) || !Number.isFinite(c.y)) return false;
const pad = Math.max(
Math.hypot(e.x - c.x, e.y - c.y) || 0,
Math.hypot(n.x - c.x, n.y - c.y) || 0,
);
return (
c.x + pad >= 0 &&
c.x - pad <= frame.width &&
c.y + pad >= 0 &&
c.y - pad <= frame.height
);
}
/**
* Re-read the ground height under the quake, at most twice a second while
* painting: the ground loads and refines as the camera comes in, and the
* rings move onto it once it differs by more than a metre.
*/
function settleHeight() {
if (!target.heightAt) return;
const at = now();
if (at - target.heightReadAt < HEIGHT_READ_INTERVAL_MS) return;
target.heightReadAt = at;
let height = null;
try {
height = target.heightAt();
} catch {
height = null;
}
if (!groundHeightOk(height) || Math.abs(height - target.heightM) <= 1)
return;
target.heightM = height;
target.center = fromDegrees(target.lon, target.lat, height);
}
function paint(frame) {
if (!target) return;
const { ctx } = frame;
settleHeight();
const center = target.center;
onScreen = false;
if (frame.occluder?.isPointVisible?.(center) === false) return;
const R = target.radiusM;
// The disc's ground frame on screen: its centre, and a radius east and
// north. Seen edge-on (or partly behind the eye) it is not filled.
const centerOk = project(frame, center.x, center.y, center.z, centerAt);
const eastOk = project(
frame,
center.x + target.east.x * R,
center.y + target.east.y * R,
center.z + target.east.z * R,
eastAt,
);
const northOk = project(
frame,
center.x + target.north.x * R,
center.y + target.north.y * R,
center.z + target.north.z * R,
northAt,
);
let fills = centerOk && eastOk && northOk;
if (fills) {
const area =
(eastAt.x - centerAt.x) * (northAt.y - centerAt.y) -
(eastAt.y - centerAt.y) * (northAt.x - centerAt.x);
fills = Math.abs(area) > 1;
}
onScreen =
centerOk &&
discOnScreen(
frame,
centerAt,
eastOk ? eastAt : centerAt,
northOk ? northAt : centerAt,
);
// The disc: strongest at the epicentre, fading out to its outer circle.
if (fills && trace(frame, 1, false)) fillGround(ctx, 1, DISC_FADE);
const animate = running();
const rings = animate
? earthquakeRippleRings(now() - startedAt)
: earthquakeContourRings();
// Brought back into view while the window lasts: run again.
if (animate && onScreen && frameHandle === null && lane)
frameHandle = requestFrame(tick);
ctx.strokeStyle = target.color;
ctx.lineJoin = 'round';
for (const { fraction, alpha, index } of rings) {
if (!(alpha > 0.01)) continue;
const whole = trace(frame, fraction, true);
// Each wave: clear inside, tinting toward its own line, as it fades.
if (fills && whole)
fillGround(
ctx,
fraction,
WAVE_FADE.map(([offset, a]) => [offset, a * alpha]),
);
ctx.lineWidth = index ? INDEX_WIDTH_PX : LINE_WIDTH_PX;
ctx.globalAlpha = alpha;
ctx.stroke();
}
ctx.globalAlpha = 1;
}
/** Ask for one more frame while the lines run (one request at a time). */
function tick() {
frameHandle = null;
if (!target || !lane) return;
// Settled, or out of sight: one last paint draws the still contours
// (or nothing), and no more frames are asked for. A paint that finds it
// on screen again inside the window starts the frames again.
if (!running() || !onScreen) {
lane.requestPaint();
return;
}
lane.requestPaint();
frameHandle = requestFrame(tick);
}
function stopFrames() {
if (frameHandle !== null) cancelFrame(frameHandle);
frameHandle = null;
}
/**
* Run the contour lines around one quake, replacing any other.
* @param {{id: string, lon: number, lat: number, heightM?: number, heightAt?: () => number|null, radiusM: number, color: string}} next
* @param {{restart?: boolean}} [options] `restart: false` updates the
* same quake in place (a feed refresh) without running it again.
*/
function show(next, { restart = true } = {}) {
if (
!next ||
!Number.isFinite(next.lon) ||
!Number.isFinite(next.lat) ||
!(next.radiusM > 0)
) {
hide();
return;
}
const sameQuake = target?.id === next.id;
const lon = (next.lon * Math.PI) / 180;
const lat = (next.lat * Math.PI) / 180;
const [sinLon, cosLon] = [Math.sin(lon), Math.cos(lon)];
const [sinLat, cosLat] = [Math.sin(lat), Math.cos(lat)];
for (let i = 0; i <= RIPPLE_RING_SEGMENTS; i++) {
const [c, s] = [Math.cos(angles[i]), Math.sin(angles[i])];
offsets[i * 3] = c * -sinLat * cosLon + s * -sinLon;
offsets[i * 3 + 1] = c * -sinLat * sinLon + s * cosLon;
offsets[i * 3 + 2] = c * cosLat;
}
target = {
id: next.id,
// On the ground the disc is draped on: the height known now, then
// re-read while painting (see `settleHeight`), since a label's fly-to
// starts from far away, before that ground has loaded.
lon: next.lon,
lat: next.lat,
heightM: groundHeightOk(next.heightM) ? next.heightM : 0,
heightAt: typeof next.heightAt === 'function' ? next.heightAt : null,
heightReadAt: -Infinity,
center: fromDegrees(
next.lon,
next.lat,
groundHeightOk(next.heightM) ? next.heightM : 0,
),
radiusM: next.radiusM,
color: next.color || 'rgb(255,165,0)',
shape: earthquakeContourShape(next.id),
rgba: cssWithAlpha(next.color || 'rgb(255,165,0)'),
// Angle 0 is north and a quarter turn is east (see `offsets`).
north: { x: offsets[0], y: offsets[1], z: offsets[2] },
east: {
x: offsets[(RIPPLE_RING_SEGMENTS / 4) * 3],
y: offsets[(RIPPLE_RING_SEGMENTS / 4) * 3 + 1],
z: offsets[(RIPPLE_RING_SEGMENTS / 4) * 3 + 2],
},
};
if (restart || !sameQuake) {
startedAt = now();
settlesAt =
startedAt + RIPPLE_ACTIVE_CYCLES * EARTHQUAKE_RIPPLE_PERIOD_MS;
// Assume it is in view until a paint says otherwise.
onScreen = true;
}
lane ??= registerLane(RIPPLE_PAINT_LANE, paint, {
id: 'earthquake-ripples',
});
lane.setActive(true);
lane.requestPaint();
// A refresh while the disc is out of sight asks for no frame; a paint
// that finds it on screen again starts them (a restart sets onScreen).
if (running() && onScreen && frameHandle === null)
frameHandle = requestFrame(tick);
}
function hide() {
stopFrames();
if (!target) return;
target = null;
lane?.setActive(false);
}
function dispose() {
hide();
lane?.unregister();
lane = null;
}
return { show, hide, dispose };
}
+452
View File
@@ -0,0 +1,452 @@
import assert from 'node:assert/strict';
import test from 'node:test';
import {
DISC_FADE,
cssWithAlpha,
RIPPLE_ACTIVE_CYCLES,
RIPPLE_PAINT_LANE,
RIPPLE_RING_SEGMENTS,
createEarthquakeRipples,
} from './earthquakeRipples.js';
import {
EARTHQUAKE_RIPPLE_PERIOD_MS,
EARTHQUAKE_RIPPLE_RINGS,
} from '../../layers/earthquakes/model.js';
import { fromDegrees } from '../../geo/ellipsoid.js';
/** A paint lane, frame clock and canvas the test steps by hand. */
function harness({ reducedMotion = false } = {}) {
let motionReduced = reducedMotion;
const lanes = [];
const frames = new Map();
let nextFrame = 1;
let clock = 0;
const ripples = createEarthquakeRipples({
registerLane(laneId, painter, options) {
const lane = {
laneId,
painter,
options,
active: false,
paints: 0,
unregistered: false,
setActive(next) {
lane.active = next;
},
requestPaint() {
lane.paints++;
},
unregister() {
lane.unregistered = true;
},
};
lanes.push(lane);
return lane;
},
now: () => clock,
requestFrame(cb) {
const handle = nextFrame++;
frames.set(handle, cb);
return handle;
},
cancelFrame: (handle) => frames.delete(handle),
prefersReducedMotion: () => motionReduced,
});
const strokes = [];
const fills = [];
let path = null;
const ctx = {
globalAlpha: 1,
beginPath() {
path = { moves: 0, lines: 0 };
},
moveTo() {
path.moves++;
},
lineTo() {
path.lines++;
},
stroke() {
strokes.push({
...path,
alpha: ctx.globalAlpha,
color: ctx.strokeStyle,
width: ctx.lineWidth,
});
},
// Fills record their path, gradient and the transform they fill under.
saved: 0,
transformed: null,
save() {
ctx.saved++;
},
restore() {
ctx.saved--;
ctx.transformed = null;
},
transform(...args) {
ctx.transformed = args;
},
createRadialGradient(...circles) {
const gradient = { circles, stops: [] };
gradient.addColorStop = (offset, color) =>
gradient.stops.push([offset, color]);
return gradient;
},
fill() {
fills.push({
...path,
gradient: ctx.fillStyle,
transform: ctx.transformed,
});
},
};
// w = 1 everywhere: every point is in front of the eye.
const matrix = new Float64Array(16);
matrix[0] = 1e-7;
matrix[5] = 1e-7;
matrix[15] = 1;
const frame = (visible = true) => ({
ctx,
width: 800,
height: 600,
viewProjectionMatrix: matrix,
occluder: { isPointVisible: () => visible },
});
return {
ripples,
lanes,
frames,
strokes,
fills,
frame,
matrix,
setReducedMotion(next) {
motionReduced = next;
},
advance(ms) {
clock += ms;
},
/** Run the pending animation frames once. */
step() {
const pending = [...frames.entries()];
frames.clear();
for (const [, cb] of pending) cb();
},
};
}
const target = {
id: 'ak1',
lon: -153.3,
lat: 60,
radiusM: 32000,
color: 'rgb(255,0,0)',
};
test('nothing is registered or animated until a quake is selected', () => {
const h = harness();
assert.equal(h.lanes.length, 0);
assert.equal(h.frames.size, 0);
h.ripples.hide();
assert.equal(h.frames.size, 0);
});
test('a selected quake animates one ring set, one frame request at a time', () => {
const h = harness();
h.ripples.show(target);
const [lane] = h.lanes;
assert.equal(lane.laneId, RIPPLE_PAINT_LANE);
assert.equal(RIPPLE_PAINT_LANE, 'ambient-label', 'under the labels');
assert.equal(lane.active, true);
assert.equal(h.frames.size, 1);
h.ripples.show({ ...target, id: 'ak2' });
assert.equal(h.lanes.length, 1, 'the lane is reused');
assert.equal(h.frames.size, 1, 'still one frame loop');
const before = lane.paints;
h.step();
h.step();
assert.equal(lane.paints, before + 2, 'one repaint per frame');
assert.equal(h.frames.size, 1);
h.advance(600);
lane.painter(h.frame());
// At 600 ms every line is between the marker and the edge, so all draw.
assert.equal(h.strokes.length, EARTHQUAKE_RIPPLE_RINGS);
assert.deepEqual(
h.strokes.map((stroke) => stroke.width),
[2, 1.1, 1.1, 2, 1.1, 1.1],
'every third line is an index contour',
);
for (const stroke of h.strokes) {
assert.equal(stroke.moves, 1, 'one unbroken ring');
assert.equal(stroke.lines, RIPPLE_RING_SEGMENTS);
assert.equal(stroke.color, 'rgb(255,0,0)');
assert.ok(stroke.alpha > 0 && stroke.alpha <= 1);
}
h.ripples.hide();
assert.equal(lane.active, false);
assert.equal(h.frames.size, 0, 'no frames asked for once hidden');
h.strokes.length = 0;
lane.painter(h.frame());
assert.equal(h.strokes.length, 0);
});
test('rings are skipped behind the globe and broken behind the eye', () => {
const h = harness();
h.ripples.show(target);
h.advance(600);
const [lane] = h.lanes;
lane.painter(h.frame(false));
assert.equal(h.strokes.length, 0, 'epicentre over the horizon');
// Points with negative x fall behind the eye: each ring breaks there.
const frame = h.frame();
frame.viewProjectionMatrix[3] = 1e-6;
const center = fromDegrees(target.lon, target.lat);
frame.viewProjectionMatrix[15] = -1e-6 * center.x;
lane.painter(frame);
assert.equal(h.strokes.length, EARTHQUAKE_RIPPLE_RINGS);
for (const stroke of h.strokes)
assert.ok(stroke.lines < RIPPLE_RING_SEGMENTS, 'part of each ring hidden');
});
test('reduced motion draws still contour rings and asks for no frames', () => {
const h = harness({ reducedMotion: true });
h.ripples.show(target);
assert.equal(h.frames.size, 0);
assert.equal(h.lanes[0].paints, 1, 'painted once');
h.lanes[0].painter(h.frame());
assert.equal(h.strokes.length, EARTHQUAKE_RIPPLE_RINGS);
assert.ok(h.strokes.every((stroke) => stroke.alpha === 0.7));
});
test('an unusable target hides the rings; dispose releases the lane', () => {
const h = harness();
h.ripples.show(target);
h.ripples.show({ ...target, radiusM: 0 });
assert.equal(h.lanes[0].active, false);
assert.equal(h.frames.size, 0);
h.ripples.dispose();
assert.equal(h.lanes[0].unregistered, true);
// Shown again after dispose, it registers a fresh lane.
h.ripples.show(target);
assert.equal(h.lanes.length, 2);
h.ripples.dispose();
});
test('contour lines are wavy, the same for a quake every time, and inside the disc', () => {
const h = harness();
h.ripples.show(target);
h.advance(600);
// An identity-like projection: screen x, y follow ECEF y, z, so the
// distance from the projected epicentre measures each point's radius.
const frame = h.frame();
const m = frame.viewProjectionMatrix;
m[0] = 0;
m[5] = 0;
m[4] = 1e-6;
m[9] = 1e-6;
const points = [];
const ctx = frame.ctx;
const record = (x, y) => points.at(-1).push([x, y]);
ctx.beginPath = () => points.push([]);
ctx.moveTo = record;
ctx.lineTo = record;
ctx.stroke = () => {};
h.lanes[0].painter(frame);
const center = fromDegrees(target.lon, target.lat);
const cx = (center.y * 1e-6 * 0.5 + 0.5) * 800;
const cy = (0.5 - center.z * 1e-6 * 0.5) * 600;
const spread = (line) => {
const radii = line.map(([x, y]) => Math.hypot(x - cx, y - cy));
return Math.max(...radii) / Math.min(...radii);
};
// The disc's outer circle first (filled, not stroked), then each line.
assert.equal(points.length, EARTHQUAKE_RIPPLE_RINGS + 1);
points.shift();
assert.ok(
points.every((line) => spread(line) > 1.05),
'not circles: each line dents in and out',
);
for (const line of points) {
const [first, last] = [line[0], line.at(-1)];
assert.ok(
Math.hypot(first[0] - last[0], first[1] - last[1]) < 1e-6,
'closed',
);
}
});
test('the disc fades out to its outer circle; each wave fills with a fade', () => {
const h = harness();
h.ripples.show(target);
h.advance(600);
// A projection where east and north span the screen: the disc is seen
// from above, so its ground frame can be filled.
const frame = h.frame();
const m = frame.viewProjectionMatrix;
m[0] = 0;
m[5] = 0;
m[4] = 1e-6;
m[9] = 1e-6;
h.lanes[0].painter(frame);
assert.equal(h.fills.length, 1 + EARTHQUAKE_RIPPLE_RINGS);
const [disc, ...waves] = h.fills;
assert.equal(disc.lines, RIPPLE_RING_SEGMENTS, 'the whole outer circle');
assert.deepEqual(disc.gradient.circles, [0, 0, 0, 0, 0, 1]);
assert.deepEqual(
disc.gradient.stops,
DISC_FADE.map(([offset, alpha]) => [offset, `rgba(255,0,0,${alpha})`]),
);
assert.equal(disc.gradient.stops.at(-1)[1], 'rgba(255,0,0,0)', 'fades out');
assert.ok(disc.transform, 'filled under the ground-to-screen transform');
assert.equal(h.fills.length, waves.length + 1);
for (const wave of waves) {
const reach = wave.gradient.circles[5];
assert.ok(reach > 0 && reach < 1, 'out to its own line');
assert.equal(wave.gradient.stops[0][1], 'rgba(255,0,0,0)', 'clear inside');
}
// The transforms were undone: nothing leaks into the labels' painting.
assert.equal(frame.ctx.saved, 0);
// Seen edge-on, the ground frame has no area: lines only, no fills.
h.fills.length = 0;
m[9] = 0;
m[5] = 0;
h.lanes[0].painter(frame);
assert.equal(h.fills.length, 0);
});
test('cssWithAlpha turns rgb into rgba stops', () => {
assert.equal(cssWithAlpha('rgb(255,165,0)')(0.25), 'rgba(255,165,0,0.25)');
assert.equal(cssWithAlpha('rgba(1, 2, 3, 0.5)')(2), 'rgba(1,2,3,1)');
assert.equal(cssWithAlpha('red')(0.3), 'red');
});
test('the lines run a bounded time after a selection, then rest without frames', () => {
const h = harness();
h.ripples.show(target);
const [lane] = h.lanes;
const window = RIPPLE_ACTIVE_CYCLES * EARTHQUAKE_RIPPLE_PERIOD_MS;
assert.ok(window <= 15_000, 'about a quarter of a minute at most');
let frames = 0;
for (let t = 0; t < window * 3; t += 16) {
if (!h.frames.size) break;
lane.painter(h.frame());
h.advance(16);
h.step();
frames++;
}
assert.equal(h.frames.size, 0, 'no frame asked for once settled');
assert.ok(frames <= Math.ceil(window / 16) + 2, `bounded: ${frames} frames`);
// At rest the lines hold still as readable contours.
h.strokes.length = 0;
lane.painter(h.frame());
assert.equal(h.strokes.length, EARTHQUAKE_RIPPLE_RINGS);
assert.ok(h.strokes.every((stroke) => stroke.alpha === 0.7));
// A parked camera repainting the overlay does not start them again.
lane.painter(h.frame());
assert.equal(h.frames.size, 0);
// A new selection runs again.
h.ripples.show({ ...target, id: 'ak2' });
assert.equal(h.frames.size, 1);
h.ripples.dispose();
});
test('off screen the frames stop; back in view inside the window they resume', () => {
const h = harness();
h.ripples.show(target);
const [lane] = h.lanes;
// Behind the globe.
lane.painter(h.frame(false));
const paints = lane.paints;
h.step();
assert.equal(h.frames.size, 0, 'stopped while out of sight');
assert.equal(lane.paints, paints + 1, 'one last paint, then none');
h.step();
assert.equal(lane.paints, paints + 1);
// Panned away: the disc is far off the viewport.
h.ripples.show(target);
const away = h.frame();
away.viewProjectionMatrix[12] = 50;
lane.painter(away);
h.step();
assert.equal(h.frames.size, 0);
// The camera brings it back while the window lasts.
away.viewProjectionMatrix[12] = 0;
lane.painter(h.frame());
assert.equal(h.frames.size, 1, 'resumed');
h.ripples.dispose();
});
test('turning reduced motion on mid-run stills the lines and stops the frames', () => {
const h = harness();
h.ripples.show(target);
const [lane] = h.lanes;
lane.painter(h.frame());
h.setReducedMotion(true);
h.step();
assert.equal(h.frames.size, 0);
h.strokes.length = 0;
lane.painter(h.frame());
assert.ok(
h.strokes.every((stroke) => stroke.alpha === 0.7),
'still',
);
// Turned off again within the window: the next paint runs them again.
h.setReducedMotion(false);
lane.painter(h.frame());
assert.equal(h.frames.size, 1);
h.ripples.dispose();
});
test('a refresh of the same quake does not run a settled selection again', () => {
const h = harness();
h.ripples.show(target);
const [lane] = h.lanes;
h.advance(RIPPLE_ACTIVE_CYCLES * EARTHQUAKE_RIPPLE_PERIOD_MS + 1);
lane.painter(h.frame());
h.step();
assert.equal(h.frames.size, 0, 'settled');
h.ripples.show({ ...target, radiusM: 40000 }, { restart: false });
assert.equal(h.frames.size, 0, 'a refresh keeps it at rest');
lane.painter(h.frame());
assert.equal(h.frames.size, 0);
// A different quake, or a user's restart, runs again.
h.ripples.show({ ...target, id: 'other' }, { restart: false });
assert.equal(h.frames.size, 1);
h.ripples.dispose();
});
// The rings sit on the ground the disc is draped on. A label's fly-to starts
// far away, before that ground loads, so the painter reads the height again
// while it paints and moves the rings onto it.
test('the rings move onto the ground height once it loads', () => {
const h = harness();
let ground = null;
h.ripples.show({ ...target, heightM: 0, heightAt: () => ground });
h.advance(600);
const [lane] = h.lanes;
lane.painter(h.frame());
const atSea = h.fills.at(-1).transform;
h.fills.length = 0;
ground = 4000;
h.advance(600);
lane.painter(h.frame());
const onGround = h.fills.at(-1).transform;
assert.notDeepEqual(onGround, atSea, 'the centre moved up onto the ground');
// A change of a metre or less, or an impossible height, leaves them put.
for (const next of [4000.5, 25000, -2000]) {
ground = next;
h.advance(600);
lane.painter(h.frame());
assert.deepEqual(h.fills.at(-1).transform, onGround, String(next));
}
// Reads are bounded: a second paint within the interval does not ask again.
let reads = 0;
h.ripples.show({ ...target, id: 'ak2', heightAt: () => (reads++, 4000) });
lane.painter(h.frame());
lane.painter(h.frame());
assert.equal(reads, 1);
});
+45 -2
View File
@@ -1,6 +1,49 @@
import { createEarthquakesLayer } from '../../layers/earthquakes/index.js';
import { overlayHost } from './overlayHost.js';
/** Wire earthquake observations to the application overlay host. */
import { inputFor } from '../../input/dispatcher.js';
import * as picking from '../../data/pickRegistry.js';
import * as context from '../../data/contextStore.js';
import { isPointerFree } from '../../data/inputOwnership.js';
import { requestWorldFocus } from '../../worldFocus.js';
import { createEarthquakeRipples } from './earthquakeRipples.js';
import { heightsOf } from '../../queries/heights.js';
import { formatDate, formatNumber, t } from '../../i18n/index.js';
const EVENT_TIME = Object.freeze({
day: 'numeric',
month: 'short',
year: 'numeric',
hour: '2-digit',
minute: '2-digit',
timeZone: 'UTC',
timeZoneName: 'short',
});
/** The clicked quake's card text, in the page's language. */
export const earthquakeCardText = Object.freeze({
t,
formatTime: (time) => formatDate(time, EVENT_TIME),
formatDepth: (km) => formatNumber(km, { maximumFractionDigits: 1 }),
});
/**
* Wire earthquake observations to the application overlay host, and its
* discs to the globe's clicks: a clicked quake shows its detail card.
*/
export function createApplicationEarthquakes(options) {
return createEarthquakesLayer({ overlayHost, ...options });
return createEarthquakesLayer({
overlayHost,
input: (viewer) => inputFor(viewer),
picking,
context,
pointer: { isPointerFree },
openExternal: (url) => window.open(url, '_blank', 'noopener,noreferrer'),
focus: { requestWorldFocus },
ripples: createEarthquakeRipples(),
// The loaded ground (terrain or tiles) the clamped disc is draped on.
groundHeight: (viewer, lon, lat) =>
viewer ? heightsOf(viewer).now({ lon, lat }) : null,
text: earthquakeCardText,
...options,
});
}
+2 -1
View File
@@ -2,11 +2,12 @@ import { createRocketLaunchesLayer } from '../../layers/launches/index.js';
import * as geometry from '../../celestialRing.js';
import * as overlays from '../../overlays/worldOverlay.js';
import * as render from '../../renderGovernor.js';
import * as picking from '../../data/pickRegistry.js';
/** Construct one layer using the application scene owners and a supplied source. */
export function createApplicationLaunches({ source, satellites }) {
return createRocketLaunchesLayer({
source,
services: { satellites, geometry, overlays, render },
services: { satellites, geometry, overlays, render, picking },
});
}
+2
View File
@@ -1,9 +1,11 @@
import { createSubmarineCableLayer } from '../../layers/submarineCables/index.js';
import { overlayHost } from './overlayHost.js';
import * as picking from '../../data/pickRegistry.js';
/** Wire cable source geometry to the application overlay host. */
export function createApplicationCables(options) {
return createSubmarineCableLayer({
overlayHost,
picking,
mapStackEventTarget: typeof window !== 'undefined' ? window : null,
...options,
});
+3
View File
@@ -1,6 +1,7 @@
import { createApplicationOperations } from './operations.js';
import { registerDataCredits } from '../data/dataCredits.js';
import { mountCreditsView } from '../ui/creditsView.js';
import { trackCreditLineHeight } from '../ui/creditLineHeight.js';
import { MapStackController } from '../mapStackController.js';
import { mapEngineFor } from '../maps/engine.js';
import { initLogoGaze } from '../logoGaze.js';
@@ -173,6 +174,8 @@ export async function createApplicationScene({
// The credits, in the application's own line, unless the renderer shows
// them in a display of its own.
if (!hooks.ownCreditDisplay) defer(mountCreditsView(viewer));
// The HUD corners above the line clear it when it wraps.
defer(trackCreditLineHeight(document));
loaderStatus.textContent =
googleApiKey || googleTokens || cesiumToken
? t('Loading Google 3D Tiles...')
+58 -51
View File
@@ -50,8 +50,11 @@ import { overlayHost } from './layers/overlayHost.js';
* runs after each layer disable (a scene without one keeps that memory).
* `library.fetchTile` and `library.fetchData` fetch the Data Library's tiles
* and proxied datasets in place of the defaults (`createLibrarySource`).
* `library.fetchImpl` asks the library server (its catalog) in place of the
* page's fetch, for a server that wants the application's own credentials.
* `library.requireCatalog` offers only what the server's library catalog
* names, and nothing while it does not answer.
* names, and nothing while it does not answer. `library: false` leaves the
* Data Library out: no catalog is asked, and no Browse button is drawn.
*/
export function createApplicationTools({
scene,
@@ -153,56 +156,60 @@ export function createApplicationTools({
connect: connectDisplay,
});
defer(() => geoFileImport?.destroy());
// DATA ▸ Library: entries register their layers only when a viewer adds
// them, after the core catalog is sealed. The browser dialog and the
// controller share the application lifetime.
const dataLibrary = createDataLibrary({
dataManager,
services: localGeoJsonServices,
getTileset: () => tileset,
mapStackController,
shareLink: styleManager.shareLinkManager,
requestRender: governorRequestRender,
// An application's own tile and dataset fetches, when it keeps them in
// its own cache.
fetchTile: library.fetchTile ?? null,
fetchData: library.fetchData ?? null,
requireCatalog: library.requireCatalog === true,
// Zoom to layer: an immediate navigation, so Cockpit can refuse it and
// the current follow owner is released first (as for imported files).
zoomTo: (extent) =>
styleManager.runImmediateNavigation('layer', () =>
flyToLibraryExtent(viewer, extent),
) !== false,
});
defer(() => dataLibrary.destroy());
// Browse: the owner presents the dialog through the store; LayerPanelsView
// draws the Browse button and the dialog from it.
const libraryStore = useDataLibraryStore(applicationPinia());
const libraryBrowser = createLibraryBrowser({
library: dataLibrary,
publish: (view) => libraryStore.publish(view),
});
libraryStore.connect(libraryBrowser.controls);
defer(() => {
libraryBrowser.destroy();
libraryStore.connect(null);
});
dataLibrary.start({ signal }).catch((error) => {
if (!signal?.aborted) console.warn('[Library] start failed:', error);
});
// The live gate's handle (scripts/qa-data-library.mjs).
const libraryHandle = {
library: dataLibrary,
browser: libraryBrowser,
// What Copy Link would copy.
buildShareLink: () => styleManager.shareLinkManager?.buildLink?.() ?? null,
};
window.__gevDataLibrary = libraryHandle;
defer(() => {
if (window.__gevDataLibrary === libraryHandle)
delete window.__gevDataLibrary;
});
if (library !== false) {
// DATA ▸ Library: entries register their layers only when a viewer adds
// them, after the core catalog is sealed. The browser dialog and the
// controller share the application lifetime.
const dataLibrary = createDataLibrary({
dataManager,
services: localGeoJsonServices,
getTileset: () => tileset,
mapStackController,
shareLink: styleManager.shareLinkManager,
requestRender: governorRequestRender,
// An application's own tile and dataset fetches, when it keeps them in
// its own cache.
fetchImpl: library.fetchImpl ?? undefined,
fetchTile: library.fetchTile ?? null,
fetchData: library.fetchData ?? null,
requireCatalog: library.requireCatalog === true,
// Zoom to layer: an immediate navigation, so Cockpit can refuse it and
// the current follow owner is released first (as for imported files).
zoomTo: (extent) =>
styleManager.runImmediateNavigation('layer', () =>
flyToLibraryExtent(viewer, extent),
) !== false,
});
defer(() => dataLibrary.destroy());
// Browse: the owner presents the dialog through the store; LayerPanelsView
// draws the Browse button and the dialog from it.
const libraryStore = useDataLibraryStore(applicationPinia());
const libraryBrowser = createLibraryBrowser({
library: dataLibrary,
publish: (view) => libraryStore.publish(view),
});
libraryStore.connect(libraryBrowser.controls);
defer(() => {
libraryBrowser.destroy();
libraryStore.connect(null);
});
dataLibrary.start({ signal }).catch((error) => {
if (!signal?.aborted) console.warn('[Library] start failed:', error);
});
// The live gate's handle (scripts/qa-data-library.mjs).
const libraryHandle = {
library: dataLibrary,
browser: libraryBrowser,
// What Copy Link would copy.
buildShareLink: () =>
styleManager.shareLinkManager?.buildLink?.() ?? null,
};
window.__gevDataLibrary = libraryHandle;
defer(() => {
if (window.__gevDataLibrary === libraryHandle)
delete window.__gevDataLibrary;
});
}
// DATA ▸ Recent Imagery: the box tool claims the pointer like Draw and the
// panel lives on the right rail, so both belong to the application
// lifetime. The tileset lets the layer drape while the globe is hidden.
+7 -5
View File
@@ -403,10 +403,11 @@ test('vessel and fire layers announce valid clicks and never fly cameras', () =>
'vessel click',
);
ordered(vesselClick, [
'clickCard?.(event)',
'selectAndFocusVessel(carded)',
"isOwnedByOtherLayer('ais-live-vessels', pickedId)",
'_vesselOverlayHost.hitTest?.(',
'selectAndFocusVessel(record)',
], 'vessel sibling ownership');
], 'vessel card on top, then sibling ownership');
const vesselFocus = body(
vessels,
/function selectAndFocusVessel\(record\) \{([\s\S]*?)\n \}/,
@@ -419,8 +420,9 @@ test('vessel and fire layers announce valid clicks and never fly cameras', () =>
'fire click',
);
ordered(fireClick, [
'isOwnedByOtherLayer(id, pickedId)',
'overlayHost.hitTest?.(',
'clickCard?.(event)',
'selectAndFocusFire(carded)',
], 'fire sibling ownership');
'isOwnedByOtherLayer(id, pickedId)',
'clearFireSelection()',
], 'fire card on top, then sibling ownership');
});
+8 -6
View File
@@ -595,7 +595,7 @@ test('Cockpit Display portal retains both scroll owners across round trips', ()
const portal = CockpitDisplayPortal.toString();
assert.match(
portal,
/this\.standardScrollTop =\s*displayPanelScroller\(standardPanel\)\?\.scrollTop \|\| 0/,
/this\.standardScrollTop = standardPanel\?\.scrollTop \|\| 0/,
);
assert.match(
portal,
@@ -603,7 +603,7 @@ test('Cockpit Display portal retains both scroll owners across round trips', ()
);
assert.match(
portal,
/if \(!this\.active\)[\s\S]*?this\.standardScrollTop =\s*displayPanelScroller\(standardPanel\)\.scrollTop/,
/if \(!this\.active\)[\s\S]*?this\.standardScrollTop = standardPanel\.scrollTop/,
);
assert.match(
portal,
@@ -611,7 +611,7 @@ test('Cockpit Display portal retains both scroll owners across round trips', ()
);
assert.match(
portal,
/this\.cockpitPanel\.scrollTop = this\.cockpitScrollTop[\s\S]*?displayPanelScroller\(this\.standardPanel\)\.scrollTop =\s*this\.standardScrollTop/,
/this\.cockpitPanel\.scrollTop = this\.cockpitScrollTop[\s\S]*?this\.standardPanel\.scrollTop = this\.standardScrollTop/,
);
});
@@ -680,6 +680,7 @@ test('fresh Cockpit entry temporarily collapses map panels and exit restores the
'scene-panel',
'pp-toggles',
'global-context-panel',
'space-missions-panel',
'radio-panel',
]) {
assert.match(
@@ -1261,14 +1262,15 @@ test('Global Context uses its dedicated right rail without a duplicate Data Laye
);
assert.match(html, /id="global-context-panel"/);
assert.match(html, /id="global-context-flights-btn"/);
assert.match(html, /id="global-context-missions-btn"/);
assert.doesNotMatch(html, /id="global-context-missions-btn"/);
assert.match(html, /id="space-missions-panel"/);
});
test('Global Context standby describes both chooser modes', () => {
test('Global Context standby describes Contacts', () => {
const match = html.match(/<div id="context-mode-standby"[\s\S]*?<\/div>/);
assert.ok(match, 'Global Context standby is missing');
assert.match(match[0], /CONTACTS — nearest planes · vessels · sites/);
assert.match(match[0], /SPACE MISSIONS — launches &amp; orbital assets/);
assert.doesNotMatch(match[0], /SPACE MISSIONS/);
});
test('cockpit briefing cycle control keeps its state as the accessible name', () => {
+7 -4
View File
@@ -58,12 +58,15 @@ export function cockpitAnchorCorrectionStep(
return Math.min(distanceM, eased, correctionRateMps * dt);
}
/** How late past its interval an update may come and still count in full. */
const COCKPIT_SUBJECT_LATE_SEC = 1;
/**
* The seconds an application subject's camera update advances its heading
* slew, ground lift and anchor by: the time since the last update, at most
* its update interval plus 0.1 s. A subject updated every 500 ms then turns
* and eases at its configured rates, while a long stall (a hidden tab) still
* moves it no further than one late update would.
* its interval plus COCKPIT_SUBJECT_LATE_SEC. A subject updated every 500 ms,
* or a browser drawing 5 frames a second, then keeps up, while a long stall
* (a hidden tab) counts as one late update.
* @param {number} elapsedMs Time since the last camera update.
* @param {number} intervalMs The subject's update interval (0: every frame).
* @returns {number}
@@ -75,7 +78,7 @@ export function cockpitSubjectStepSec(elapsedMs, intervalMs) {
const intervalSec = Number.isFinite(intervalMs)
? Math.max(0, intervalMs) / 1000
: 0;
return Math.min(intervalSec + 0.1, elapsedSec);
return Math.min(intervalSec + COCKPIT_SUBJECT_LATE_SEC, elapsedSec);
}
/** Return whether a throttled cockpit presentation update is due. */
+145 -4
View File
@@ -31,6 +31,7 @@ import {
speedRulerStep,
speedRulerTicks,
} from './cockpitMath.js';
import { bandBesideMidpointObstacles } from './ui/panelRailGeometry.js';
test('cockpit presentation updates are throttled independently of camera frames', () => {
assert.equal(cockpitUiUpdateDue(1000, 0, 100), true);
@@ -73,12 +74,15 @@ test('an application subject steps by its interval, never by a long stall', () =
assert.equal(cockpitSubjectStepSec(16, 0), 0.016);
assert.equal(cockpitSubjectStepSec(500, 500), 0.5);
assert.equal(cockpitSubjectStepSec(520, 500), 0.52);
// A hidden tab's minutes count as one late update.
assert.equal(cockpitSubjectStepSec(60_000, 500), 0.6);
assert.equal(cockpitSubjectStepSec(60_000, 0), 0.1);
// Slow frames (5 a second) count in full...
assert.equal(cockpitSubjectStepSec(200, 50), 0.2);
assert.equal(cockpitSubjectStepSec(1000, 0), 1);
// ...and a hidden tab's minutes as one late update.
assert.equal(cockpitSubjectStepSec(60_000, 500), 1.5);
assert.equal(cockpitSubjectStepSec(60_000, 0), 1);
assert.equal(cockpitSubjectStepSec(-5, 500), 0);
assert.equal(cockpitSubjectStepSec(Number.NaN, 500), 0);
assert.equal(cockpitSubjectStepSec(1000, Number.NaN), 0.1);
assert.equal(cockpitSubjectStepSec(1000, Number.NaN), 1);
});
test('cockpit camera clearance never falls below the rendered ground floor', () => {
@@ -283,6 +287,143 @@ test('HUD rail layout constrains an oversized panel to the safe corridor', () =>
assert.equal(layout.constrained, true);
});
test('HUD rail layout keeps a short window clear of an obstacle across its midpoint', () => {
// 480px window: midpoint 240. Each obstacle is neither wholly above nor
// wholly below the midpoint, and must still limit the band.
const above = resolveHudRailLayout({
viewportHeight: 480,
panelHeight: 120,
laneLeft: 20,
laneRight: 340,
baseTop: 40,
baseBottom: 460,
gap: 10,
obstacles: [{ left: 0, right: 400, top: 200, bottom: 300 }],
});
// Room above: 200 - 10 - 40 = 150; below: 460 - 310 = 150. A tie keeps the
// band above the obstacle.
assert.equal(above.safeTop, 40);
assert.equal(above.safeBottom, 190);
assert(above.top + Math.min(120, above.maxHeight) <= 190);
const below = resolveHudRailLayout({
viewportHeight: 480,
panelHeight: 120,
laneLeft: 20,
laneRight: 340,
baseTop: 40,
baseBottom: 460,
gap: 10,
obstacles: [{ left: 0, right: 400, top: 120, bottom: 260 }],
});
// Room above: 70; below: 190. The band goes under the obstacle.
assert.equal(below.safeTop, 270);
assert.equal(below.safeBottom, 460);
assert(below.top >= 270);
});
test('HUD rail layout leaves the band as it is when an obstacle across the midpoint leaves no room', () => {
const layout = resolveHudRailLayout({
viewportHeight: 480,
panelHeight: 120,
laneLeft: 20,
laneRight: 340,
baseTop: 100,
baseBottom: 400,
gap: 10,
obstacles: [{ left: 0, right: 400, top: 80, bottom: 420 }],
});
assert.equal(layout.safeTop, 100);
assert.equal(layout.safeBottom, 400);
});
test('HUD rail layout reads several obstacles across the midpoint the same in any order', () => {
const a = { left: 0, right: 400, top: 100, bottom: 260 };
const b = { left: 0, right: 400, top: 200, bottom: 470 };
const layoutWith = (obstacles) =>
resolveHudRailLayout({
viewportHeight: 480,
panelHeight: 120,
laneLeft: 20,
laneRight: 340,
baseTop: 40,
baseBottom: 460,
gap: 10,
obstacles,
});
// Together they cover 100 to 470: the only room is above, 40 to 90.
for (const layout of [layoutWith([a, b]), layoutWith([b, a])]) {
assert.equal(layout.safeTop, 40);
assert.equal(layout.safeBottom, 90);
assert.equal(layout.maxHeight, 50);
}
});
test('HUD rail layout counts obstacles beside those across the midpoint', () => {
const band = (obstacles) => {
const layout = resolveHudRailLayout({
viewportHeight: 480,
panelHeight: 120,
laneLeft: 20,
laneRight: 340,
baseTop: 40,
baseBottom: 460,
gap: 10,
obstacles: obstacles.map(([top, bottom]) => ({
left: 0,
right: 400,
top,
bottom,
})),
});
return [layout.safeTop, layout.safeBottom];
};
// One inside the span below the midpoint: 150px below the span, 50 above.
assert.deepEqual(band([[100, 300], [250, 280]]), [310, 460]);
// One touching the midpoint from below: 190px below, 100 above.
assert.deepEqual(band([[150, 260], [240, 250]]), [270, 460]);
// One inside the span above the midpoint: 150px above, 50 below.
assert.deepEqual(band([[200, 400], [210, 230]]), [40, 190]);
// A lower obstacle past the span limits the room below it: 100px between
// them against 70 above, and with a taller one only 60, so above.
assert.deepEqual(band([[120, 260], [380, 420]]), [270, 370]);
assert.deepEqual(band([[120, 260], [340, 420]]), [40, 110]);
// Neighbours exactly two gaps away leave no room between: one block, 100
// to 400, and a tie (50px a side) goes above.
assert.deepEqual(band([[100, 180], [200, 300], [320, 400]]), [40, 90]);
// A neighbour exactly two gaps below joins it too: 150 to 300, 100px
// above against 150 below.
assert.deepEqual(band([[150, 250], [270, 300]]), [310, 460]);
// A side under 8% of the window (38.4px) is no room: 30px above, none
// below, so the band stays as it is.
assert.deepEqual(band([[80, 455]]), [40, 460]);
// Exactly the minimum is enough.
const exact = bandBesideMidpointObstacles({
midpoint: 240,
top: 40,
bottom: 460,
obstacles: [{ top: 90, bottom: 465 }],
gap: 10,
minimum: 40,
});
assert.deepEqual([exact?.top, exact?.bottom], [40, 80]);
});
test('HUD rail layout keeps a band beside a midpoint obstacle inside its own edges', () => {
const layout = resolveHudRailLayout({
viewportHeight: 480,
panelHeight: 80,
laneLeft: 20,
laneRight: 340,
baseTop: 350,
baseBottom: 460,
gap: 10,
obstacles: [{ left: 0, right: 400, top: 100, bottom: 260 }],
});
assert.equal(layout.safeTop, 350);
assert.equal(layout.safeBottom, 460);
});
test('HUD rail layout can anchor controls to the start of the safe corridor', () => {
const layout = resolveHudRailLayout({
viewportHeight: 1000,
+19 -6
View File
@@ -30,13 +30,26 @@ const TONE_RANK = Object.freeze([
const stronger = (a, b) =>
TONE_RANK.indexOf(b) > TONE_RANK.indexOf(a) ? b : a;
/** A label's width estimate (px): its longer line in small capitals. */
/** Full-width glyphs in the BMP: CJK, kana, Hangul, full-width forms. */
const WIDE_GLYPHS =
/[\u1100-\u115F\u2E80-\u303E\u3041-\u33FF\u3400-\u4DBF\u4E00-\u9FFF\uA960-\uA97F\uAC00-\uD7A3\uF900-\uFAFF\uFE30-\uFE4F\uFF00-\uFF60\uFFE0-\uFFE6]/g;
/**
* One line's width (px) in `.cockpit-progress-label` type (cockpitSubject.css:
* 10 px, 0.06 em spacing): 10.6 px a full-width glyph and 6.4 px each UTF-16
* unit of any other, so an astral glyph (an emoji, a CJK extension) counts as
* two and an emoji in the BMP (☕) as one, narrower than it is drawn. The
* detail line's `<small>` draws smaller, so these widths only overestimate it.
*/
function lineWidthPx(line) {
const text = String(line ?? '');
const wide = text.match(WIDE_GLYPHS)?.length ?? 0;
return wide * 10.6 + (text.length - wide) * 6.4;
}
/** A label's width estimate (px): its wider line and 8 px of padding. */
export function estimateProgressLabelPx(label) {
const longest = Math.max(
String(label?.text ?? '').length,
String(label?.detail ?? '').length,
);
return longest * 6.4 + 8;
return Math.max(lineWidthPx(label?.text), lineWidthPx(label?.detail)) + 8;
}
/**
+60 -1
View File
@@ -4,7 +4,10 @@
// the travelled part.
import test from 'node:test';
import assert from 'node:assert/strict';
import { cockpitProgressLayout } from './cockpitProgress.js';
import {
cockpitProgressLayout,
estimateProgressLabelPx,
} from './cockpitProgress.js';
const tick = (at, label = null, tone = 'normal') => ({ at, tone, label });
const label = (text, priority, align = 'center', detail = '') => ({
@@ -142,3 +145,59 @@ test('a long run of calls still lays out, every one a tick or part of one', () =
assert.ok(narrow.ticks.length < wide.ticks.length);
assert.equal(wide.ticks.length, 60);
});
test('a CJK stop name gets the width its full-width glyphs need', () => {
const text = '中央駅前広場東口'; // 8 full-width glyphs
// 10 px type, 0.06 em apart.
const needPx = text.length * (10 + 0.6);
const givenPx = estimateProgressLabelPx({ text, detail: '' });
assert.ok(
givenPx >= needPx,
`${givenPx} px given, about ${needPx} px needed`,
);
// As many Latin letters are narrower; half-width katakana are as narrow.
assert.ok(givenPx > estimateProgressLabelPx({ text: 'CENTRALS' }));
assert.equal(
estimateProgressLabelPx({ text: 'カタカナ' }),
estimateProgressLabelPx({ text: 'KANA' }),
);
});
test('astral glyphs (emoji outside the BMP, supplementary kana) in a progress label get at least 1 em each', () => {
// About 1 em in 10 px type, 0.06 em apart.
const emPx = 10 + 0.6;
for (const [text, needPx] of [
['🚉🚆🚇🚋', 4 * emPx],
['🚆'.repeat(8), 8 * emPx],
// Supplementary kana, outside the full-width ranges.
['𛀁𛀂', 2 * emPx],
// Mixed: four emoji, a space and two full-width glyphs.
['🚆🚇🚌🚕 乗換', 4 * emPx + 6.4 + 2 * emPx],
]) {
const givenPx = estimateProgressLabelPx({ text, detail: '' });
assert.ok(
givenPx >= needPx + 8,
`${text}: ${givenPx} px given, about ${needPx} px needed`,
);
}
});
test('a label is as wide as its wider line, its smaller detail line included', () => {
assert.ok(
estimateProgressLabelPx({ text: 'GATE', detail: '中央駅前' }) >
estimateProgressLabelPx({ text: 'GATE', detail: '' }),
'the wider detail line widens the label',
);
// As headless Chrome draws the detail's <small> (8.333 px JetBrains Mono,
// 0.6 px apart): 'WWWWMMMMWWWW' at 67.2 px, '中央駅前広場東口' at 72.9 px.
for (const [detail, needPx] of [
['W'.repeat(64), 64 * (67.2 / 12)],
['駅'.repeat(45), 45 * (72.9 / 8)],
]) {
const givenPx = estimateProgressLabelPx({ text: 'A', detail });
assert.ok(
givenPx >= needPx,
`${detail.length} × ${detail[0]}: ${givenPx} px given, ${needPx} px needed`,
);
}
});
+91 -62
View File
@@ -117,20 +117,27 @@ function lookOf(raw) {
});
}
/** Promises already given a catch: a pending one is read again on every use. */
const caughtWords = new WeakSet();
/**
* A provider's worded member `key` as it reads now, normalized: the value,
* or what the function it is returns when called on `provider` (so it can
* follow the page's language); null when it is malformed or a read throws.
* Reading the member, and reading what it gives, runs provider code too (a
* getter), so both are guarded as the call is.
* A worded member as `read()` gives it, normalized: called on `provider`
* when it is a function (so it can follow the page's language); null when it
* is malformed (a promise too) or provider code throws, its getter included
* (hence `read`).
*/
function wordedNow(provider, key, normalize) {
function worded(provider, read, normalize) {
try {
const value = provider[key];
return (
normalize(typeof value === 'function' ? value.call(provider) : value) ??
null
);
const value = read();
const words = typeof value === 'function' ? value.call(provider) : value;
if (typeof words?.then === 'function') {
if (!caughtWords.has(words)) {
caughtWords.add(words);
Promise.resolve(words).catch(() => {});
}
return null;
}
return normalize(words) ?? null;
} catch {
return null;
}
@@ -146,7 +153,7 @@ function providerName(provider, order) {
return `#${order}`;
}
/** Why `provider` cannot be kept, or null. */
/** Why `provider` cannot be kept, its worded members aside, or null. */
function refusal(provider, kinds) {
if (!isObject(provider)) return 'not an object';
if (typeof provider.kind !== 'string' || !KIND_PATTERN.test(provider.kind))
@@ -165,14 +172,25 @@ function refusal(provider, kinds) {
typeof provider.isEntryAllowed !== 'function'
)
return 'isEntryAllowed is not a function';
if (!wordedNow(provider, 'entryFace', faceOf)) return 'malformed entry face';
if (!wordedNow(provider, 'labels', labelsOf))
return 'labels need view, exit and exitText';
if (provider.look != null && !wordedNow(provider, 'look', lookOf))
return 'look needs an aheadLabel';
return null;
}
/**
* A provider's worded members, each read once, to seed its copy (so one that
* fails when read again cannot undo this check), or why one is malformed.
* @returns {{face: object, labels: object, look: ?object}|string}
*/
function checkedWords(provider) {
const face = worded(provider, () => provider.entryFace, faceOf);
if (!face) return 'malformed entry face';
const labels = worded(provider, () => provider.labels, labelsOf);
if (!labels) return 'labels need view, exit and exitText';
const lookValue = provider.look;
if (lookValue == null) return { face, labels, look: null };
const look = worded(provider, () => lookValue, lookOf);
return look ? { face, labels, look } : 'look needs an aheadLabel';
}
/**
* The application's subject providers, checked once and frozen, in the order
* entry asks them: ascending `priority`, ties in list order. Each has
@@ -191,7 +209,8 @@ function refusal(provider, kinds) {
* object: it is called on the provider again whenever they are shown and
* when the page's language changes, so its words can follow it
* (`./i18n`). A read that throws or is malformed keeps the last
* good one; `look` is on or off and `restPitchDeg` fixed as first read;
* good one; `look` is on or off and `restPitchDeg` fixed as read at
* registration;
* - `cameraIntervalMs` (optional): 0..1000, null for the Cockpit's default; 0
* updates the camera every rendered frame;
* - `headingSlewDps` (optional): how fast the view turns to a new heading,
@@ -224,7 +243,11 @@ export function cockpitSubjectProviders(
let copy = null;
try {
reason = refusal(provider, kinds);
if (!reason) copy = keptProvider(provider, order);
if (!reason) {
const words = checkedWords(provider);
if (typeof words === 'string') reason = words;
else copy = keptProvider(provider, order, words);
}
} catch {
reason = 'a member threw when read';
}
@@ -241,14 +264,12 @@ export function cockpitSubjectProviders(
return Object.freeze(kept);
}
/** The frozen copy the Cockpit keeps of a provider `refusal` passed. */
function keptProvider(provider, order) {
// Worded members are read again on each use (see above); the last good
// read stands in for one that is malformed or throws.
let face = wordedNow(provider, 'entryFace', faceOf);
let labels = wordedNow(provider, 'labels', labelsOf);
// On or off, and its rest pitch, as first read.
let look = wordedNow(provider, 'look', lookOf);
/**
* The frozen copy the Cockpit keeps of a provider that passed `refusal`,
* seeded with the worded members `checkedWords` read.
*/
function keptProvider(provider, order, words) {
let { face, labels, look } = words;
const restPitchDeg = look?.restPitchDeg ?? 0;
return Object.freeze({
kind: provider.kind,
@@ -256,16 +277,16 @@ function keptProvider(provider, order) {
priority: finite(provider.priority) ? provider.priority : 0,
order,
get entryFace() {
face = wordedNow(provider, 'entryFace', faceOf) ?? face;
face = worded(provider, () => provider.entryFace, faceOf) ?? face;
return face;
},
get labels() {
labels = wordedNow(provider, 'labels', labelsOf) ?? labels;
labels = worded(provider, () => provider.labels, labelsOf) ?? labels;
return labels;
},
get look() {
if (!look) return null;
const now = wordedNow(provider, 'look', lookOf);
const now = worded(provider, () => provider.look, lookOf);
if (now)
look = Object.freeze({ restPitchDeg, aheadLabel: now.aheadLabel });
return look;
@@ -335,11 +356,11 @@ function candidateOf(raw) {
* a position that is not finite, an eye with no valid `upM` (0..1000), or a
* read of it that throws (a getter runs provider code).
* A `heightM` that is not finite or lies outside
* COCKPIT_SUBJECT_MIN_HEIGHT_M..COCKPIT_SUBJECT_MAX_HEIGHT_M reads as null:
* the eye then stands on the shared floor, or where it last stood while that
* is cold. The anchor is `'inertial'` only when asked for and the frame
* gives a speed; otherwise it is `'exact'`. An id is compared with `heldId`
* trimmed, as `cockpitSubjectCandidate` trims it.
* COCKPIT_SUBJECT_MIN_HEIGHT_M..COCKPIT_SUBJECT_MAX_HEIGHT_M reads as null,
* for the eye to stand on the shared floor (ui/cockpitCamera.js). The anchor
* is `'inertial'` by default for a frame with a valid speed, and `'exact'`
* when asked for or with no speed. An id is compared with `heldId` trimmed,
* as `cockpitSubjectCandidate` trims it.
* @param {unknown} raw What `read()` returned.
* @param {string} heldId The subject the view holds.
* @returns {object|null} `{id, name, latitude, longitude, heightM, headingDeg,
@@ -356,49 +377,57 @@ export function cockpitSubjectFrame(raw, heldId) {
}
function frameOf(raw, heldId) {
if (!isObject(raw) || typeof raw.id !== 'string' || raw.id.trim() !== heldId)
return null;
const latitude = raw.latitude;
const longitude = raw.longitude;
if (!isObject(raw)) return null;
// Each field read once: a getter on the frame runs provider code.
const {
id,
name,
latitude,
longitude,
heightM,
headingDeg: rawHeadingDeg,
courseDeg,
speedMps: rawSpeedMps,
stale,
groundClamp,
anchor,
eye: rawEye,
} = raw;
if (typeof id !== 'string' || id.trim() !== heldId) return null;
if (!finite(latitude) || !finite(longitude) || Math.abs(latitude) > 90)
return null;
const eye = isObject(raw.eye) ? raw.eye : null;
if (!eye || !finite(eye.upM) || eye.upM < 0 || eye.upM > 1000) return null;
if (!isObject(rawEye)) return null;
const { upM, forwardM, pitchDeg, minClearanceM } = rawEye;
if (!finite(upM) || upM < 0 || upM > 1000) return null;
const heading = (value) =>
finite(value) ? ((value % 360) + 360) % 360 : null;
const headingDeg = heading(raw.headingDeg);
const speedMps =
finite(raw.speedMps) && raw.speedMps >= 0 ? raw.speedMps : null;
const headingDeg = heading(rawHeadingDeg);
const speedMps = finite(rawSpeedMps) && rawSpeedMps >= 0 ? rawSpeedMps : null;
return {
id: heldId,
name: cockpitSubjectText(raw.name, 64) || cockpitSubjectText(heldId, 64),
name: cockpitSubjectText(name, 64) || cockpitSubjectText(heldId, 64),
latitude,
longitude: ((((longitude + 180) % 360) + 360) % 360) - 180,
heightM:
finite(raw.heightM) &&
raw.heightM >= COCKPIT_SUBJECT_MIN_HEIGHT_M &&
raw.heightM <= COCKPIT_SUBJECT_MAX_HEIGHT_M
? raw.heightM
finite(heightM) &&
heightM >= COCKPIT_SUBJECT_MIN_HEIGHT_M &&
heightM <= COCKPIT_SUBJECT_MAX_HEIGHT_M
? heightM
: null,
headingDeg,
courseDeg: heading(raw.courseDeg) ?? headingDeg,
courseDeg: heading(courseDeg) ?? headingDeg,
speedMps,
stale: raw.stale === true,
groundClamp: raw.groundClamp !== false,
stale: stale === true,
groundClamp: groundClamp !== false,
// An inertial anchor runs on at the frame's speed; with none it would
// close on a moving subject at the correction's floor and fall behind.
anchor: raw.anchor === 'exact' || speedMps === null ? 'exact' : 'inertial',
anchor: anchor === 'exact' || speedMps === null ? 'exact' : 'inertial',
eye: {
upM: eye.upM,
forwardM:
finite(eye.forwardM) && Math.abs(eye.forwardM) <= 500
? eye.forwardM
: 0,
pitchDeg: finite(eye.pitchDeg) ? clamp(eye.pitchDeg, -90, 90) : 0,
upM,
forwardM: finite(forwardM) && Math.abs(forwardM) <= 500 ? forwardM : 0,
pitchDeg: finite(pitchDeg) ? clamp(pitchDeg, -90, 90) : 0,
minClearanceM:
finite(eye.minClearanceM) && eye.minClearanceM >= 0
? eye.minClearanceM
: 0,
finite(minClearanceM) && minClearanceM >= 0 ? minClearanceM : 0,
},
};
}
+42 -8
View File
@@ -642,11 +642,15 @@ test('a provider whose getter throws is left out with one warning; the next is k
]);
});
test('a worded getter that starts throwing keeps the last good words', () => {
let failing = false;
const words = (value) => () => {
if (failing) throw new Error('translations unavailable');
return value;
test('a worded getter that throws from its second read keeps the last good words', () => {
// Registration reads each once: the second read is the first use.
const once = (value) => {
let read = false;
return () => {
if (read) throw new Error('translations unavailable');
read = true;
return value;
};
};
const definition = provider();
for (const [key, value] of Object.entries({
@@ -654,22 +658,52 @@ test('a worded getter that starts throwing keeps the last good words', () => {
entryFace: { icon: 'commute', label: 'RIDE' },
look: { restPitchDeg: 10, aheadLabel: 'Look ahead' },
}))
Object.defineProperty(definition, key, { get: words(value) });
Object.defineProperty(definition, key, { get: once(value) });
const { kept, warnings } = keep([definition]);
assert.deepEqual(warnings, []);
const [ride] = kept;
failing = true;
assert.equal(ride.labels.view, 'Ride view');
assert.equal(ride.entryFace.label, 'RIDE');
assert.deepEqual(ride.look, { restPitchDeg: 10, aheadLabel: 'Look ahead' });
// So does a worded object whose own member throws when read.
failing = false;
Object.defineProperty(definition, 'labels', {
get: () => throwingGetter({ view: 'v', exit: 'e', exitText: 'x' }, 'view'),
});
assert.equal(ride.labels.view, 'Ride view');
});
test('a worded member that returns a rejected promise keeps the last good words, the rejection caught', async () => {
const definition = provider();
const words = definition.labels;
let reads = 0;
definition.labels = () => {
reads += 1;
return reads === 1 ? words : Promise.reject(new Error('late words'));
};
const { kept, warnings } = keep([definition]);
assert.deepEqual(warnings, []);
assert.equal(kept[0].labels.view, words.view);
// An unhandled rejection would fail this test once it surfaces.
await new Promise((resolve) => setTimeout(resolve, 10));
});
test('a frame field read through a getter is read once', () => {
const frame = { id: 'a1', latitude: 1, longitude: 2, eye: { upM: 3 } };
const once = (value) => {
let read = false;
return () => {
const answer = read ? undefined : value;
read = true;
return answer;
};
};
Object.defineProperty(frame, 'heightM', { get: once(420) });
Object.defineProperty(frame, 'speedMps', { get: once(12) });
const normalized = cockpitSubjectFrame(frame, 'a1');
assert.equal(normalized.heightM, 420);
assert.equal(normalized.speedMps, 12);
});
test('a candidate, frame or HUD view whose getter throws reads as null', () => {
assert.equal(
cockpitSubjectCandidate(throwingGetter({ name: 'Example' }, 'id')),
+1 -44
View File
@@ -17,11 +17,6 @@
* @param {number} [input.signalGap] Clearance above the briefing card.
* @param {number} [input.minTopFloor] Absolute ceiling for the strip, in px.
* @param {number} [input.minTopRatio] Viewport-relative ceiling, 0..1.
* @param {boolean} [input.signalCollapsed] Whether the briefing card is collapsed.
* @param {boolean} [input.utilityExpanded] Whether Display or Radio is expanded.
* @param {number} [input.bottomInset] Reserved viewport space below an expanded panel.
* @param {number} [input.signalHeight] Collapsed briefing header reserved below the utility.
* @param {boolean} [input.reserveViewportLane] Theme relocates the briefing below the expanded utility.
* @returns {{ top: number, maxHeight: number }}
*/
export function resolveCockpitUtilityAnchor({
@@ -34,29 +29,13 @@ export function resolveCockpitUtilityAnchor({
signalGap = 8,
minTopFloor = 96,
minTopRatio = 0.12,
signalCollapsed = false,
utilityExpanded = false,
bottomInset = 80,
signalHeight = 0,
reserveViewportLane = false,
}) {
const viewport = Math.max(0, Number(viewportHeight) || 0);
const minTop = Math.max(minTopFloor, viewport * minTopRatio);
const anchoredTop = Math.max(minTop, (Number(recBottom) || 0) + recGap);
const strip = Math.max(0, Number(stripHeight) || 0);
const signal = Number(signalTop);
const expandedLaneBottom = Math.max(
0,
viewport -
Math.max(0, Number(bottomInset) || 0) -
Math.max(0, Number(signalHeight) || 0),
);
const lowerBound =
reserveViewportLane && signalCollapsed && utilityExpanded
? expandedLaneBottom
: Number.isFinite(signal)
? signal
: viewport;
const lowerBound = Number.isFinite(signal) ? signal : viewport;
const clearedTop = lowerBound - signalGap - strip;
const top = Math.max(minTop, Math.min(anchoredTop, clearedTop));
const floor = Math.max(0, Number(collapsedHeight) || 0) || 50;
@@ -100,25 +79,3 @@ export function resolveCockpitUtilityLayout({
),
};
}
/** Shared Cyber panel slot, with footer controls above the lower frame (83vh). */
export function resolveCyberCockpitPanelLane({
viewportHeight,
top,
launcherHeight = 60,
signalHeight = 44,
contactHeight = 64,
}) {
const gap = 8;
const footerHeight = Math.max(
contactHeight + gap,
launcherHeight + signalHeight + gap * 2,
);
const bottom = viewportHeight * 0.82;
const panelHeight = Math.max(120, bottom - top - footerHeight);
return {
panelHeight,
utilityHeight: panelHeight + gap + launcherHeight,
signalTop: top + panelHeight + launcherHeight + gap * 2,
};
}
+1 -71
View File
@@ -4,58 +4,11 @@ import assert from 'node:assert/strict';
import {
resolveCockpitUtilityAnchor,
resolveCockpitUtilityLayout,
resolveCyberCockpitPanelLane,
} from './cockpitUtilityLayout.js';
// 1512x790, the height the strip used to collide with the briefing card at.
const desktop = { viewportHeight: 790, stripHeight: 107, collapsedHeight: 50 };
test('Cyber shared panel slot reserves both footer lanes above the decorative frame', () => {
for (const viewportHeight of [600, 673, 713, 986, 1376]) {
for (const signalHeight of [44, 76]) {
for (const contactHeight of [44, 84, 120]) {
const top = Math.max(164, Math.min(204, viewportHeight * 0.19));
const lane = resolveCyberCockpitPanelLane({ viewportHeight, top, signalHeight, contactHeight });
assert.ok(lane.panelHeight >= 120);
assert.ok(top + lane.panelHeight + 8 + contactHeight <= viewportHeight * 0.82 + .01);
assert.ok(lane.signalTop + signalHeight <= viewportHeight * 0.82 + .01);
assert.equal(lane.signalTop, top + lane.utilityHeight + 8);
}
}
}
});
test('Cyber keeps the Data Layers top while reserving briefing clearance', () => {
for (const viewportHeight of [673, 713, 986, 1376]) {
const leftTop = Math.max(164, Math.min(204, viewportHeight * 0.19));
const collapsed = resolveCockpitUtilityAnchor({
viewportHeight, stripHeight: 128, collapsedHeight: 60, recBottom: 0,
signalTop: leftTop + 128 + 28, minTopFloor: leftTop, minTopRatio: 0,
});
assert.equal(collapsed.top, leftTop);
assert.ok(collapsed.maxHeight >= 128);
const expanded = resolveCockpitUtilityAnchor({
viewportHeight, stripHeight: 700, collapsedHeight: 60, recBottom: 0,
signalTop: 255, minTopFloor: leftTop, minTopRatio: 0,
signalCollapsed: true, utilityExpanded: true, reserveViewportLane: true, signalHeight: 44,
});
assert.equal(expanded.top, leftTop);
assert.equal(expanded.top + expanded.maxHeight + 8 + 44 + 80, viewportHeight);
}
});
test('expanded utilities reserve the visible collapsed briefing header at every desktop height', () => {
for (const viewportHeight of [640, 720, 987, 1376]) {
for (const signalHeight of [48, 76, 100]) {
const { top, maxHeight } = resolveCockpitUtilityAnchor({
...desktop, viewportHeight, recBottom: 0, signalTop: 255,
signalCollapsed: true, utilityExpanded: true, signalHeight, reserveViewportLane: true,
});
assert.equal(top + maxHeight + 8, viewportHeight - 80 - signalHeight);
}
}
});
test('the strip hangs 12px under the REC readout when the briefing card leaves room', () => {
const { top } = resolveCockpitUtilityAnchor({ ...desktop, recBottom: 148.1, signalTop: 420 });
assert.equal(Number(top.toFixed(1)), 160.1);
@@ -101,34 +54,11 @@ test('a missing REC readout leaves the strip on the viewport ceiling', () => {
assert.equal(top, 96);
});
test('an expanded utility claims the vertical lane released by a collapsed briefing', () => {
const { top, maxHeight } = resolveCockpitUtilityAnchor({
...desktop,
recBottom: 148.1,
signalTop: 265.4,
signalCollapsed: true,
utilityExpanded: true,
reserveViewportLane: true,
});
assert.equal(Number(top.toFixed(1)), 160.1);
assert.equal(Number(maxHeight.toFixed(1)), 541.9);
});
test('non-relocating themes preserve the visible briefing boundary even when collapsed', () => {
test('the visible briefing card bounds the utility strip, collapsed or not', () => {
const { top, maxHeight } = resolveCockpitUtilityAnchor({
...desktop, recBottom: 148.1, signalTop: 265.4,
signalCollapsed: true, utilityExpanded: true,
});
assert.equal(Number((top + maxHeight).toFixed(1)), 257.4);
});
test('a collapsed briefing still bounds the utility strip until a panel expands', () => {
const { maxHeight } = resolveCockpitUtilityAnchor({
...desktop,
recBottom: 148.1,
signalTop: 265.4,
signalCollapsed: true,
});
assert.equal(Number(maxHeight.toFixed(1)), 107);
});
+19 -106
View File
@@ -1,5 +1,3 @@
import { msg } from './i18n/marker.js';
const CONTEXT_DEPENDENCIES = Object.freeze({
flights: new Set([
'military-awareness',
@@ -8,15 +6,18 @@ const CONTEXT_DEPENDENCIES = Object.freeze({
'ais-live-vessels',
'military-installations',
]),
'space-missions': new Set(['rocket-launches', 'satellites']),
});
const CONTEXT_COMPANIONS = new Set(['radio']);
/** The Space Missions refusal, with the blocked layer's name as {layer}. */
export const SPACE_MISSIONS_LAYER_BLOCK_REASON = msg(
'Space Missions isolates replay data. Exit the mode to enable {layer}.',
);
const [BLOCK_REASON_PREFIX, BLOCK_REASON_SUFFIX] =
SPACE_MISSIONS_LAYER_BLOCK_REASON.split('{layer}');
/**
* Layers Context never touches: Space Missions and the Satellites layer it
* depends on. Contacts neither switches them off on entry nor restores them
* on exit, so they run beside it in either order and keep their own state
* (the mission controller owns the Satellites dependency).
*/
export const CONTEXT_INDEPENDENT_LAYER_IDS = Object.freeze([
'rocket-launches',
'satellites',
]);
/** Return whether an origin represents a direct user choice on this route. */
export function isExplicitUserIntentOrigin(origin, layerId = null) {
return origin === 'user' || origin === 'voice';
@@ -27,7 +28,8 @@ export function recordContextRestoreExplicitChange({ restoreState, change }) {
if (
!restoreState?.enabledLayerIds ||
change?.type !== 'visibility' ||
!isExplicitUserIntentOrigin(change.origin, change.layerId)
!isExplicitUserIntentOrigin(change.origin, change.layerId) ||
CONTEXT_INDEPENDENT_LAYER_IDS.includes(change.layerId)
)
return false;
if (!restoreState.explicitLayerStates)
@@ -121,10 +123,7 @@ export async function settleUserFacingContextAction({
* one into `userAdded` makes exit restoration re-enable the mode layer the
* user just turned off.
*/
export const CONTEXT_ENTRY_LAYER_IDS = Object.freeze([
'military-awareness',
'rocket-launches',
]);
export const CONTEXT_ENTRY_LAYER_IDS = Object.freeze(['military-awareness']);
/**
* Leave a Context transaction: publish the settled coordination flag, then
@@ -193,7 +192,8 @@ export function shouldExitContextForLayerChange({
change?.type !== 'visibility' ||
!isExplicitUserIntentOrigin(change.origin, change.layerId) ||
change.layerId === 'military-awareness' ||
CONTEXT_COMPANIONS.has(change.layerId)
CONTEXT_COMPANIONS.has(change.layerId) ||
CONTEXT_INDEPENDENT_LAYER_IDS.includes(change.layerId)
) {
return false;
}
@@ -215,6 +215,7 @@ export function contextAllowedLayerIds(contextMode) {
return new Set([
...(CONTEXT_DEPENDENCIES[contextMode] || ['military-awareness']),
...CONTEXT_COMPANIONS,
...CONTEXT_INDEPENDENT_LAYER_IDS,
]);
}
@@ -235,21 +236,6 @@ export function shouldCaptureContextSession(change) {
);
}
/**
* Return whether one explicit mission intent superseded an in-flight Clear All
* reservation and therefore needs deferred Context adoption.
*/
export function shouldDeferContextEntryDuringClear({ change, clearInFlight }) {
return Boolean(
clearInFlight &&
change?.type === 'visibility-requested' &&
change.layerId === 'rocket-launches' &&
change.enabled === true &&
isExplicitUserIntentOrigin(change.origin, change.layerId) &&
Number.isInteger(change.intentEpoch),
);
}
/**
* Bookkeep a user-owned layer change against the active Context session so
* exit restoration can honor layers the user added mid-session. Two rules
@@ -273,7 +259,8 @@ export function recordContextSessionUserChange({
if (
!snapshot?.userAdded ||
change?.type !== 'visibility' ||
!isExplicitUserIntentOrigin(change.origin, change.layerId)
!isExplicitUserIntentOrigin(change.origin, change.layerId) ||
CONTEXT_INDEPENDENT_LAYER_IDS.includes(change.layerId)
) {
return false;
}
@@ -319,83 +306,10 @@ export function contextSnapshotLayerIds(
) {
const snapshot = new Set(restoringLayerIds || currentEnabledLayerIds || []);
for (const layerId of excludeLayerIds || []) snapshot.delete(layerId);
for (const layerId of CONTEXT_INDEPENDENT_LAYER_IDS) snapshot.delete(layerId);
return snapshot;
}
/**
* Block layers that would mix unrelated live/current data into Space Missions.
* The manager calls this before lifecycle work so a refused layer never starts.
* @param {object} input Current mode and requested visibility transition.
* @param {string|null} input.contextMode Active Context mode.
* @param {object|null} input.change Requested visibility transition.
* @param {string|null} [input.layerName] User-facing layer name.
* @returns {string|null} Honest user-facing refusal reason, or null when allowed.
*/
export function contextLayerEnableBlockReason({
contextMode,
change,
layerName = null,
}) {
if (
contextMode !== 'space-missions' ||
change?.enabled !== true ||
contextAllowedLayerIds('space-missions').has(change.layerId)
) {
return null;
}
const label = String(layerName || change.layerId || 'that layer');
return SPACE_MISSIONS_LAYER_BLOCK_REASON.replace('{layer}', label);
}
/**
* The layer name from a Space Missions refusal, so the UI can rebuild the
* sentence in its language.
* @param {string} reason
* @returns {{layer: string}|null} The blocked layer's name, or null when the
* reason is not a Space Missions refusal.
*/
export function parseContextLayerBlockReason(reason) {
if (
typeof reason !== 'string' ||
!reason.startsWith(BLOCK_REASON_PREFIX) ||
!reason.endsWith(BLOCK_REASON_SUFFIX) ||
reason.length <= BLOCK_REASON_PREFIX.length + BLOCK_REASON_SUFFIX.length
)
return null;
return {
layer: reason.slice(
BLOCK_REASON_PREFIX.length,
reason.length - BLOCK_REASON_SUFFIX.length,
),
};
}
/**
* Resolve who owns a cancelled direct Space Missions entry. A newer ON keeps
* the entry shell reserved for its replacement transaction; every other
* cancellation must roll back the isolated pre-entry session.
*
* @param {object} input Cancellation and current manager intent state.
* @param {object|null} input.change Manager visibility notification.
* @returns {'ignore'|'replacement'|'restore'} Cancellation disposition.
*/
export function spaceMissionEntryCancellationDisposition({ change }) {
if (
change?.type !== 'visibility-cancelled' ||
change.layerId !== 'rocket-launches' ||
change.enabled !== true
)
return 'ignore';
if (
change.cancellationReason === 'superseded' &&
Number.isInteger(change.successorIntentEpoch) &&
change.successorIntentEpoch > change.intentEpoch &&
change.successorEnabled === true
)
return 'replacement';
return 'restore';
}
/**
* Merge the pre-entry layer snapshot with layers the user enabled during the
* Context session so both survive restoration.
@@ -510,7 +424,6 @@ export function subjectEntryAllowed({
*/
export const CONTEXT_MODE_VOICE_NAMES = Object.freeze({
flights: 'contacts',
'space-missions': 'space-missions',
});
/**
+63 -111
View File
@@ -5,7 +5,6 @@ import {
orbitEntryAllowed,
cockpitEntryAllowed,
contextAllowedLayerIds,
contextLayerEnableBlockReason,
contextRestoreLayerIds,
isExplicitUserIntentOrigin,
mergeContextTransitionErrors,
@@ -17,9 +16,7 @@ import {
settleContextIntentReplay,
settleUserFacingContextAction,
shouldCaptureContextSession,
shouldDeferContextEntryDuringClear,
shouldExitContextForLayerChange,
spaceMissionEntryCancellationDisposition,
} from './contextModePolicy.js';
test('Context transition errors preserve primary identity and aggregate failed layers', () => {
@@ -119,11 +116,6 @@ test('user-enabled layers are additive and do not exit Context', () => {
globalContextEnabled: true,
change: userEnable('earthquakes'),
}), false);
assert.equal(shouldExitContextForLayerChange({
contextMode: 'space-missions',
globalContextEnabled: false,
change: userEnable('traffic'),
}), false);
assert.equal(shouldExitContextForLayerChange({
contextMode: null,
globalContextEnabled: true,
@@ -133,48 +125,16 @@ test('user-enabled layers are additive and do not exit Context', () => {
test('programmatic Context dependencies and direct mode setup remain allowed', () => {
assert.equal(shouldExitContextForLayerChange({
contextMode: 'space-missions',
contextMode: 'flights',
globalContextEnabled: true,
change: { ...userEnable('satellites'), origin: 'programmatic' },
change: { ...userEnable('military'), enabled: false, origin: 'programmatic' },
}), false);
});
test('Space Missions cancellation retains only a newer authoritative ON entry', () => {
const cancelledEntry = {
type: 'visibility-cancelled',
layerId: 'rocket-launches',
enabled: true,
intentEpoch: 8,
cancellationReason: 'superseded',
successorIntentEpoch: 9,
successorEnabled: true,
successorOrigin: 'programmatic',
};
assert.equal(spaceMissionEntryCancellationDisposition({
change: cancelledEntry,
}), 'replacement');
assert.equal(spaceMissionEntryCancellationDisposition({
change: { ...cancelledEntry, successorEnabled: false },
}), 'restore', 'a newer OFF releases the entry shell');
assert.equal(spaceMissionEntryCancellationDisposition({
change: {
...cancelledEntry,
cancellationReason: 'caller-abort',
successorIntentEpoch: undefined,
successorEnabled: undefined,
},
}), 'restore', 'caller abort at the same epoch restores the isolated session');
assert.equal(spaceMissionEntryCancellationDisposition({
change: { ...cancelledEntry, enabled: false },
currentIntentEpoch: 9,
effectivelyEnabled: true,
}), 'ignore');
});
test('only explicit user-owned shell enables capture a Context restoration snapshot', () => {
const userMissionEnable = {
type: 'visibility-requested',
layerId: 'rocket-launches',
layerId: 'military-awareness',
enabled: true,
origin: 'user',
};
@@ -186,40 +146,25 @@ test('only explicit user-owned shell enables capture a Context restoration snaps
assert.equal(shouldCaptureContextSession({ ...userMissionEnable, origin: 'context-restore' }), false);
assert.equal(shouldCaptureContextSession({ ...userMissionEnable, enabled: false }), false);
assert.equal(shouldCaptureContextSession({ ...userMissionEnable, layerId: 'satellites' }), false);
assert.equal(
shouldCaptureContextSession({ ...userMissionEnable, layerId: 'rocket-launches' }),
false,
'Space Missions is an ordinary layer, not a Context entry',
);
});
test('voice dependency OFF exits Space Missions like the equivalent UI action', () => {
test('voice dependency OFF exits Contacts like the equivalent UI action', () => {
assert.equal(shouldExitContextForLayerChange({
contextMode: 'space-missions',
contextMode: 'flights',
globalContextEnabled: false,
change: { type: 'visibility', layerId: 'satellites', enabled: false, origin: 'voice' },
change: { type: 'visibility', layerId: 'flights', enabled: false, origin: 'voice' },
}), true);
});
test('only a newer explicit mission request is deferred during Clear All', () => {
const change = {
type: 'visibility-requested',
layerId: 'rocket-launches',
enabled: true,
origin: 'voice',
intentEpoch: 12,
};
assert.equal(shouldDeferContextEntryDuringClear({ change, clearInFlight: true }), true);
assert.equal(shouldDeferContextEntryDuringClear({ change, clearInFlight: false }), false);
assert.equal(shouldDeferContextEntryDuringClear({
change: { ...change, origin: 'programmatic' },
clearInFlight: true,
}), false);
assert.equal(shouldDeferContextEntryDuringClear({
change: { ...change, enabled: false },
clearInFlight: true,
}), false);
});
test('a rapid re-entry snapshots the settled restore target, not partial manager state', () => {
assert.deepEqual(
[...contextSnapshotLayerIds(
new Set(['rocket-launches', 'earthquakes']),
new Set(['cctv', 'earthquakes']),
new Set(['flights', 'traffic']),
)],
['flights', 'traffic'],
@@ -230,31 +175,15 @@ test('a rapid re-entry snapshots the settled restore target, not partial manager
);
assert.deepEqual(
[...contextSnapshotLayerIds(
new Set(['rocket-launches', 'satellites']),
new Set(['military-awareness', 'cctv']),
null,
['rocket-launches'],
['military-awareness'],
)],
['satellites'],
['cctv'],
'the synchronous entry intent is not part of the pre-entry snapshot',
);
});
test('Space Missions blocks unrelated layer enables before replay data can mix', () => {
const change = { layerId: 'flights', enabled: true, origin: 'user' };
assert.match(
contextLayerEnableBlockReason({ contextMode: 'space-missions', change, layerName: 'Live Flights' }),
/Exit the mode to enable Live Flights/,
);
assert.equal(contextLayerEnableBlockReason({
contextMode: 'space-missions',
change: { ...change, layerId: 'satellites' },
}), null);
assert.equal(contextLayerEnableBlockReason({
contextMode: 'flights',
change,
}), null, 'live cockpit keeps additive user layers');
});
test('the Global Context shell and layers selected while Context is off remain allowed', () => {
assert.equal(shouldExitContextForLayerChange({
contextMode: null,
@@ -275,14 +204,38 @@ test('manually disabling a mode dependency exits that Context bundle', () => {
change: { ...userEnable('military'), enabled: false },
}), true);
assert.equal(shouldExitContextForLayerChange({
contextMode: 'space-missions',
contextMode: 'flights',
globalContextEnabled: false,
change: { ...userEnable('satellites'), enabled: false },
}), true);
}), false, 'Satellites is not a Contacts dependency');
});
test('Context never isolates, snapshots, restores or bookkeeps Space Missions and Satellites', () => {
for (const layerId of ['rocket-launches', 'satellites']) {
assert.equal(contextAllowedLayerIds('flights').has(layerId), true);
const snapshot = { userAdded: new Set(), userRemoved: new Set() };
for (const enabled of [true, false]) {
assert.equal(recordContextSessionUserChange({
snapshot,
change: { type: 'visibility', origin: 'user', layerId, enabled },
effectiveContextMode: 'flights',
}), false);
const restoreState = { enabledLayerIds: new Set() };
assert.equal(recordContextRestoreExplicitChange({
restoreState,
change: { type: 'visibility', origin: 'user', layerId, enabled },
}), false);
}
assert.equal(snapshot.userAdded.size + snapshot.userRemoved.size, 0);
}
assert.deepEqual(
[...contextSnapshotLayerIds(new Set(['rocket-launches', 'satellites', 'cctv']))],
['cctv'],
);
});
test('Radio remains an independent companion across Context transitions', () => {
for (const contextMode of ['flights', 'space-missions']) {
for (const contextMode of ['flights', null]) {
for (const enabled of [true, false]) {
assert.equal(shouldExitContextForLayerChange({
contextMode,
@@ -292,21 +245,17 @@ test('Radio remains an independent companion across Context transitions', () =>
}
assert.equal(contextAllowedLayerIds(contextMode).has('radio'), true);
}
assert.equal(contextLayerEnableBlockReason({
contextMode: 'space-missions',
change: { type: 'visibility', origin: 'user', layerId: 'radio', enabled: true },
layerName: 'Radio',
}), null);
});
test('each Context mode exposes only its shell and dependencies', () => {
assert.deepEqual(
[...contextAllowedLayerIds(null)],
['military-awareness', 'radio'],
['military-awareness', 'radio', 'rocket-launches', 'satellites'],
);
assert.deepEqual(
[...contextAllowedLayerIds('space-missions')],
['rocket-launches', 'satellites', 'radio'],
['military-awareness', 'radio', 'rocket-launches', 'satellites'],
'Space Missions is not a Context mode',
);
});
@@ -332,7 +281,7 @@ test('Context restoration honors an explicit companion disable', () => {
});
test('the latest explicit Radio state wins across a Context session', () => {
for (const effectiveContextMode of [null, 'flights', 'space-missions']) {
for (const effectiveContextMode of [null, 'flights']) {
for (const origin of ['user', 'voice']) {
const snapshot = { userAdded: new Set(), userRemoved: new Set() };
const record = (enabled) => recordContextSessionUserChange({
@@ -368,7 +317,7 @@ test('only direct UI and voice origins count as explicit Context intent', () =>
assert.equal(recordContextSessionUserChange({
snapshot,
change: { type: 'visibility', origin, layerId: 'radio', enabled: true },
effectiveContextMode: 'space-missions',
effectiveContextMode: 'flights',
}), false);
assert.equal(snapshot.userAdded.size, 0);
}
@@ -526,16 +475,8 @@ test('the teardown guard re-publishes on the way out, so a mid-flight exit is no
test('the session-starting entry layer is never bookkept as user-added (chip ON→OFF restores exactly)', () => {
const snapshot = { enabledLayerIds: new Set(['flights', 'ais-live-vessels']), userAdded: new Set() };
// The exact left-panel regression: the rockets enable event lands while the
// mode is still being entered (or even null); it must not survive its own exit.
for (const effectiveContextMode of ['space-missions', null]) {
recordContextSessionUserChange({
snapshot,
change: { type: 'visibility', layerId: 'rocket-launches', enabled: true, origin: 'user' },
effectiveContextMode,
});
assert.equal(snapshot.userAdded.has('rocket-launches'), false);
}
// The entry layer's enable event lands while the mode is still being
// entered; it must not survive its own exit.
recordContextSessionUserChange({
snapshot,
change: { type: 'visibility', layerId: 'military-awareness', enabled: true, origin: 'user' },
@@ -559,10 +500,21 @@ test('mid-session user additions are recorded, removed on disable, and judged ag
// A dependency of the mode being ENTERED is not a user addition.
recordContextSessionUserChange({
snapshot,
change: { type: 'visibility', layerId: 'satellites', enabled: true, origin: 'user' },
effectiveContextMode: 'space-missions',
change: { type: 'visibility', layerId: 'military', enabled: true, origin: 'user' },
effectiveContextMode: 'flights',
});
assert.equal(snapshot.userAdded.has('satellites'), false);
assert.equal(snapshot.userAdded.has('military'), false);
// Space Missions is not Context's: it is never bookkept.
recordContextSessionUserChange({
snapshot,
change: { type: 'visibility', layerId: 'rocket-launches', enabled: true, origin: 'user' },
effectiveContextMode: 'flights',
});
assert.equal(
snapshot.userAdded.has('rocket-launches'),
false,
'Space Missions is not Context state',
);
// Disabling a recorded addition removes it before any exit restore reads it.
recordContextSessionUserChange({
snapshot,
+38 -36
View File
@@ -13,10 +13,7 @@ const radioControlsSource = readRadioSource(new URL('./ui/radioControls.js', imp
// - session bookkeeping ran AFTER the exit early-return, so the compensating
// userAdded.delete never ran on the left-panel chip exit and restoration
// resurrected the mission layer the user just disabled;
// - the effective mode was read AFTER the entering flag was cleared, so the
// entry layer's own enable event was judged against a null mode;
// - a failed Space Missions START from the chip route cleared siblings with
// no rollback;
// - a failed direct Contacts START cleared siblings with no rollback;
// - the right-rail entry ignored the activation result entirely.
import { test } from 'node:test';
import assert from 'node:assert/strict';
@@ -33,25 +30,20 @@ test('context handler: session bookkeeping runs before the exit early-return', (
assert.ok(record < exit, 'bookkeeping must precede the exit check');
});
test('context handler: effective mode is read before the entering flag is cleared', () => {
const effective = handler.indexOf('this._contextModeEntering || this._contextMode');
const clear = handler.indexOf('this._contextModeEntering = null');
assert.ok(effective > 0, 'effective-mode read present');
assert.ok(clear > 0, 'entering-flag clear present');
assert.ok(effective < clear, 'effective mode must be captured first');
test('Space Missions is an ordinary layer the Context handler never enters', () => {
assert.doesNotMatch(handler, /'space-missions'/);
assert.doesNotMatch(handler, /_contextModeEntering = /);
const attach = connectContextManager.toString();
assert.doesNotMatch(attach, /rocket-launches|space-missions/);
});
test('cancelled Space Missions entry resolves ownership before settled bookkeeping', () => {
test('a cancelled visibility request returns before settled bookkeeping', () => {
const cancelled = handler.indexOf("change?.type === 'visibility-cancelled'");
const bookkeeping = handler.indexOf('recordContextSessionUserChange(');
assert.ok(cancelled > 0, 'cancellation branch present');
assert.ok(cancelled < bookkeeping, 'cancellation returns before settled session bookkeeping');
const branch = handler.slice(cancelled, handler.indexOf("change?.type === 'visibility-blocked'"));
assert.match(branch, /spaceMissionEntryCancellationDisposition\(\{/);
assert.match(branch, /cancellationDisposition === 'replacement'[\s\S]*?_contextModeEntering = 'space-missions'[\s\S]*?entryIntent\.intentEpoch === change\.intentEpoch[\s\S]*?_contextModeReplacementIntent = \{[\s\S]*?intentEpoch: change\.successorIntentEpoch/);
assert.match(branch, /cancellationDisposition === 'restore'[\s\S]*?_contextModeEntering = null/);
assert.match(branch, /_restoreContextSessionAfterLayerSettles\(/);
assert.match(branch, /return;/);
assert.match(branch, /this\._syncContextModeButtons\(\);\s*return;/);
});
test('direct Context entry captures on the synchronous request boundary', () => {
@@ -60,18 +52,29 @@ test('direct Context entry captures on the synchronous request boundary', () =>
attach,
/subscribeVisibilityRequests\(\(change\) => \{[\s\S]*?shouldCaptureContextSession\(change\)/,
);
assert.match(
attach,
/_captureContextSessionSnapshot\(\{\s*excludeLayerIds:\s*\[change\.layerId\],?\s*\}\)/,
);
});
test('Clear All defers a newer explicit mission guard until its batch settles', () => {
const attach = connectContextManager.toString();
assert.match(attach, /shouldDeferContextEntryDuringClear\(\{/);
assert.match(attach, /_contextModeDeferredEntryIntent = \{/);
assert.match(attach, /await this\._clearSelectedLayersManagerPromise/);
assert.match(attach, /await this\._clearLayersOutsideContextMode\(entryMode/);
test('only a direct Contacts entry request snapshots the layers', () => {
let request;
const controls = new ContextControls({
elements: {},
installations: {},
actions: { getCockpit: () => null },
});
const captures = [];
controls._captureContextSessionSnapshot = (options) => captures.push(options);
controls._syncContextModeButtons = () => {};
controls.connect({
subscribe: () => () => {},
subscribeVisibilityRequests(listener) {
request = listener;
return () => {};
},
});
for (const layerId of ['rocket-launches', 'military-awareness'])
request({ type: 'visibility-requested', layerId, enabled: true, origin: 'user', intentEpoch: 1 });
controls.stop();
assert.deepEqual(captures, [{ excludeLayerIds: ['military-awareness'] }]);
});
test('context restore replays explicit companion intent after the stale restore queue drains', () => {
@@ -91,7 +94,7 @@ test('context restore settles the Contacts coordinator before dependency fanout'
assert.ok(settle > 0, 'Contacts coordinator settlement is present');
assert.ok(coordinatorOff > settle, 'Contacts OFF is awaited');
assert.ok(fanout > coordinatorOff, 'snapshot fanout starts after Contacts settles');
assert.match(restore, /excludeLayerIds: settleContactsCoordinator[\s\S]*?contactsCoordinatorId/);
assert.match(restore, /excludeLayerIds: \[[\s\S]*?CONTEXT_INDEPENDENT_LAYER_IDS[\s\S]*?settleContactsCoordinator \? \[contactsCoordinatorId\]/);
});
test('Clear All during the Contacts settle stops the snapshot coming back', () => {
@@ -116,7 +119,7 @@ test('context handler: either failed direct Context-shell start rolls the sessio
handler.indexOf("change?.type === 'visibility-failed'"),
handler.indexOf("change?.type === 'visibility-will-change'"),
);
assert.match(failedBranch, /\['military-awareness', 'rocket-launches'\]\.includes\(change\.layerId\)/);
assert.match(failedBranch, /change\.layerId === 'military-awareness' &&/);
assert.match(
failedBranch,
/_restoreContextSessionAfterLayerSettles\(\s*change\.layerId,\s*\{\s*notificationToken,?\s*\},?\s*\)/,
@@ -154,14 +157,14 @@ test('wrapped visibility blocks leave the accessible toast to the wrapper token
test('every user-facing Context exit route settles through the failure surface', () => {
const initPanel = _initGlobalContextPanel.toString();
assert.equal((initPanel.match(/void this\._runUserFacingContextAction/g) || []).length, 3);
assert.equal((initPanel.match(/void this\._runUserFacingContextAction/g) || []).length, 2);
assert.doesNotMatch(initPanel, /falseIsFailure:\s*false/);
assert.doesNotMatch(initPanel, /void this\._selectContextMode/);
const deactivationCalls = [...handler.matchAll(
/void this\._trackContextLayerReaction\(\s*this\._runUserFacingContextAction\(\(notificationToken\) =>\s*this\._deactivateContextForLayerChange\(\{ notificationToken \}\),?\s*\),?\s*\)/g,
)];
assert.equal(deactivationCalls.length, 4, 'dependency and primary layer exits share the caught restore path');
assert.equal(deactivationCalls.length, 3, 'dependency and primary layer exits share the caught restore path');
assert.doesNotMatch(handler, /void this\._deactivateContextForLayerChange\(\)/);
});
@@ -193,10 +196,7 @@ test('right-rail context entry is transactional: activation result gates the mod
const failureBlock = select.slice(activation);
assert.match(failureBlock, /activated = await activationIntent\.promise/);
assert.match(failureBlock, /catch \(error\) \{\s*activationError = error;/);
assert.match(failureBlock, /_contextModeReplacementIntent\?\.generation === generation/);
assert.match(failureBlock, /await this\._dataManager\._waitForVisibilityIntent\?\.\(/);
assert.match(failureBlock, /outcome\?\.intentEpoch === replacementIntent\.intentEpoch[\s\S]*?outcome\.succeeded === true/);
assert.match(failureBlock, /outcome\?\.cancellationReason === 'superseded'[\s\S]*?outcome\.successorEnabled === true[\s\S]*?outcome\.successorIntentEpoch > replacementIntent\.intentEpoch/);
assert.match(failureBlock, /activationError\s*\|\|\s*activated === false\s*\|\|\s*!this\._dataManager\.isEnabled\(entryLayerId\)/);
assert.match(failureBlock, /cancelledAndSettled\s*=\s*terminalIntentOutcome\?\.succeeded === false/);
assert.match(failureBlock, /\['caller-abort', 'resource-abort', 'superseded'\]/);
@@ -216,9 +216,11 @@ test('Context entry awaits isolation and direct shell routes isolate in the visi
// rests on Context OFF; the honesty lives in the REPORT, not in a racy
// attempt to put the prior mode back (see the note above
// _restoreContextSessionAfterLayerSettles).
const capture = select.indexOf('this._captureContextSessionSnapshot(');
assert.ok(capture > 0, 'Context snapshot capture is missing');
const crossMode = select.slice(
select.indexOf('const crossModeSwitch = Boolean('),
select.indexOf('this._captureContextSessionSnapshot();'),
capture,
);
assert.ok(crossMode, 'cross-mode teardown block is missing');
assert.doesNotMatch(crossMode, /if \(signal\?\.aborted\)[\s\S]*?await this\._restoreContextSession/);
@@ -242,10 +244,10 @@ test('Context entry awaits isolation and direct shell routes isolate in the visi
assert.match(ContextControls.prototype.stop.toString(), /this\._contextModeGeneration\+\+/);
const guard = connectContextManager.toString();
assert.match(guard, /\['military-awareness', 'rocket-launches'\]\.includes\(change\.layerId\)/);
assert.match(guard, /change\.layerId !== 'military-awareness'/);
assert.match(guard, /const notificationToken\s*=\s*change\.notificationToken\s*\|\|\s*Symbol\('direct-context-shell-entry'\)/);
assert.match(guard, /this\._userFacingContextNotificationTokens\.add\(notificationToken\)/);
assert.match(guard, /await this\._clearLayersOutsideContextMode\(entryMode,\s*\{\s*notificationToken,?\s*\}\)/);
assert.match(guard, /await this\._clearLayersOutsideContextMode\(null,\s*\{\s*notificationToken,?\s*\}\)/);
assert.match(
guard,
/await this\._restoreContextSession\(\{\s*excludeLayerIds: \[change\.layerId\],\s*notificationToken,\s*\}\)/,
+40 -45
View File
@@ -2,7 +2,9 @@ import { renderApplicationHtml } from './testSupport/applicationHtml.mjs';
import { readStylesheet } from './testSupport/readStylesheet.mjs';
import { _selectContextMode } from './ui/contextTransactions.js';
import { _initGlobalContextPanel } from './ui/contextBindings.js';
import { ContextControls } from './ui/contextControls.js';
import { clearSelectedLayers } from './ui/contextActions.js';
import { PANEL_RAIL_ITEMS } from './ui/panelRailCatalog.js';
import { readFileSync as readRadioSource } from 'node:fs';
const radioBindings = readRadioSource(
new URL('./ui/radioBindings.js', import.meta.url),
@@ -21,43 +23,24 @@ const html = await renderApplicationHtml(
);
const css = readStylesheet(new URL('../style.css', import.meta.url));
test('Contacts and Space Missions both participate in the ordinary Tab sequence', () => {
for (const id of [
'global-context-flights-btn',
'global-context-missions-btn',
]) {
const button = html.match(
new RegExp(`<button id="${id}"[\\s\\S]*?</button>`),
);
assert.ok(button, `${id} is missing`);
assert.match(button[0], /role="tab"/);
assert.match(button[0], /tabindex="0"/);
}
// The view keeps both tabs' tabindex static and never disables them; the
// transition itself is covered over happy-dom in ui/contextPanel.test.mjs.
for (const id of [
'global-context-flights-btn',
'global-context-missions-btn',
]) {
const tag = contextView.match(new RegExp(`<button id="${id}"[^>]*>`))?.[0];
assert.ok(tag, `${id} is missing from the view`);
assert.doesNotMatch(tag, /:tabindex|:disabled|\sdisabled/);
}
test('Contacts stays in the keyboard sequence and Space Missions owns its rail item', () => {
const button = html.match(
/<button id="global-context-flights-btn"[\s\S]*?<\/button>/,
)?.[0];
assert.ok(button, 'Contacts control is missing');
assert.match(button, /role="tab"/);
assert.match(button, /tabindex="0"/);
const tag = contextView.match(/<button id="global-context-flights-btn"[^>]*>/)?.[0];
assert.ok(tag, 'Contacts control is missing from the view');
assert.doesNotMatch(tag, /:tabindex|:disabled|\sdisabled/);
assert.doesNotMatch(html, /id="global-context-missions-btn"/);
assert.match(html, /id="space-missions-panel"[^>]*data-panel-id="space-missions-panel"/);
assert.equal(PANEL_RAIL_ITEMS['space-missions-panel'].icon, 'rocket_launch');
});
test('Context activation and Clear All never native-disable tabs and guard repeated clicks', () => {
const init = _initGlobalContextPanel.toString();
const select = _selectContextMode.toString();
const clear = clearSelectedLayers.toString();
assert.equal(
(
init.match(
/if \(\s*this\.destroyed\s*\|\|\s*this\._contextModeChanging\s*\|\|\s*this\._clearSelectedLayersPromise\s*\)\s*return;/g,
) || []
).length,
2,
);
assert.doesNotMatch(
select,
/_globalContext(?:Flights|Missions)Btn\.disabled\s*=\s*true/,
@@ -68,17 +51,29 @@ test('Context activation and Clear All never native-disable tabs and guard repea
);
});
test('Context tablist retains Left, Right, Home, and End keyboard navigation', () => {
const initSource = _initGlobalContextPanel.toString();
assert.match(initSource, /event\.key === 'ArrowRight'/);
assert.match(initSource, /event\.key === 'ArrowLeft'/);
assert.match(initSource, /event\.key === 'Home'/);
assert.match(initSource, /event\.key === 'End'/);
assert.match(
initSource,
/contextTabs\[nextIndex\]\.focus\(\{ preventScroll: true \}\)/,
);
assert.match(initSource, /contextTabs\[nextIndex\]\.click\(\)/);
test('a Contacts click while Context is busy is ignored', () => {
const button = new EventTarget();
const controls = new ContextControls({
elements: { _globalContextFlightsBtn: button },
installations: {},
actions: { getCockpit: () => null, claimVisualAuthority() {} },
});
const runs = [];
controls._runUserFacingContextAction = (operation) => {
runs.push(operation);
return Promise.resolve(false);
};
const click = () => button.dispatchEvent(new Event('click'));
controls._contextModeChanging = true;
click();
controls._contextModeChanging = false;
controls._clearSelectedLayersPromise = Promise.resolve();
click();
assert.equal(runs.length, 0, 'a transition or Clear All in flight drops it');
controls._clearSelectedLayersPromise = null;
click();
assert.equal(runs.length, 1, 'an idle panel takes the click');
controls.stop();
});
test('Context tabs draw a visible keyboard-focus outline including active tabs', () => {
@@ -102,7 +97,6 @@ test('Context tabs draw a visible keyboard-focus outline including active tabs',
});
test('Context async action buttons remain focused while busy', () => {
const init = _initGlobalContextPanel.toString();
const radio = radioBindings.slice(
radioBindings.indexOf('const toggleRadio = async (trigger) => {'),
radioBindings.indexOf('this._storeToken = this.store?.connect?.('),
@@ -113,6 +107,7 @@ test('Context async action buttons remain focused while busy', () => {
);
const clear = clearSelectedLayers.toString();
const init = _initGlobalContextPanel.toString();
assert.match(init, /if \(this\._installationsSearchBusy\) return;/);
assert.doesNotMatch(init, /\.disabled\s*=\s*true/);
const search = contextView.match(
@@ -220,7 +215,7 @@ test('Context reads as one segmented control with legible type and no halo', ()
// open Context title legible; no Context-only rule dims it again.
assert.equal(
rule(
":root:not([data-ui-theme='cyber']) #global-context-panel:not(.collapsed) .panel-title",
":root #global-context-panel:not(.collapsed) .panel-title",
),
'',
);
+288 -38
View File
@@ -6,6 +6,12 @@ import test from 'node:test';
import { fileURLToPath } from 'node:url';
const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
// The Omnibar's desktop footer (src/ui/styles/omnibar-dock.css) is part of
// the cascade below like every other stylesheet; its rules carry the
// Omnibar scope, so they are modelled as a layout of their own.
const omnibarCss = readStylesheet(
path.join(ROOT, 'src/ui/styles/omnibar-dock.css'),
);
const css = readStylesheet(path.join(ROOT, 'style.css'));
/*
@@ -125,11 +131,56 @@ function specificity(selector) {
return [ids, classes, types];
}
/** Flatten style.css into rules carrying their raw media stack. */
/** Collapse whitespace and the padding inside brackets of a selector. */
const tidySelector = (part) =>
part
.replace(/\s+/g, ' ')
.trim()
.replace(/\(\s+/g, '(')
.replace(/\s+\)/g, ')');
/**
* A nested selector resolved against its parent rule's selectors, as CSS
* nesting does: `&` stands for the parent, and a selector without one is a
* descendant of it.
*/
function nestSelectors(parents, head) {
const own = splitTopLevel(head, ',').map(tidySelector).filter(Boolean);
if (!parents) return own;
return parents.flatMap((parent) =>
own.map((part) =>
part.includes('&') ? part.replaceAll('&', parent) : `${parent} ${part}`,
),
);
}
/**
* Flatten style.css into rules carrying their raw media stack. Nested style
* rules (CSS nesting) and media queries nested in a rule are resolved to
* full selectors, so a nested rule is modelled like any other.
*/
function flattenRules(source) {
const src = source.replace(/\/\*[\s\S]*?\*\//g, '');
const rules = [];
const mediaStack = [];
// Open blocks, innermost last: media queries and style rules.
const stack = [];
const mediaStack = () =>
stack.filter((frame) => frame.media).map((frame) => frame.media);
const parentRule = () =>
[...stack].reverse().find((frame) => frame.rule)?.rule || null;
const declare = (text) => {
const rule = parentRule();
const trimmed = text.trim();
if (!rule || !trimmed) return;
const colon = trimmed.indexOf(':');
if (colon < 0) return;
const value = trimmed.slice(colon + 1).trim();
rule.decls.push({
prop: trimmed.slice(0, colon).trim().toLowerCase(),
value: value.replace(/\s*!important$/i, '').trim(),
important: /!important\s*$/i.test(value),
});
};
let index = 0;
let prelude = '';
while (index < src.length) {
@@ -137,14 +188,13 @@ function flattenRules(source) {
if (char === '{') {
const head = prelude.replace(/\s+/g, ' ').trim();
prelude = '';
index += 1;
if (head.startsWith('@media')) {
mediaStack.push(head.slice('@media'.length).trim());
index += 1;
stack.push({ media: head.slice('@media'.length).trim() });
continue;
}
if (head.startsWith('@')) {
let level = 1;
index += 1;
while (index < src.length && level > 0) {
if (src[index] === '{') level += 1;
else if (src[index] === '}') level -= 1;
@@ -152,43 +202,34 @@ function flattenRules(source) {
}
continue;
}
const close = src.indexOf('}', index);
assert.ok(close > index, `unterminated rule block for "${head}"`);
const decls = [];
for (const raw of src.slice(index + 1, close).split(';')) {
const text = raw.trim();
if (!text) continue;
const colon = text.indexOf(':');
if (colon < 0) continue;
const value = text.slice(colon + 1).trim();
decls.push({
prop: text.slice(0, colon).trim().toLowerCase(),
value: value.replace(/\s*!important$/i, '').trim(),
important: /!important\s*$/i.test(value),
});
}
rules.push({
const rule = {
order: rules.length,
media: [...mediaStack],
parts: splitTopLevel(head, ',')
.map((part) =>
part.trim().replace(/\(\s+/g, '(').replace(/\s+\)/g, ')'),
)
.filter(Boolean),
decls,
});
index = close + 1;
media: mediaStack(),
parts: nestSelectors(parentRule()?.parts, head),
decls: [],
};
rules.push(rule);
stack.push({ rule });
continue;
}
if (char === ';') {
declare(prelude);
prelude = '';
index += 1;
continue;
}
if (char === '}') {
mediaStack.pop();
// The last declaration of a block may omit its semicolon.
declare(prelude);
prelude = '';
stack.pop();
index += 1;
continue;
}
prelude += char;
index += 1;
}
assert.equal(stack.length, 0, 'unbalanced braces in style.css');
return rules;
}
@@ -227,6 +268,29 @@ const RECOGNIZED = new Set([
]);
const DOCKED_RAIL = 'body.context-docked #right-context-rail';
// The desktop Omnibar layout: the scope its stylesheet nests every rule in.
// It applies on the desktop shell (above the 720px phone breakpoint) while
// the Omnibar and the voice control share the dock; outside it the legacy
// layout below governs.
const OMNIBAR_SCOPE =
'body:not(.mobile-shell):not(.cockpit-mode):not(.scene-playback-mode):not(.ui-clean-view):not(.recording-mode):where(:has(#gev-omnibar):has(#command-dock > #gev-voice-control))';
const OMNIBAR = Object.freeze({
dock: `${OMNIBAR_SCOPE} #command-dock`,
credit: `${OMNIBAR_SCOPE} :is(#cesium-credits, #gev-credits)`,
minimalCredit: `${OMNIBAR_SCOPE}:has(#intel-hud[data-variant='minimal'].active) :is(#cesium-credits, #gev-credits)`,
minimalRail: `${OMNIBAR_SCOPE}:not(.context-docked):has(#intel-hud[data-variant='minimal'].active) #right-context-rail`,
trays: `${OMNIBAR_SCOPE} #command-dock > :is(#location-bar, #control-panel)`,
});
// What each Omnibar-scope rule may set on a modelled box; the Omnibar
// clearance test resolves every one of them through the full cascade.
const OMNIBAR_RECOGNIZED = new Map([
[OMNIBAR.dock, new Set(['top', 'bottom', 'height', 'min-height'])],
[OMNIBAR.credit, new Set(['bottom'])],
[OMNIBAR.minimalCredit, new Set(['bottom'])],
[OMNIBAR.minimalRail, new Set(['max-height'])],
]);
const OMNIBAR_MIN_WIDTH = 721;
const ELEMENT_KEYS = [
'#cesium-credits',
'#command-dock',
@@ -300,8 +364,11 @@ function ownBoxEntries() {
// So is Stories, with GEV's chrome stepped aside; storiesCredit.test.mjs
// pins its attribution placement.
if (
/^body\.stories-mode:not\(#gs-a\):not\(#gs-b\) #(cesium|gev)-credits$/.test(part)
) continue;
/^body\.stories-mode:not\(#gs-a\):not\(#gs-b\) #(cesium|gev)-credits$/.test(
part,
)
)
continue;
entries.push({ rule, part });
}
}
@@ -372,12 +439,21 @@ function resolve(candidates, prop, width, label) {
/** Evaluate a length. Anything the model cannot resolve exactly fails loudly. */
function toPx(value, viewportHeight, where) {
const trimmed = value.trim();
// The larger of its lengths, each resolved the same way.
if (/^max\(.*\)$/.test(trimmed))
return Math.max(
...splitTopLevel(trimmed.slice(4, -1), ',').map((part) =>
toPx(part, viewportHeight, where),
),
);
const inner = /^calc\(/.test(trimmed) ? trimmed.slice(5, -1) : trimmed;
assert.doesNotMatch(
inner,
/\bcalc\(/,
`nested calc() in ${where}: "${value}"`,
);
// A calc() is a whole term of its own, resolved below; nowhere else.
for (const term of splitTopLevel(inner, '+'))
assert.doesNotMatch(
term.trim().replace(/^calc\(.*\)$/, ''),
/\bcalc\(/,
`nested calc() in ${where}: "${value}"`,
);
assert.doesNotMatch(
inner,
/\b(min|max|clamp|env|attr|round|mod)\(/,
@@ -398,6 +474,18 @@ function toPx(value, viewportHeight, where) {
const term = raw.trim();
if (!term) continue;
if (term === '100%') continue; // the tray's own panel height, added separately
// A calc() of its own, as a term ("calc(var(--omnibar-credits-clear) +
// 2px)" once substituted).
if (/^calc\(.*\)$/.test(term)) {
total += toPx(term, viewportHeight, where);
continue;
}
// The credit line's own height (src/ui/creditLineHeight.js), at the
// height this pin models it at.
if (/^var\(--credit-line-height\b/.test(term)) {
total += CREDIT_HEIGHT_PX;
continue;
}
if (term.startsWith('var(')) {
const name = term.slice(4, term.lastIndexOf(')')).split(',')[0].trim();
assert.ok(
@@ -521,6 +609,22 @@ test('the model refuses every cascade construct it cannot resolve', () => {
// Expanded Context covers the right edge top to bottom; the credit row
// stops short of it instead (the docked-Context test below).
if (part === DOCKED_RAIL) continue;
if (part.startsWith(OMNIBAR_SCOPE)) {
const allowed = OMNIBAR_RECOGNIZED.get(part);
for (const decl of guarded) {
if (!allowed?.has(decl.prop))
complaints.push(
`unrecognized Omnibar rule positions a modelled element: "${part}" (${decl.prop})`,
);
if (decl.important)
complaints.push(`!important on ${decl.prop} of "${part}"`);
}
if (rule.media.length)
complaints.push(
`media query on Omnibar rule "${part}": ${rule.media.join(' && ')}`,
);
continue;
}
if (!RECOGNIZED.has(part)) {
complaints.push(
`unrecognized selector positions a modelled element: "${part}" (${guarded.map((d) => d.prop).join(', ')})`,
@@ -771,6 +875,152 @@ test('right rail measurement cannot persist into a painted attribution layout',
// ── Clearance ───────────────────────────────────────────────────────────────
/** A custom property's value as the Omnibar scope declares it. */
function omnibarVar(name) {
const decls = RULES.filter((rule) => rule.parts.includes(OMNIBAR_SCOPE))
.flatMap((rule) => rule.decls)
.filter((decl) => decl.prop === name);
assert.equal(
decls.length,
1,
`${name} is declared once in the Omnibar scope`,
);
return decls[0].value;
}
/** A length in the Omnibar layout, with its scope's own custom properties. */
function omnibarPx(value, viewportHeight, where) {
// The scope's properties may name each other ("--omnibar-dock-bottom"
// clears "--omnibar-credits-clear"): substitute until none is left.
let substituted = value;
for (let pass = 0; /var\(--omnibar-/.test(substituted); pass += 1) {
assert.ok(
pass < 8,
`Omnibar properties name each other in a loop: ${value}`,
);
substituted = substituted.replace(/var\((--omnibar-[\w-]+)\)/g, (_, name) =>
omnibarVar(name),
);
}
return toPx(substituted, viewportHeight, where);
}
test('Omnibar reserves a non-overlapping desktop footer at native credit sizing', () => {
// The Omnibar layout resolves through the same cascade as the legacy one:
// every legacy rule that could still match competes with the scope's.
const trayOpen = [
'#command-dock:has(#location-bar:not(.collapsed))',
'#command-dock:has(#control-panel:not(.collapsed))',
];
assert.equal(
omnibarVar('--world-timeline-lift'),
'0px',
'the Omnibar layout holds the timeline lift at 0',
);
for (const width of WIDTHS.filter((w) => w >= OMNIBAR_MIN_WIDTH)) {
for (const height of HEIGHTS) {
for (const minimal of [false, true]) {
const dock = resolve(
['#command-dock', ...trayOpen, OMNIBAR.dock],
'bottom',
width,
'Omnibar dock',
);
assert.equal(
dock.part,
OMNIBAR.dock,
`the Omnibar owns the dock at ${width}px`,
);
// Its top and height too: a legacy top or height winning here would
// move or stretch the dock the clearance below is measured from.
for (const [prop, value] of [
['top', 'auto'],
['height', '56px'],
]) {
const own = resolve(
['#command-dock', ...trayOpen, OMNIBAR.dock],
prop,
width,
`Omnibar dock ${prop}`,
);
assert.equal(
own.part,
OMNIBAR.dock,
`the Omnibar owns the dock ${prop} at ${width}px`,
);
assert.equal(
own.decl.value,
value,
`Omnibar dock ${prop} at ${width}px`,
);
}
const credit = resolve(
[
...CREDIT_SELECTORS,
OMNIBAR.credit,
...(minimal ? [MINIMAL_HUD_CREDIT, OMNIBAR.minimalCredit] : []),
],
'bottom',
width,
'Omnibar credit',
);
assert.ok(
credit.part.startsWith(OMNIBAR_SCOPE),
`the Omnibar owns the credit row at ${width}px`,
);
const dockBottom = omnibarPx(
dock.decl.value,
height,
'Omnibar dock bottom',
);
const creditTop =
omnibarPx(credit.decl.value, height, 'Omnibar credit bottom') +
CREDIT_HEIGHT_PX;
assert.ok(
dockBottom - creditTop >= MIN_CLEARANCE_PX,
`at ${width}x${height}${minimal ? ' (minimal HUD)' : ''} the Omnibar dock (${dockBottom}px) must clear the credit line (${creditTop}px)`,
);
}
}
}
// No legacy tray opens over the credit: both are hidden in this layout,
// and no rule elsewhere forces them back.
const trays = RULES.find((rule) => rule.parts.includes(OMNIBAR.trays));
assert.ok(trays, 'the Omnibar layout hides the legacy trays');
assert.equal(
trays.decls.find((decl) => decl.prop === 'display')?.value,
'none',
);
for (const rule of RULES) {
for (const part of rule.parts) {
if (!/#(location-bar|control-panel)$/.test(lastCompound(part))) continue;
assert.ok(
!rule.decls.some((decl) => decl.prop === 'display' && decl.important),
`"${part}" forces a hidden tray back with !important`,
);
}
}
// The minimal-HUD rail cap only shortens the rail, which is anchored at
// its top, so it can only add room above the credit.
const rail = RULES.find((rule) => rule.parts.includes(OMNIBAR.minimalRail));
const cap = rail.decls.find(
(decl) => decl.prop === '--omnibar-minimal-rail-height',
);
assert.match(
cap?.value || '',
/^min\(\s*var\(--right-stack-max-height, 70vh\),/,
);
assert.equal(
rail.decls.find((decl) => decl.prop === 'max-height')?.value,
'var(--omnibar-minimal-rail-height)',
);
assert.doesNotMatch(
omnibarCss,
/\.cesium-widget-credits|\.cesium-credit-logoContainer|\.cesium-credit-textContainer/,
'the footer uses the original credit text and logo sizing',
);
});
test('every open dock tray clears the required credit at every modelled viewport', () => {
// Below 900px the tray widens to nearly the viewport and lands on the
// bottom-left corner where the credit lives. The clearance is NOT one fixed
+8 -6
View File
@@ -527,10 +527,15 @@ export function cyberSonarLabelIntensity(
return labelDimFactor + (1 - labelDimFactor) * normalized;
}
/**
* Sonar is an opt-in visual style over any HUD layout: it is on only after
* the Display panel's Sonar toggle, a voice request or a legacy Cyber link
* turns it on.
*/
export function isCyberSonarEnabled(
root = globalThis.document?.documentElement,
) {
return root?.dataset?.cyberSonar !== 'off';
return root?.dataset?.cyberSonar === 'on';
}
export function setCyberSonarEnabled(
@@ -539,9 +544,7 @@ export function setCyberSonarEnabled(
) {
if (!root?.dataset) return false;
root.dataset.cyberSonar = enabled ? 'on' : 'off';
if (root.dataset.uiTheme === 'cyber') {
applyCyberSonarThemePhase(root, enabled);
}
applyCyberSonarThemePhase(root, enabled);
return enabled;
}
@@ -566,7 +569,6 @@ export function isCyberSonarActive({
globalThis.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches ??
false;
return !!(
root?.dataset?.uiTheme === 'cyber' &&
isCyberSonarEnabled(root) &&
(hudActive ?? hud?.classList?.contains?.('active')) &&
!body?.classList?.contains?.('cockpit-mode') &&
@@ -583,7 +585,7 @@ export function isCyberMapThemeActive({
if (hud === undefined)
hud = globalThis.document?.getElementById?.('intel-hud');
return !!(
root?.dataset?.uiTheme === 'cyber' &&
isCyberSonarEnabled(root) &&
(hudActive ?? hud?.classList?.contains?.('active')) &&
!body?.classList?.contains?.('cockpit-mode')
);
+13 -9
View File
@@ -39,7 +39,7 @@ test('production-transformed sonar defaults retain the document method receiver'
const previous = Object.getOwnPropertyDescriptor(globalThis, 'document');
const hud = { classList: { contains: (name) => name === 'active' } };
const document = {
documentElement: { dataset: { uiTheme: 'cyber' } },
documentElement: { dataset: { cyberSonar: 'on' } },
body: { classList: { contains: () => false } },
getElementById(id) {
assert.equal(this, document);
@@ -57,7 +57,7 @@ test('production-transformed sonar defaults retain the document method receiver'
assert.ok(
Number.isFinite(compiled.createCyberSonarSampler(800, 600).at(400, 300)),
);
document.documentElement.dataset.uiTheme = 'tactical';
document.documentElement.dataset.cyberSonar = 'off';
assert.equal(compiled.isCyberSonarActive(), false);
assert.equal(compiled.isCyberMapThemeActive(), false);
} finally {
@@ -139,8 +139,8 @@ test('the sweep brightens contacts inside its sector and dims the remainder', ()
);
});
test('the sonar activates only for a visible Cyber map HUD with motion enabled', () => {
const root = { dataset: { uiTheme: 'cyber' } };
test('the sonar activates only while on, over a visible map HUD with motion enabled', () => {
const root = { dataset: { cyberSonar: 'on' } };
const classes = (...values) => ({
contains: (value) => values.includes(value),
});
@@ -220,14 +220,18 @@ test('the opacity setting controls every contact floor and preserves brighter la
);
});
test('the sonar control defaults on and records explicit operator state', () => {
test('the sonar control defaults off and records explicit operator state', () => {
const root = { dataset: {} };
assert.equal(isCyberSonarEnabled(root), false);
// The removed Cyber theme no longer turns it on.
root.dataset.uiTheme = 'cyber';
assert.equal(isCyberSonarEnabled(root), false);
assert.equal(setCyberSonarEnabled(true, root), true);
assert.equal(root.dataset.cyberSonar, 'on');
assert.equal(isCyberSonarEnabled(root), true);
assert.equal(setCyberSonarEnabled(false, root), false);
assert.equal(root.dataset.cyberSonar, 'off');
assert.equal(isCyberSonarEnabled(root), false);
assert.equal(setCyberSonarEnabled(true, root), true);
assert.equal(root.dataset.cyberSonar, 'on');
});
test('real Cesium points and billboards recover after repeated low/high opacity cycles', () => {
@@ -349,10 +353,10 @@ test('the sweep corrects delayed starts and reacquires restarted animations with
assert.doesNotThrow(() => syncCyberSonarAnimation({}));
});
test('the selected Cyber theme seeds and releases the compositor sweep phase', () => {
test('turning Sonar on seeds and releases the compositor sweep phase', () => {
const values = new Map();
const root = {
dataset: {},
dataset: { cyberSonar: 'on' },
style: {
setProperty: (name, value) => values.set(name, value),
removeProperty: (name) => values.delete(name),
+27 -16
View File
@@ -45,7 +45,7 @@ test('frame sampler matches reference without per-contact settings access', () =
});
test('removed CSS mode cannot disable GPU contacts; unsupported renderers fail closed', () => {
const root = { dataset: { uiTheme: 'cyber' }, style: { setProperty() {} } };
const root = { dataset: { cyberSonar: 'on' }, style: { setProperty() {} } };
const options = {
root,
body: { classList: { contains: () => false } },
@@ -97,7 +97,7 @@ function fixture({ modulation = true, lists = true } = {}) {
document: globalThis.document,
matchMedia: globalThis.matchMedia,
};
const root = { dataset: { uiTheme: 'cyber', cyberSonar: 'on' } };
const root = { dataset: { cyberSonar: 'on' } };
const status = { textContent: '' };
const state = { cockpit: false, reducedMotion: false };
globalThis.document = {
@@ -232,36 +232,47 @@ test('the sweep sets its sector on drawing ticks and at the cadence, and changes
f.tick(false);
assert.equal(f.sets.length, 4, 'a resize sets it at once');
assert.deepEqual(f.sets[3].center, { x: 300, y: 400 });
f.root.dataset.cyberSonar = 'off';
f.root.dataset.cyberSonarOpacity = '50';
f.tick(false);
assert.equal(f.sets[4].radius, 0, 'Sonar OFF rests every contact');
assert.equal(f.sets.length, 5, 'a setting change sets it at once');
assert.equal(
f.sets[4].floor,
0.5,
'while sweeping the floor is the opacity',
);
f.state.reducedMotion = true;
f.tick(false);
assert.equal(f.sets[5].radius, 0, 'reduced motion rests the sweep');
assert.equal(f.sets[5].floor, 0.5 + 0.5 * 0.46, 'at rest it lifts');
clock += 1000;
f.tick(true);
f.tick(false);
assert.equal(f.sets.length, 5, 'at rest only changes set it');
f.root.dataset.cyberSonarOpacity = '50';
f.tick(false);
assert.equal(f.sets.length, 6);
assert.equal(f.sets[5].floor, 0.5 + 0.5 * 0.46);
assert.equal(f.sets.length, 6, 'at rest only changes set it');
f.state.reducedMotion = false;
f.state.cockpit = true;
f.tick(false);
assert.equal(f.sets[6], null, 'out of the map theme it clears');
assert.equal(f.sets[6], null, 'out of the map it clears');
f.tick(true);
assert.equal(f.sets.length, 7, 'cleared once');
f.state.cockpit = false;
f.root.dataset.cyberSonar = 'off';
f.tick(false);
assert.equal(f.sets.length, 7, 'Sonar OFF leaves contacts untreated');
f.root.dataset.cyberSonar = 'on';
f.state.reducedMotion = true;
f.tick(false);
assert.equal(f.sets[7].radius, 0, 'reduced motion rests the sweep');
f.state.reducedMotion = false;
f.root.dataset.uiTheme = 'tactical';
assert.ok(f.sets[7]?.radius > 0, 'Sonar ON sweeps at once');
f.root.dataset.cyberSonar = 'off';
f.tick(false);
assert.equal(f.sets[8], null, 'another HUD style clears it');
assert.equal(f.sets[8], null, 'Sonar OFF clears it');
f.tick(true);
assert.equal(f.sets.length, 9);
// The removed Cyber theme attribute alone does nothing.
f.root.dataset.uiTheme = 'cyber';
f.tick(false);
assert.ok(f.sets[9]?.radius > 0, 'back in Cyber it sweeps at once');
assert.equal(f.sets.length, 9);
f.root.dataset.cyberSonar = 'on';
f.tick(false);
assert.ok(f.sets[9]?.radius > 0, 'back on, it sweeps at once');
assert.deepEqual(f.requests, [], 'the scene itself never asks for frames');
dispose();
assert.equal(f.sets[10], null, 'disposal clears it');
+176 -31
View File
@@ -32,7 +32,12 @@ import aisLiveVesselsLayer from './aisLiveVessels.js';
import { registerEntityContext, selectEntityContext } from './contextStore.js';
import { WORLD_FOCUS_REQUEST_EVENT } from '../worldFocus.js';
import { ensureGeoidReady, geoidHeight } from './geoid.js';
import { registerPickOwner, unregisterPickOwner } from './pickRegistry.js';
import {
isUnderOtherCard,
registerPickOwner,
setClickCardHitTest,
unregisterPickOwner,
} from './pickRegistry.js';
import { applyVesselOverlayPolicy } from './vesselLabels.js';
import { fakeInput } from '../input/testDoubles.mjs';
import { layerFeedState } from './manager.js';
@@ -490,7 +495,7 @@ test('first accepted position ends grace and warm data survives later open silen
const clock = makeFakeAisRuntime(7000);
const record = makeRecord();
_setAisRuntimeForTest(clock.runtime);
_setVesselOverlayHostForTest({
useVesselHost({
setEntries() {},
setVisible() {},
clearSource() {},
@@ -540,7 +545,7 @@ test('first accepted position ends grace and warm data survives later open silen
assert.equal(feed.error, 'awaiting usable AIS positions…');
} finally {
_setVesselStateForTest({ enabled: false });
_setVesselOverlayHostForTest();
useVesselHost();
_setAisRuntimeForTest();
}
});
@@ -1012,7 +1017,12 @@ function makeCesiumEvent() {
};
}
function installWireHarness(picked, stateOverrides = {}) {
function installWireHarness(
picked,
stateOverrides = {},
sceneExtras = {},
firstClick = null,
) {
const hadWindow = Object.hasOwn(globalThis, 'window');
const hadDocument = Object.hasOwn(globalThis, 'document');
const priorWindow = globalThis.window;
@@ -1038,9 +1048,11 @@ function installWireHarness(picked, stateOverrides = {}) {
},
};
const viewer = {
scene: { pick: () => picked },
scene: { pick: () => picked, ...sceneExtras },
};
const input = fakeInput(viewer);
// A subscriber that runs before the layer's own (an aircraft layer).
if (firstClick) input.input.onClick(firstClick);
// The camera port other layers follow through, with no pose to read; its
// followChanged event counts who listens.
const followChanged = makeCesiumEvent();
@@ -1666,7 +1678,7 @@ test('vessel host publication preserves the shipped grid winner and separation s
},
},
});
_setVesselOverlayHostForTest({
useVesselHost({
setEntries(sourceId, entries, options) {
publications.push({ sourceId, entries, options });
},
@@ -1690,7 +1702,7 @@ test('vessel host publication preserves the shipped grid winner and separation s
} finally {
unbind();
_setVesselStateForTest({ enabled: false });
_setVesselOverlayHostForTest();
useVesselHost();
}
});
@@ -1717,7 +1729,7 @@ test('vessel real layer lifecycle publishes protected selection and leaves no st
globalThis.window.addEventListener('gev:world-request-focus', (event) => {
focusRequests.push(event.detail);
});
_setVesselOverlayHostForTest(host);
useVesselHost(host);
_setVesselStateForTest({
viewer: {
get canvas() {
@@ -1766,7 +1778,7 @@ test('vessel real layer lifecycle publishes protected selection and leaves no st
);
} finally {
_setVesselStateForTest({ enabled: false });
_setVesselOverlayHostForTest();
useVesselHost();
if (hadWindow) globalThis.window = priorWindow;
else delete globalThis.window;
globalThis.document = priorDocument;
@@ -1872,17 +1884,31 @@ test('vessel interaction wire: a vessel with an id and no MMSI is selected by cl
}
});
/**
* Hand the vessel layer an overlay host, and answer the pick registry's
* card-on-top question from the same host, as the application does.
*/
function useVesselHost(host) {
_setVesselOverlayHostForTest(host);
setClickCardHitTest(host ? (x, y) => host.hitTest(x, y) : null);
}
/**
* Overlay-host recorder whose hitTest answers with one card id. The real host
* only publishes rects for `interactive` entries, so a stub returning a hit is
* the same contract a painted, actionable card presents.
*/
function hostWithCardHit(entryId) {
function hostWithCardHit(entryId, topHit) {
return {
setEntries() {},
setVisible() {},
clearSource() {},
hitTest: () => (entryId ? { sourceId: 'ais-live-vessels', entryId } : null),
hitTest: (_x, _y, { sourceId } = {}) =>
!sourceId && topHit
? topHit
: entryId
? { sourceId: 'ais-live-vessels', entryId }
: null,
};
}
@@ -1898,9 +1924,7 @@ test('vessel interaction wire: clicking a card selects and transfers, like the s
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
requests.push(event.detail),
);
_setVesselOverlayHostForTest(
hostWithCardHit(`vessel:${harness.record.mmsi}`),
);
useVesselHost(hostWithCardHit(`vessel:${harness.record.mmsi}`));
try {
harness.handler.click({ position: { x: 10, y: 20 } });
assert.equal(
@@ -1911,7 +1935,7 @@ test('vessel interaction wire: clicking a card selects and transfers, like the s
assert.equal(requests[0].kind, 'vessel');
assert.equal(requests[0].id, harness.record.mmsi);
} finally {
_setVesselOverlayHostForTest(null);
useVesselHost(null);
harness.cleanup();
}
});
@@ -1926,9 +1950,7 @@ test('vessel interaction wire: clicking the selected vessel card refocuses exact
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
requests.push(event.detail),
);
_setVesselOverlayHostForTest(
hostWithCardHit(`vessel:${harness.record.mmsi}`),
);
useVesselHost(hostWithCardHit(`vessel:${harness.record.mmsi}`));
try {
harness.handler.click({ position: { x: 10, y: 20 } });
assert.equal(
@@ -1939,11 +1961,36 @@ test('vessel interaction wire: clicking the selected vessel card refocuses exact
assert.equal(requests[0].id, harness.record.mmsi);
assert.equal(harness.trail.clearCalls, 0);
} finally {
_setVesselOverlayHostForTest(null);
useVesselHost(null);
harness.cleanup();
}
});
// Another layer's card on top takes the click from the vessel card under it
// and from a vessel icon under it alike.
test('vessel interaction wire: a covered card and a covered vessel pick both yield', () => {
for (const ownPick of [false, true]) {
const harness = installWireHarness(ownPick ? { id: makeRecord().mmsi } : null);
const requests = [];
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
requests.push(event.detail),
);
useVesselHost(
hostWithCardHit(`vessel:${harness.record.mmsi}`, {
sourceId: 'earthquakes', entryId: 'quake:cover',
}),
);
try {
harness.handler.click({ position: { x: 10, y: 20 } });
assert.equal(requests.length, 0, `own pick: ${ownPick}`);
assert.equal(aisLiveVesselsLayer.getSelectedInfo()?.mmsi, harness.record.mmsi);
} finally {
useVesselHost(null);
harness.cleanup();
}
}
});
test('vessel interaction wire: an unknown card id preserves selection and never flies', () => {
const harness = installWireHarness({
primitive: {},
@@ -1955,7 +2002,7 @@ test('vessel interaction wire: an unknown card id preserves selection and never
requests.push(event.detail),
);
// An evicted vessel's card id resolves to no live record.
_setVesselOverlayHostForTest(hostWithCardHit('vessel:999999999'));
useVesselHost(hostWithCardHit('vessel:999999999'));
try {
harness.handler.click({ position: { x: 10, y: 20 } });
assert.equal(
@@ -1964,37 +2011,135 @@ test('vessel interaction wire: an unknown card id preserves selection and never
);
assert.equal(requests.length, 0);
} finally {
_setVesselOverlayHostForTest(null);
useVesselHost(null);
harness.cleanup();
}
});
test('vessel interaction wire: a sibling-owned pick wins without selection mutation', () => {
// Another layer is already acting on this click; two camera commands is the
// worse failure, so the card is not consulted.
test('vessel interaction wire: the vessel card on top wins over a sibling-owned pick', () => {
// The card painted on top takes the click; the sibling (an aircraft)
// stands aside under it, so there is one camera command, not two.
registerPickOwner('flights', (pickedId) => pickedId === 'a1b2c3');
const harness = installWireHarness({ id: 'a1b2c3' });
const requests = [];
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
requests.push(event.detail),
);
_setVesselOverlayHostForTest(
hostWithCardHit(`vessel:${harness.record.mmsi}`),
);
useVesselHost(hostWithCardHit(`vessel:${harness.record.mmsi}`));
try {
harness.handler.click({ position: { x: 10, y: 20 } });
assert.equal(
aisLiveVesselsLayer.getSelectedInfo()?.mmsi,
harness.record.mmsi,
);
assert.equal(requests.length, 0);
assert.equal(requests.length, 1);
} finally {
_setVesselOverlayHostForTest(null);
useVesselHost(null);
harness.cleanup();
unregisterPickOwner('flights');
}
});
// The aircraft layer runs first. Under the vessel's card it stands aside, so
// the card takes the click: one action.
test('vessel interaction wire: a card over an aircraft takes the click; the aircraft does not track', (t) => {
let tracked = null;
registerPickOwner('test-planes', (pickedId) => pickedId === 'plane:9');
t.after(() => unregisterPickOwner('test-planes'));
const harness = installWireHarness(
{ id: 'plane:9' },
{ selectedRecord: null },
{},
(event) => {
if (isUnderOtherCard(event)) return;
if (event.hit?.id === 'plane:9') tracked = 'plane:9';
},
);
const requests = [];
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
requests.push(event.detail),
);
useVesselHost(hostWithCardHit(`vessel:${harness.record.mmsi}`));
try {
harness.handler.click({ position: { x: 10, y: 20 } });
assert.equal(tracked, null, 'the aircraft does not track');
assert.equal(requests.length, 1, 'the vessel card acts');
assert.equal(
aisLiveVesselsLayer.getSelectedInfo()?.mmsi,
harness.record.mmsi,
);
} finally {
useVesselHost(null);
harness.cleanup();
}
});
// A trail acts for nobody: the vessel's card painted over it still selects,
// and a bare trail pick stays a no-op that keeps the selection.
test('vessel interaction wire: a card over a trail selects; a bare trail is a no-op', () => {
for (const carded of [true, false]) {
const harness = installWireHarness(
{ id: 'gev-trail:fl-a1b2c3:head' },
{ selectedRecord: null },
);
const requests = [];
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
requests.push(event.detail),
);
useVesselHost(
hostWithCardHit(carded ? `vessel:${harness.record.mmsi}` : null),
);
try {
harness.handler.click({ position: { x: 10, y: 20 } });
assert.equal(requests.length, carded ? 1 : 0, `card: ${carded}`);
assert.equal(
aisLiveVesselsLayer.getSelectedInfo()?.mmsi ?? null,
carded ? harness.record.mmsi : null,
);
} finally {
useVesselHost(null);
harness.cleanup();
}
}
});
// A coarse tap on the vessel's card over a fire, nearby or exact: the card on
// top keeps the tap.
test('vessel interaction wire: the card keeps a tap over a nearby or exact fire', (t) => {
const previous = globalThis.matchMedia;
globalThis.matchMedia = () => ({ matches: true });
t.after(() => {
if (previous) globalThis.matchMedia = previous;
else delete globalThis.matchMedia;
});
const fire = 'fire:near-miss';
registerPickOwner('test-exact-fires', (pickedId) => pickedId === fire);
t.after(() => unregisterPickOwner('test-exact-fires'));
for (const exact of [false, true]) {
const harness = installWireHarness(
exact ? { id: fire } : null,
{ selectedRecord: null },
{ drillPick: () => [{ id: fire }] },
);
const requests = [];
harness.windowTarget.addEventListener(WORLD_FOCUS_REQUEST_EVENT, (event) =>
requests.push(event.detail),
);
useVesselHost(hostWithCardHit(`vessel:${harness.record.mmsi}`));
try {
harness.handler.click({ position: { x: 10, y: 20 } });
assert.equal(requests.length, 1, `exact fire: ${exact}`);
assert.equal(
aisLiveVesselsLayer.getSelectedInfo()?.mmsi,
harness.record.mmsi,
);
} finally {
useVesselHost(null);
harness.cleanup();
}
}
});
for (const card of ['live', 'stale', 'absent', 'covered']) {
test(`vessel interaction wire: ${card} foreground card over registered cyclone`, () => {
const id = 'cyclone:fixture:cone:0';
@@ -2020,7 +2165,7 @@ for (const card of ['live', 'stale', 'absent', 'covered']) {
);
return { sourceId: 'cctv', entryId: 'vessel:999999999' };
};
_setVesselOverlayHostForTest(host);
useVesselHost(host);
try {
harness.handler.click({ position: { x: 10, y: 20 } });
assert.equal(
@@ -2029,7 +2174,7 @@ for (const card of ['live', 'stale', 'absent', 'covered']) {
);
assert.equal(requests.length, card === 'live' ? 1 : 0);
} finally {
_setVesselOverlayHostForTest(null);
useVesselHost(null);
harness.cleanup();
unregisterPickOwner('weather-cyclones');
}
+6 -5
View File
@@ -2959,11 +2959,12 @@ export function createBhoteKoshiEventLayer({
: Number.isFinite(clientY) && bounds
? clientY - bounds.top
: Number.NaN;
const hit = overlayHost.hitTest?.(x, y, {
sourceId: BHOTE_KOSHI_OVERLAY_SOURCE_ID,
filter: (entry) => String(entry?.id || '').startsWith('evidence-card-'),
});
if (typeof hit?.entry?.activate !== 'function') return;
// Only the card painted on top acts: an evidence card covered by
// another layer's card or label leaves the click to that card.
const hit = overlayHost.hitTest?.(x, y);
if (hit?.sourceId !== BHOTE_KOSHI_OVERLAY_SOURCE_ID) return;
if (!String(hit.entry?.id || '').startsWith('evidence-card-')) return;
if (typeof hit.entry.activate !== 'function') return;
hit.entry.activate();
}
+9 -1
View File
@@ -2114,6 +2114,7 @@ test('Debris-Dammed Lake card opens its source and is armed for approved local v
};
const viewer = eventViewer();
let activeCard = null;
let coveredBy = null;
const layer = createBhoteKoshiEventLayer({
eventLoader: async () => event,
imagerySpecFactory: async (url) => ({ url }),
@@ -2131,9 +2132,11 @@ test('Debris-Dammed Lake card opens its source and is armed for approved local v
},
setVisible() {},
clearSource() {},
// As the host does: unfiltered, the topmost entry.
hitTest(_x, _y, options) {
if (coveredBy && !options?.sourceId) return coveredBy;
if (!activeCard || options?.filter?.(activeCard) === false) return null;
return { entry: activeCard };
return { sourceId: 'bhote-koshi-witnesses', entry: activeCard };
},
},
renderHost: { request() {}, hold() {}, release() {} },
@@ -2160,6 +2163,11 @@ test('Debris-Dammed Lake card opens its source and is armed for approved local v
} finally {
releasePointer(lease);
}
// Another layer's card painted over the evidence card takes the click.
coveredBy = { sourceId: 'earthquake-card', entryId: 'earthquake-card:q' };
viewer._test.canvas.dispatch('click', { offsetX: 640, offsetY: 420 });
assert.equal(opened.length, 0, 'a covered evidence card does not open');
coveredBy = null;
viewer._test.canvas.dispatch('click', { offsetX: 640, offsetY: 420 });
assert.deepEqual(opened, [[
event.evidenceSpine[1].media.sourceUrl,
+33
View File
@@ -2,6 +2,9 @@ import {
clearOverlaySource,
setOverlayEntries,
} from '../overlays/worldOverlay.js';
import { inputFor } from '../input/dispatcher.js';
import { clickCard } from './pickRegistry.js';
import { isTrackingSelectionGesture } from './trackingClickGesture.js';
import { governorRequestRender } from '../renderGovernor.js';
import { drawOf, findCamera } from '../render/rendererOf.js';
import { hexColor } from '../render/color.js';
@@ -279,8 +282,11 @@ export function createBhoteKoshiLocatorLayer({
cancelFrame = (handle) => cancelAnimationFrame(handle),
scheduleDelay = (callback, delayMs) => setTimeout(callback, delayMs),
cancelDelay = (handle) => clearTimeout(handle),
input = inputFor,
} = {}) {
let _viewer = null;
// The globe click that opens an actionable callout of ours on top.
let _removeClick = null;
const _serial = ++layerSerial;
// Whether the layer draws: from enable until it is let go.
let _drawing = false;
@@ -1107,6 +1113,7 @@ export function createBhoteKoshiLocatorLayer({
renderPresentation();
registerDynamicCredit(viewer, BHOTE_KOSHI_LOCATOR_CREDIT);
showOsmCredit(viewer, BHOTE_KOSHI_LOCATOR_LAYER_ID);
installCalloutClick(viewer);
requestRender('bhote-koshi-locator-callout');
try {
@@ -1141,8 +1148,34 @@ export function createBhoteKoshiLocatorLayer({
}
}
/**
* An actionable callout of ours (the trigger record's) is a card painted
* over the globe: a click on it opens its source, as its keyboard action
* does. Like the other cards, it leaves a drag alone and, on top, takes the
* click over whatever is drawn under it.
*/
function installCalloutClick(viewer) {
if (_removeClick) return;
let clicks = null;
try {
clicks = input?.(viewer) ?? null;
} catch {
clicks = null;
}
_removeClick =
clicks?.onClick?.((event) => {
if (!_enabled || !isTrackingSelectionGesture(event.gesture)) return;
// The card painted on top, read once per click so every layer agrees.
const top = clickCard(event);
if (top?.sourceId !== BHOTE_KOSHI_LOCATOR_OVERLAY_SOURCE_ID) return;
if (typeof top.entry?.activate === 'function') top.entry.activate();
}) ?? null;
}
async function disable() {
hideOsmCredit(_viewer, BHOTE_KOSHI_LOCATOR_LAYER_ID);
_removeClick?.();
_removeClick = null;
_enabled = false;
_boundaryReady = false;
_boundaryResolved = false;
+76
View File
@@ -11,6 +11,11 @@ import {
import { BHOTE_KOSHI_FLOOD_PATH } from './bhoteKoshiFloodPath.js';
import * as Cesium from 'cesium';
import { setLocale } from '../i18n/index.js';
import {
registerPickOwner,
setClickCardHitTest,
unregisterPickOwner,
} from './pickRegistry.js';
import { SceneDirector } from '../scenes/director.js';
import { createPlaybackClock } from '../director/clock.js';
import { createDefaultScenePacks } from '../scenes/packs/defaults.js';
@@ -1049,3 +1054,74 @@ test('Bhote Koshi locator layers draw sets of their own, and halos only as they
assert.equal(await second.disable(), true);
assert.equal(viewer._test.live().length, 0);
});
// The trigger record's callout is an actionable card: the layers under it
// stand aside for it, so a click on it opens its source, as its keyboard
// action does; anything else on top is left alone.
test('a click on the locator callout runs its action', async () => {
const viewer = viewerFixture();
let onClick = null;
let top = null;
const activated = [];
const layer = createBhoteKoshiLocatorLayer({
overlayHost: overlayHostFixture(),
requestRender() {},
...nonRunningAnimation(),
input: () => ({
onClick(callback) {
onClick = callback;
return () => {
onClick = null;
};
},
}),
});
// The card on top at a click, as the host answers the pick registry.
setClickCardHitTest(() => top);
await layer.init(viewer);
await layer.enable(viewer);
const click = (extra = {}) =>
onClick?.({
screenPosition: { x: 5, y: 5 },
gesture: { travelPx: 0, durationMs: 80 },
topHit: null,
hit: null,
...extra,
});
top = {
sourceId: BHOTE_KOSHI_LOCATOR_OVERLAY_SOURCE_ID,
entryId: 'bhote-koshi-trigger-record-callout',
entry: { activate: () => activated.push('trigger') },
};
click();
assert.deepEqual(activated, ['trigger']);
top = {
sourceId: 'earthquake-card',
entry: { activate: () => activated.push('other') },
};
click();
assert.deepEqual(activated, ['trigger'], 'another layer on top is its own');
// A drag that ends on it is not a click on it.
top = {
sourceId: BHOTE_KOSHI_LOCATOR_OVERLAY_SOURCE_ID,
entry: { activate: () => activated.push('trigger') },
};
click({ gesture: { travelPx: 30, durationMs: 80 } });
assert.deepEqual(activated, ['trigger'], 'a drag does not open it');
// On top, it takes the click over an aircraft or a camera under it, exact
// or a touch contact: those layers stand aside under a card.
registerPickOwner('test-planes', (id) => id === 'plane:1');
try {
const plane = { set: 'planes:1', id: 'plane:1' };
const cam = { set: 'cams:1', id: 'cam:1' };
click({ topHit: plane, hit: plane });
click({ topHit: null, hit: plane });
click({ topHit: cam, hit: cam });
assert.equal(activated.length, 4, 'the callout on top acts each time');
} finally {
unregisterPickOwner('test-planes');
setClickCardHitTest(null);
}
await layer.disable();
assert.equal(onClick, null, 'disable removes the click handler');
});
+4 -11
View File
@@ -1020,11 +1020,7 @@ test('CCTV repeated in-world clicks dispatch focus only for the one real activat
);
assert.match(
componentFunctionSource(cctvLayer.init),
/_cctvOverlayHost\.hitTest/,
);
assert.match(
componentFunctionSource(cctvLayer.init),
/sourceId: CCTV_OVERLAY_SOURCE_ID/,
/clickCard\?\.\(event\)/,
);
assert.match(
componentFunctionSource(cctvLayer.init),
@@ -1032,7 +1028,7 @@ test('CCTV repeated in-world clicks dispatch focus only for the one real activat
);
assert.match(
componentFunctionSource(cctvLayer.init),
/activateCctvCameraFromWorldClick\(cardId, setActiveCamera\)/,
/activateCctvCameraFromWorldClick\(\s*top\.entryId,/,
);
});
@@ -1157,11 +1153,8 @@ test('CCTV empty-click gate excludes every identified scene object, ADJUST, and
);
const initSource = componentFunctionSource(cctvLayer.init);
assert.ok(
initSource.indexOf('if (pickedId !== null) return') <
initSource.indexOf('_cctvOverlayHost.hitTest'),
'every identified sibling must win before an overlapping CCTV card hit test',
);
// The real init-bound click route, including identified-object barriers,
// is exercised in layers/cctv/lifecycle.test.mjs.
assert.match(initSource, /activeCameraId: _activeCameraId/);
assert.match(initSource, /calibrationMode: _calibrationMode/);
});
Loaded 100 of 1192 files, more files were not shown because too many files have changed in this diff. Show more