Scope tracked readouts and selection context to each scene

Give each scene attachment its own tracked readout, follow subscription,
selected context, active card identity and label-subject cache. Bind layer
context publishers to that attachment and preserve the page selection slot
and existing selection and awareness event payloads. Mirror a clear to the
page only when it clears the page selection. Capture display context
services so retired callbacks cannot publish into a replacement attachment.
Route aircraft, satellite, Local ADS-B and ALPR label refreshes and annotation
card lookup to the attached readout. Remove Local ADS-B contexts before
dropping its outgoing renderer, and mirror context pruning to the page.

Carry the retained page selection through the layer session when an attachment
is released. Adopt it only if the page still selects the same record, seed the
incoming readout on initialization, and replace its retained carrier when the
new display registers its marker. Keep the original page selection timestamp
and avoid a duplicate page selection event. A clear between attachments wins,
and page teardown still clears the selection. Seed the incoming readout from
that retained record without validating the outgoing display's visibility:
FIRMS waits for camera restoration before registering its new display. Keep a
matching selected fire in the refresh set before pruning top-N contexts, so
weaker selected detections retain the page selection too.

Preserve Cesium's label text, selected-card policy, visual anchors and
follow-camera anti-jitter. Navara retains the same shared behavior. There is
no intended user-visible change on either engine. Tests cover simultaneous
follows, identical selection IDs, independent refresh and clear, stale
notifications, destruction, parked reattachment and real layer publication
on the fake and headless Cesium engines. The production aircraft tests also
cover grounded fleet and tracked models, the display floor on both sides of
the zoom boundary, follow-label refresh and cached position reads. The fire
regression exercises the application scene handoff, delayed viewport resume,
top-N pruning, unchanged selection timestamp and deliberate clear on both
engines. These fixes preserve the reference Cesium selection behavior.

All eleven coupling counts remain unchanged; none fell or grew. The counts
remain 0 and 189 renderer lines, 3 external Cesium import files, 891 viewer
lines, 1 Navara kind check, 0 engine-sniff calls, 3 extension reads, 1 ground
pass, 3 SDK loads, 4 screen-handler files and 32 engine-name lines.

Checked in the browser, keyless: the overlay baselines on both engines, the
ALPR and FIRMS fire-camera switches, and the layer handoff, Local ADS-B,
Contacts, space, infrastructure, CCTV, urban, transit, directions and
annotation engine switches pass. The tracking regression passes every check
that passes before this change.
This commit is contained in:
German Khokhlov committed 2026-11-07 21:14:09 +04:00
1 parent 3814221cbc
commit c1e857f798
32 files changed
+1751 -414

No files matched your search

+13 -2
View File
@@ -290,8 +290,19 @@ one application, and only the globe-bound parts move to the next engine.
models resolve their attached engine, and the shell reconnects its action
subscription after switching. Destroyed services and old lane handles stay
inert; a parked engine receives a new host. Shared font measurements live
until the last host detaches. The tracked readout remains page-owned and
publishes into the attached overlay; its event isolation is separate work.
until the last host detaches.
- **Scene tracked readouts.** `scene.services.trackedReadout` owns the follow
subscription, selected card, active entry ID and follow-label cache for one
attachment. It publishes only into that scene's overlay. Selection records
and notifications belong to `scene.services.context`; publishers resolve
their attached engine. The existing page context slot and selection events
remain available to page consumers with the same payloads. Destroyed readouts
and context services stay inert; parked reattachment creates fresh services.
Engine handoff carries the retained page selection into the incoming context;
rebuilding its marker updates the readout without another page selection event.
Readout initialization leaves the selection intact while its outgoing display
is hidden and its incoming layer waits for camera restoration.
Label text, live visual anchors and follow-camera anti-jitter are unchanged.
- **The session owns the state.** Catalog, layer models, sources, selection,
camera mode and URL state outlive a switch. A layer that is a session model
gets `attachRenderer(viewer, { engine })` / `detachRenderer()` instead of being rebuilt,