Vue kit: Street Level's photo viewer is a view with kit buttons

The photo viewer KartaView and Panoramax share (photoViewer.js) no longer
builds its root, picture, panorama canvas and ‹ › buttons in script. It
presents them through subscribeView(), which the street-level layer
gathers in subscribePhotoViewer(); the application shell publishes that
to the gev-street-level-photo store, and StreetLevelPhotoViewer, beside
the Street Level panel in the layer panels, teleports the viewer into the
viewer host with the same classes, data attributes, labels and order. Its
‹ and › are ghost UiButtons. The view forwards keys, pointers, wheel, the
step clicks and a lost WebGL context to the viewer and hands each element
back: the canvas the panorama is drawn on (a fresh, keyed one after a lost
context, which an open now waits for), and the frame, picture, root and
buttons the viewer measures and keeps focus with. The viewer keeps every
decision: loading, upgrades, size limits, keys, drag, pinch, zoom, Esc on
the viewer's box and focus when a step button disables. The street-level
layer still needs no Vue; with no view subscribed these photos cannot
mount, which docs/VUE-MIGRATION.md records.

The provider and viewer tests draw the viewer with a fake view in
kartaViewFakes.mjs; StreetLevelPhotoViewer.test.mjs runs the real view on
a page, and streetLevelPhotoControls.test.mjs pins the kit controls. The
panel page's lost-graphics notice in globePanelRuntime.js stays built in
script, as the document now says.

Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
Sameh KhamisandManjunath Paparaju committed 2026-11-19 13:33:58 -08:00
1 parent 9423a26487
commit 766364f691
20 files changed
+911 -112

No files matched your search

+15
View File
@@ -65,6 +65,7 @@ import { useContextStore } from './stores/context.js';
import { useSpaceMissionsStore } from './stores/spaceMissions.js';
import { SpaceMissionsControls } from './spaceMissionsControls.js';
import { useMissionReplayStore } from './stores/missionReplay.js';
import { useStreetLevelPhotoStore } from './stores/streetLevelPhoto.js';
import { useCelestialRingStore } from './stores/celestialRing.js';
import { icrfToFixedAxes } from '../sky/icrf.js';
import { useWorldOverlayActionsStore } from './stores/worldOverlayActions.js';
@@ -1200,7 +1201,18 @@ export class StyleManager extends ShellFacade {
const { streetLevelLayer } = this.services;
this._streetLevelControls?.destroy();
this._streetLevelControls = null;
// The photo viewer (KartaView, Panoramax), which the layer panels draw
// into the viewer host. A viewer left by an earlier shell must
// not outlive its layer.
const streetLevelPhotoStore = useStreetLevelPhotoStore(applicationPinia());
this._streetLevelPhotoUnsubscribe?.();
this._streetLevelPhotoUnsubscribe = null;
streetLevelPhotoStore.publish(null);
if (!this._streetLevelPanel || !streetLevelLayer) return;
this._streetLevelPhotoUnsubscribe =
streetLevelLayer.subscribePhotoViewer?.((view) =>
streetLevelPhotoStore.publish(view),
) ?? null;
// Photo framing yields to newer navigation and releases tracking like
// any deferred flight.
streetLevelLayer.attachNavigation?.({
@@ -1969,7 +1981,10 @@ export class StyleManager extends ShellFacade {
this._spaceMissionsControls = null;
this._missionReplayUnsubscribe?.();
this._missionReplayUnsubscribe = null;
this._streetLevelPhotoUnsubscribe?.();
this._streetLevelPhotoUnsubscribe = null;
useMissionReplayStore(applicationPinia()).publish(null);
useStreetLevelPhotoStore(applicationPinia()).publish(null);
const contextStore = useContextStore(applicationPinia());
contextStore.connectAwareness(null);
contextStore.publishAwareness(null);