mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-05 02:44:02 +00:00
fix(street-level): settle loading on pan, keep zoom 0, drop late poses
Fixes from gekh's re-review of 061d269, each with a regression test that
fails on the old code:
- A pan that drops a tile still loading now settles the loading count
(the aborted request no longer owns its key, so its `finally` never
did), and purges the previous zoom's tiles once nothing is pending.
LOADING no longer sticks on the status pill and chip.
- Zoom 0 (above 15,000 km) is a zoom: `zoom == null` instead of `!zoom`.
- A pose that arrives after a photo was closed is dropped, in the
MapillaryJS adapter and in the viewer host, so the marker and sequence
selection do not come back.
- Ground casting passes the tile's signal to the terrain request, so a
cancelled tile stops its height batch instead of holding the queue.
- The server's in-memory tile cache honours the 24 h TTL like the disk.
- The viewer's one-time resize runs for every photo, not just the first.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
1 parent
061d2698f5
commit
a5e16e9470
11 files changed
+115
-6
No files matched your search
@@ -404,6 +404,9 @@ export class StreetLevelControls {
|
||||
button.classList.toggle('is-active', active);
|
||||
button.setAttribute('aria-checked', String(active));
|
||||
}
|
||||
// Track open → closed here too, so the next photo gets its resize.
|
||||
const wasOpen = this._viewerWasOpen;
|
||||
this._viewerWasOpen = state.street.open === true;
|
||||
if (!viewer.open) return;
|
||||
if (el.imageBy) el.imageBy.textContent = viewer.captionLeft;
|
||||
if (el.imageWhen) el.imageWhen.textContent = viewer.captionRight;
|
||||
@@ -415,8 +418,7 @@ export class StreetLevelControls {
|
||||
// Size changes reach the viewer through the ResizeObserver; resizing on
|
||||
// every render ran each frame while a panorama was dragged. Opening is the
|
||||
// one moment the element may not have reported a size yet.
|
||||
if (state.street.open && !this._viewerWasOpen) this.layer.resizeViewer?.();
|
||||
this._viewerWasOpen = state.street.open === true;
|
||||
if (state.street.open && !wasOpen) this.layer.resizeViewer?.();
|
||||
}
|
||||
|
||||
_renderMeta(view) {
|
||||
|
||||
@@ -500,4 +500,7 @@ test('the viewer is resized when it opens, not on every render (review #8)', ()
|
||||
assert.equal(layer.calls.resize, 1, 'once on open');
|
||||
for (let i = 0; i < 5; i++) layer.publish(uiState({ open: true }));
|
||||
assert.equal(layer.calls.resize, 1, 'not again while it stays open');
|
||||
layer.publish(uiState({ open: false }));
|
||||
layer.publish(uiState({ open: true }));
|
||||
assert.equal(layer.calls.resize, 2, 'the next photo resizes again');
|
||||
}));
|
||||
Reference in new issue
Block a user