refactor(street-level): drop hover, legend and byte-budget cache; flatten the provider directory

- No pointer cursor over coverage lines (no other layer has one); a click
  test replaces the hover tests.
- No legend: one source, one colour.
- The on-globe credit lives in index.js; credits.js is gone.
- Billboard glyphs are SVG data URLs with the same geometry, so tests need
  no canvas stub.
- The tile cache keeps the 120 most recently used tiles, same 24 h TTL,
  instead of a byte budget; listTileLayers was test-only.
- providers/mapillary/ is flattened into the layer and its policy merged
  into one policy.js; the source's method list is a literal in the catalog.
- One fakeCesiumViewer for the layer tests.
- The fixture gate keeps the steps the unit tests do not cover: coverage and
  credit, a rejected key, line -> cone -> photo, close, a keyless page.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
German KhokhlovandClaude Fable 5.1 committed 2026-10-08 19:17:45 +04:00
1 parent 34d43c7e3f
commit e214129e45
41 files changed
+335 -909

No files matched your search

+2 -4
View File
@@ -24,8 +24,8 @@ const setAttr = (node, key, value) => {
};
/**
* Fills the Street Level panel body: filters, legend and viewer. The panel
* chrome itself belongs to the application shell.
* Fills the Street Level panel body: filters and viewer. The panel chrome
* itself belongs to the application shell.
*/
export class StreetLevelControls {
constructor({ root, layer, actions }) {
@@ -58,7 +58,6 @@ export class StreetLevelControls {
errorText: byId('sl-error-text'),
sinceRange: byId('sl-since'),
sinceLabel: byId('sl-since-label'),
legend: byId('sl-legend'),
viewerWrap: byId('sl-viewer-wrap'),
viewerExpand: byId('sl-viewer-expand'),
viewerClose: byId('sl-viewer-close'),
@@ -376,7 +375,6 @@ export class StreetLevelControls {
setAttr(el.sinceRange, 'aria-valuetext', view.since.label);
}
}
setProp(el.legend, 'hidden', !view.legend);
}
_renderViewer(view) {
-6
View File
@@ -223,7 +223,6 @@ function panelDom({ fullscreen = true, popover = false } = {}) {
add(controls, 'button', { dataset: { slPano: pano } });
add(controls, 'input', { id: 'sl-since' });
add(controls, 'output', { id: 'sl-since-label' });
add(root, 'ul', { id: 'sl-legend' });
add(root, 'div', { id: 'sl-coverage-meta' });
return { document, root, wrap };
}
@@ -475,11 +474,6 @@ test('a layer that is on with Mapillary switched off reads OFF, and the pill bri
dom.root.querySelector('#sl-coverage-meta').textContent,
/Mapillary is off in this view/,
);
assert.equal(
dom.root.querySelector('#sl-legend').hidden,
true,
'no legend',
);
status.click();
await settle();
assert.deepEqual(calls.setParams, [
-1
View File
@@ -130,7 +130,6 @@ export function presentStreetLevelPanel(state, { now = Date.now() } = {}) {
null,
filter: { pano: filter.pano, sinceDays: Number(filter.sinceDays) || 0 },
since: presentSince(filter.sinceDays, now),
legend: state.providerOn !== false,
viewer: presentViewer(state),
meta: presentMeta(state),
};
+1 -37
View File
@@ -118,7 +118,7 @@
color: #ff8a80;
}
/* ── Filters and legend ──────────────────────────────────────────────────── */
/* ── Filters ──────────────────────────────────────────────────── */
.sl-filters {
display: flex;
align-items: center;
@@ -196,42 +196,6 @@
color: var(--text-primary);
}
.sl-legend {
display: flex;
flex-wrap: wrap;
gap: 4px 12px;
margin: 0;
padding: 0;
list-style: none;
}
.sl-legend li {
display: inline-flex;
align-items: center;
gap: 6px;
font-family: var(--font-mono);
font-size: var(--sl-text);
letter-spacing: 0.06em;
color: var(--text-secondary);
}
.sl-legend[hidden] {
display: none;
}
.sl-legend-swatch {
width: 14px;
height: 3px;
border-radius: 2px;
display: inline-block;
background: var(--sl-green);
}
/* COLORS.selected in src/layers/streetLevel/policy.js */
.sl-legend-swatch.is-selected {
background: #00d4ff;
}
/* ── Embedded viewer ─────────────────────────────────────────────────────── */
.sl-viewer-wrap {
position: relative;
-4
View File
@@ -124,10 +124,6 @@
<output id="sl-since-label" class="sl-since-label" for="sl-since">ANY DATE</output>
</div>
</fieldset>
<ul id="sl-legend" class="sl-legend" aria-label="Coverage colours">
<li><i class="sl-legend-swatch"></i><span>Mapillary</span></li>
<li><i class="sl-legend-swatch is-selected"></i><span>Selected</span></li>
</ul>
<div id="sl-coverage-meta" class="sl-meta"></div>
</div>
</div>