Street Level: a replacement keeps its own state, and a posted view stands down

- Releasing a held viewer frees the old source's adapter without resetting
  the panel, so a replacement's error, outcome and armed OPEN survive; a
  cross-source replacement drops the old photo's details and marker.
- The action holds the open photo only for its own switch-off: a source
  switched by hand during the load stops it and reports cancelled.
- A posted view waiting on terrain watches the camera and stands down after a
  navigation or a globe press; a flat or straight-down camera asks no terrain.
- An arming link opens the panel without persisting the layout, and a posted
  view's street-level step runs as programmatic.
- An off-globe street_level point throws TypeError.
- zh-Hant uses the file's wording for the new strings; README and
  CURRENT-STATE count 35 tools.
This commit is contained in:
German Khokhlov committed 2026-11-11 16:05:26 +04:00
1 parent 45a33b54df
commit 4fd36c44e0
14 files changed
+391 -84

No files matched your search

+4 -12
View File
@@ -6,7 +6,6 @@ import { fakeStreetLevelProvider, fakeCesiumViewer } from './testSupport/streetL
import { showStreetLevel } from './voice/gevActions.js';
import { installViews } from './app/embed.js';
import { ShareRestoration } from './ui/shareRestoration.js';
import { createView } from './view/index.js';
import { StreetLevelControls } from './ui/streetLevelControls.js';
import { createApp, nextTick } from 'vue';
import { createPinia } from 'pinia';
@@ -22,11 +21,10 @@ function deferred() {
const promise = new Promise(done => { resolve = done; });
return { promise, resolve };
}
async function harness(t, { nearestImage = async () => 'A', failImage = null, billed = false, extraProviders = [] } = {}) {
async function harness(t, { nearestImage = async () => 'A', failImage = null, extraProviders = [] } = {}) {
document.body.className = '';
document.body.replaceChildren();
const provider = fakeStreetLevelProvider({ nearestImage });
provider.billedPerImage = billed;
const originalCreate = provider.create;
const opened = [];
provider.create = context => {
@@ -50,7 +48,6 @@ async function harness(t, { nearestImage = async () => 'A', failImage = null, bi
layer.attachViewerHost(host);
t.after(() => { layer.destroy(); document.body.className = ''; document.body.replaceChildren(); });
await settle();
assert.equal(layer.providerStatus('mapillary').billed, billed);
const dataManager = {
layers: new Map([['street-level', { module: layer }]]),
getAll: () => [{ id: 'street-level', enabled: true }],
@@ -69,14 +66,9 @@ async function harness(t, { nearestImage = async () => 'A', failImage = null, bi
return { ok: true, latitude: 48, longitude: 2, label: 'fixture point' };
},
};
let result;
const run = async (name, args) => {
if (name !== 'show_street_level') return { ok: true };
result = await showStreetLevel(args, context);
return result;
};
const view = createView({ camera: { lat: 48, lon: 2 }, layers: ['street-level'], street_level: { provider: 'mapillary', lat: 48, lon: 2 } });
return { layer, viewer, dataManager, context, run, view, opened, flights, result: () => result };
const run = (name, args) =>
name === 'show_street_level' ? showStreetLevel(args, context) : Promise.resolve({ ok: true });
return { layer, viewer, dataManager, context, run, opened, flights };
}
test('a landed link does not reclaim a camera the user moved while its layers load', async t => {