fix(street-level): one keydown listener on the photo root; format scope listed a test twice

Esc moved to the viewer's box (`.sl-viewer-wrap`) in the last commit, but
without one it was a second keydown listener on the root; Esc is now taken
by the root's own handler there. format-scope.json listed
panorama.test.mjs twice, which made the formatter refuse the scope; the
files it skipped are formatted.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Said TurkseverandClaude Opus 5.5 committed 2026-10-14 15:25:58 +01:00
1 parent cf502429a3
commit 1a546bec72
14 files changed
+96 -30

No files matched your search

@@ -78,8 +78,7 @@ export function decodeCoverageTile(bytes, address) {
const props = feature.properties || {};
const parts = [];
let length = 0;
const tolerance =
(SIMPLIFY_TOLERANCE_UNITS * sequences.extent) / 4096;
const tolerance = (SIMPLIFY_TOLERANCE_UNITS * sequences.extent) / 4096;
for (const line of feature.loadGeometry()) {
if (line.length < 2) continue;
for (let k = 1; k < line.length; k++)
@@ -191,8 +191,15 @@ test('a z15 tile’s pictures of one sequence become cones; other sequences’ a
});
test('lines are simplified within a few tile units, ends and corners kept', () => {
const zigzag = Array.from({ length: 1000 }, (_, i) => ({ x: i, y: i % 2 ? 1 : 0 }));
assert.deepEqual(simplifyLine(zigzag, 4), [zigzag[0], zigzag.at(-1)], 'a 1-unit wobble goes');
const zigzag = Array.from({ length: 1000 }, (_, i) => ({
x: i,
y: i % 2 ? 1 : 0,
}));
assert.deepEqual(
simplifyLine(zigzag, 4),
[zigzag[0], zigzag.at(-1)],
'a 1-unit wobble goes',
);
const corner = [
{ x: 0, y: 0 },
{ x: 50, y: 1 },
@@ -221,6 +228,9 @@ test('a decoded GPS track keeps a fraction of its points', () => {
encodePanoramaxTile(tile, { sequences: [{ id: 'gps', parts: [track] }] }),
tile,
).sequences;
assert.ok(sequence.parts[0].length < 100, `${sequence.parts[0].length} points`);
assert.ok(
sequence.parts[0].length < 100,
`${sequence.parts[0].length} points`,
);
assert.ok(sequence.parts[0].length > 5);
});
@@ -227,7 +227,12 @@ test('hostile item data: a malformed link escape, null coordinates, a huge produ
});
test('the instance holding a picture is named (its via host), never as its author', () => {
const item = stacItem({ id: 'a', lon: 1, lat: 2, producer: '[email protected]' });
const item = stacItem({
id: 'a',
lon: 1,
lat: 2,
producer: '[email protected]',
});
item.links.push({ rel: 'via', href: 'https://panoramax.ign.fr' });
assert.equal(normalizeItem(item).creator, null);
assert.equal(normalizeItem(item).via, 'panoramax.ign.fr');
@@ -543,7 +543,12 @@ test('a broken neighbour z15 tile only thins the cones; an unreadable home tile
const box = tileBounds(home.tile.x, home.tile.y, 15);
const at = { lon: box.west + 0.0003, lat: box.north - 0.0002 };
const items = [0, 1, 2].map((i) =>
stacItem({ id: `c-${i}`, sequenceId: 'c', lon: at.lon + i * 0.00005, lat: at.lat }),
stacItem({
id: `c-${i}`,
sequenceId: 'c',
lon: at.lon + i * 0.00005,
lat: at.lat,
}),
);
const tiles = pictureTiles(items);
const broken = new TextEncoder().encode('<html>oops</html>');
@@ -835,7 +840,10 @@ test('a search hit outside the radius (a bounding box’s corner) is not the nea
});
test('a line clicked from low down still searches its own sequence within 50 m', async () => {
const items = [...sequence('other', 1, { offset: 2 }), ...sequence('clicked', 1, { offset: 30 })];
const items = [
...sequence('other', 1, { offset: 2 }),
...sequence('clicked', 1, { offset: 30 }),
];
const { instance, source } = setup({ items });
instance.init({
camera: { positionCartographic: { height: 300 } },
@@ -885,7 +893,9 @@ test('a filter that hides every density dot says so', async (t) => {
grid: [{ lon: ORIGIN.lon, lat: ORIGIN.lat, pano: 0, flat: 5 }],
});
env.instance.activate(env.viewer);
assert.ok(await until(() => env.instance.coverageStats().hint === FILTERED_HINT));
assert.ok(
await until(() => env.instance.coverageStats().hint === FILTERED_HINT),
);
});
test('dots are drawn at their own sizes, and the busiest is the biggest', async (t) => {
@@ -338,7 +338,9 @@ test('a Retry-After is honoured up to five minutes', async () => {
headers: { 'retry-after': header },
})).fetchImpl,
});
return source.getTile({ x: 0, y: 0, z: 0 }).catch((error) => error.retryAfterSec);
return source
.getTile({ x: 0, y: 0, z: 0 })
.catch((error) => error.retryAfterSec);
};
assert.equal(await wait('3600'), 300);
assert.equal(await wait('99999999999'), 300);
@@ -179,10 +179,19 @@ test('a 360° picture shows its SD equirectangular image, then HD shrunk to 4,09
test('HD panoramas too big to decode, or no bigger than SD, are never fetched; nor while docked', () => {
const size = [4096, 2048];
const expanded = { expanded: true };
assert.equal(PANORAMAX_SOURCES.panoSharp(PHOTOS.pano, size, { expanded: false }), null);
assert.equal(
PANORAMAX_SOURCES.panoSharp(PHOTOS.pano, size, { expanded: false }),
null,
);
assert.equal(PANORAMAX_SOURCES.panoSharp(PHOTOS.pano, size), null);
assert.equal(PANORAMAX_SOURCES.panoSharp(PHOTOS.bigPano, size, expanded), null);
assert.equal(PANORAMAX_SOURCES.panoSharp(PHOTOS.smallPano, size, expanded), null);
assert.equal(
PANORAMAX_SOURCES.panoSharp(PHOTOS.bigPano, size, expanded),
null,
);
assert.equal(
PANORAMAX_SOURCES.panoSharp(PHOTOS.smallPano, size, expanded),
null,
);
assert.deepEqual(
PANORAMAX_SOURCES.panoSharp({ ...PHOTOS.pano, width: 3000 }, size, expanded)
.resize,