refactor(street-level): trim dead paths, duplicated labels and test-only API

- visibleBbox: no view-rectangle fallback or grid option; its one caller
  always ranges the rays
- tilesForBbox returns the tiles; normalizeBbox takes arrays only
- viewerHost: no try/catch around adapter calls that catch for themselves
- coverage: counts come from the drawn sequences; no sequenceCount export
- one keyStatusLabel for the pill and the layer list
- no constructor source check, double-init guard or selectSequence /
  clearSequence on the layer

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
German KhokhlovandClaude Opus 5.5 committed 2026-10-08 17:04:05 +04:00
1 parent 777aa62586
commit d59b4d05bb
14 files changed
+73 -116

No files matched your search

+3 -4
View File
@@ -1,4 +1,5 @@
import { keySetupRequirement } from '../keySetupCore.mjs';
import { keyStatusLabel } from '../layers/streetLevel/policy.js';
// Street Level UI state to panel strings and flags. Pure, so it is testable.
@@ -59,10 +60,8 @@ const drawing = (state) => state.enabled === true && state.providerOn !== false;
function presentStatus(state) {
const pressed = drawing(state);
const title = pressed ? 'Turn Street Level off' : 'Turn Street Level on';
if (state.keyRejected)
return { text: 'KEY REJECTED', tone: 'warn', pressed, title };
if (state.keyRequired)
return { text: 'KEY REQUIRED', tone: 'warn', pressed, title };
const key = keyStatusLabel(state);
if (key) return { text: key, tone: 'warn', pressed, title };
if (state.coverage.loading)
return { text: 'LOADING', tone: 'busy', pressed, title };
return pressed