fix(panels): a collapsed window keeps its chosen height; handle early tile failures

- A floating portable panel saved its measured box, so dragging a
  collapsed window stored its 50 px header strip and a reload clamped it
  to the minimum. It now saves the inline size the user chose. A unit
  test and a collapse -> drag -> reload -> expand step in the panel gate
  pin it.
- Coverage awaits the tile fetch and the one-time terrain table load
  together, so a tile that fails before the table loads is reported at
  once instead of surfacing as an unhandled rejection.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Said TurkseverandClaude Opus 5.5 committed 2026-10-06 23:27:04 +01:00
1 parent 1fa129ea8e
commit f33cd54e2b
5 files changed
+136 -10

No files matched your search

@@ -906,3 +906,27 @@ test('a line across the date line from the camera is in mesh range', () => {
const far = { west: -179.99, east: -179.97, south: -0.001, north: 0.001 };
assert.equal(meshBoxInRange(far, camera), false);
});
test('a tile that fails before the terrain table loads is reported at once, never unhandled', async () => {
const { source, state, coverage, tileKey } = setup();
let terrainLoaded;
state.coverage.terrainReady = new Promise((resolve) => {
terrainLoaded = resolve;
});
const unhandled = [];
const onUnhandled = (reason) => unhandled.push(reason);
process.on('unhandledRejection', onUnhandled);
try {
coverage.refresh();
source.calls
.find((call) => call.key === tileKey)
.reject(new Error('Mapillary tiles HTTP 500'));
await new Promise((resolve) => setTimeout(resolve, 20));
assert.equal(state.coverage.lastError, 'Mapillary tiles HTTP 500');
assert.deepEqual(unhandled, []);
} finally {
terrainLoaded();
await settle();
process.off('unhandledRejection', onUnhandled);
}
});