fix(street-level): Panoramax UX QA — connection budget, coverage to 60 km, Esc, attribution

From a UX QA round in the browser against the live API:
- A line click could time out while coverage loaded: the meta-catalogue
  speaks HTTP/1.1 only (six connections), and six tiles plus four
  searches queued the lookup behind megabyte tiles. Tiles now take
  three connections and searches two; a search that timed out is asked
  once more.
- Between 30 and ~100 km Paris read as empty: the density grid is ~10 km
  a cell. Lines now draw to 60 km (z10), as Mapillary's do; above, dots
  grow with the pictures they stand for.
- Esc in the docked viewer collapsed the whole panel instead of clearing
  the sequence the panel says it clears (shared photo viewer: KartaView
  too). The viewer now offers Esc to the provider first; expanded, the
  dialog keeps it.
- A picture whose producer is an email address is credited to the
  instance holding it (its `via` host), so Licence Ouverte pictures name
  their source.
- Empty states say why: "no Panoramax photos here match the filters"
  when the filter hid every line, and nothing to zoom into over empty
  sea. Wording follows KartaView's ("photos", "click a line for its
  nearest photo").

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Said TurkseverandClaude Opus 5.5 committed 2026-10-14 14:37:45 +01:00
1 parent bce3044e0c
commit 5526666894
14 files changed
+317 -45

No files matched your search

@@ -15,6 +15,7 @@ import {
COLORS,
COVERAGE_LINES_BELOW_M,
COVERAGE_TUNING,
COVERAGE_Z11_BELOW_M,
COVERAGE_Z12_BELOW_M,
COVERAGE_Z13_BELOW_M,
COVERAGE_Z14_BELOW_M,
@@ -24,6 +25,7 @@ import {
LINE_CLICK_RADIUS_PER_HEIGHT,
NEAREST_LIMIT,
NEAREST_RADIUS_M,
FILTERED_HINT,
NO_COVERAGE_HINT,
OVERVIEW_HINT,
PANORAMAX_CREDIT_HTML,
@@ -55,13 +57,22 @@ async function readable(decode) {
}
}
/**
* A density dot's size: busier places draw bigger (2.5 px for one picture,
* 8 px from a few hundred thousand), so a city does not read like farmland.
*/
export function overviewPointSize(point) {
const weight = Math.max(1, Number(point?.weight) || 1);
return Math.min(8, 2.5 + Math.log10(weight));
}
/** Pictures kept in memory by id (lookups and ‹ › fill it). */
const PHOTO_CACHE_SIZE = 2000;
/** Sequences whose cone centre is remembered. */
const ANCHOR_CACHE_SIZE = 50;
/**
* Sequence lines at z11–14 below 30 km; above, the density grid at z5 and
* Sequence lines at z10–14 below 60 km; above, the density grid at z5 and
* coarser.
*/
export function panoramaxZoomFor(heightM) {
@@ -74,7 +85,9 @@ export function panoramaxZoomFor(heightM) {
? 13
: heightM <= COVERAGE_Z12_BELOW_M
? 12
: 11;
: heightM <= COVERAGE_Z11_BELOW_M
? 11
: 10;
return { zoom, kind: 'sequence' };
}
return {
@@ -290,6 +303,7 @@ export function createPanoramaxProvider({
tuning: COVERAGE_TUNING,
messages: { rateLimited: RATE_LIMITED_MESSAGE },
passes: passesCoverage,
overviewPointSize,
});
const cones = createSequenceCones({
@@ -352,6 +366,13 @@ export function createPanoramaxProvider({
onStep: (photoId) =>
context.actions.openImage(photoId, { frame: false }),
onShown: recentreCones,
// Esc in the viewer clears the selected sequence, as the panel says.
onEscape: () => {
if (!state.sequence.selectedId) return false;
cones.clearSelection();
drawn = null;
return true;
},
render: context.services?.render,
...viewerOptions,
});
@@ -417,17 +438,22 @@ export function createPanoramaxProvider({
},
coverageStats() {
const lines = state.coverage.kind === 'sequence';
const { kind } = state.coverage;
const lines = kind === 'sequence';
const drawn = coverage.sequenceCount();
// Density dots are not sequences: they are not counted as such.
const count = lines ? coverage.sequenceCount() : 0;
const count = lines ? drawn : 0;
const loading = state.coverage.pending.size > 0;
const empty =
lines && !loading && count === 0 && !state.coverage.lastError;
const fallback = empty
? NO_COVERAGE_HINT
: state.coverage.kind === 'overview'
? OVERVIEW_HINT
: '';
const settled = !loading && !state.coverage.lastError;
// Lines in view that the filter hid all of: say so, not "none here".
const filteredOut =
lines &&
[...state.coverage.tiles.values()].some((tile) => tile.total > 0);
let fallback = '';
if (kind === 'overview')
fallback = drawn > 0 || !settled ? OVERVIEW_HINT : NO_COVERAGE_HINT;
else if (lines && settled && count === 0)
fallback = filteredOut ? FILTERED_HINT : NO_COVERAGE_HINT;
return {
count,
zoom: state.coverage.zoom,