mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
feat(street-level): camera follow only on the Google 3D map
FOLLOW puts the globe camera at eye height inside the street-level view; on flat imagery or terrain there is nothing to stand among. The layer now takes the application map stack controller (attachMapStackController), subscribes to stack switches, offers FOLLOW only while the stack is 'photoreal', disables the button with a MAP SOURCE hint elsewhere, and stops following when the stack leaves Google 3D. Selection uninstall is a no-op when never installed. The QA gate checks the disabled path and, when Google 3D is available, that leaving it stops following; its caption-timeout dump now forces one render to tell a missed update from a render fault. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
f7456f2436
commit
c7dc3146f2
14 files changed
+246
-12
No files matched your search
@@ -889,5 +889,6 @@
|
||||
"src/layers/streetLevel/providers/mapillary/provider.test.mjs",
|
||||
"src/layers/streetLevel/providers/mapillary/decode.test.mjs",
|
||||
"src/ui/panelDock.test.mjs",
|
||||
"src/layers/streetLevel/viewerHost.test.mjs"
|
||||
"src/layers/streetLevel/viewerHost.test.mjs",
|
||||
"src/layers/streetLevel/index.test.mjs"
|
||||
]
|
||||
@@ -408,8 +408,16 @@ async function main() {
|
||||
const u = window.__godsEyeView.dataManager.layers
|
||||
.get('street-level')
|
||||
.module.getUIState();
|
||||
// Force one more render: a caption that fills now means an update
|
||||
// was missed; one that stays empty means the render path is wrong.
|
||||
u.street.renderMode &&
|
||||
window.__godsEyeView.dataManager.layers
|
||||
.get('street-level')
|
||||
.module.setViewerRenderMode(u.street.renderMode);
|
||||
return {
|
||||
street: u.street,
|
||||
captionNodes: document.querySelectorAll('#sl-image-when').length,
|
||||
captionNow: document.getElementById('sl-image-when').textContent,
|
||||
wrapHidden: document.getElementById('sl-viewer-wrap').hidden,
|
||||
collapsed: document
|
||||
.getElementById('street-level-panel')
|
||||
@@ -460,6 +468,55 @@ async function main() {
|
||||
assert.match(view.href, /mapillary\.com\/app\/\?pKey=/);
|
||||
},
|
||||
);
|
||||
await step('FOLLOW is offered only on the Google 3D map', async () => {
|
||||
const stacks = () => window.__godsEyeView.mapStackController;
|
||||
const follow = () =>
|
||||
page.$eval('#sl-follow-btn', (node) => ({
|
||||
disabled: node.disabled,
|
||||
pressed: node.getAttribute('aria-pressed'),
|
||||
title: node.title,
|
||||
}));
|
||||
const setStack = async (id) => {
|
||||
await page.evaluate(
|
||||
(stackId) =>
|
||||
window.__godsEyeView.mapStackController.setStack(stackId),
|
||||
id,
|
||||
);
|
||||
await sleep(800);
|
||||
};
|
||||
const original = await page.evaluate(() =>
|
||||
window.__godsEyeView.mapStackController.getActiveId(),
|
||||
);
|
||||
await setStack('esri-imagery');
|
||||
let state = await follow();
|
||||
assert.equal(state.disabled, true, 'disabled on Esri');
|
||||
assert.match(state.title, /needs the Google 3D map/);
|
||||
const photoreal = await page.evaluate(() =>
|
||||
window.__godsEyeView.mapStackController.isStackAvailable('photoreal'),
|
||||
);
|
||||
if (photoreal) {
|
||||
await setStack('photoreal');
|
||||
state = await follow();
|
||||
assert.equal(state.disabled, false, 'enabled on Google 3D');
|
||||
await page.click('#sl-follow-btn');
|
||||
await sleep(300);
|
||||
assert.equal((await follow()).pressed, 'true');
|
||||
await setStack('esri-imagery');
|
||||
state = await follow();
|
||||
assert.equal(
|
||||
state.pressed,
|
||||
'false',
|
||||
'leaving Google 3D stops following',
|
||||
);
|
||||
assert.equal(state.disabled, true);
|
||||
} else {
|
||||
console.log(
|
||||
' (Google 3D unavailable here: only the disabled path ran)',
|
||||
);
|
||||
}
|
||||
await setStack(original);
|
||||
void stacks;
|
||||
});
|
||||
await step(
|
||||
'EXPAND opens a modal dialog and Esc returns focus to the button',
|
||||
async () => {
|
||||
@@ -624,12 +681,8 @@ async function main() {
|
||||
await step(
|
||||
'on a phone the whole photo fits in the docked panel',
|
||||
async () => {
|
||||
await page.setViewport({
|
||||
width: 390,
|
||||
height: 844,
|
||||
isMobile: true,
|
||||
hasTouch: true,
|
||||
});
|
||||
// Width alone drives the phone layout; toggling isMobile would reload.
|
||||
await page.setViewport({ width: 390, height: 844 });
|
||||
await sleep(800);
|
||||
if (
|
||||
await page.$eval('#street-level-panel', (node) =>
|
||||
|
||||
Reference in new issue
Block a user