Tighten coverage prompt comments and docs

This commit is contained in:
German Khokhlov committed 2026-11-06 20:20:11 +04:00
1 parent 3a78f40024
commit 5c4918affb
12 files changed
+31 -54

No files matched your search

+5 -8
View File
@@ -15,8 +15,7 @@ export function createControls({ state: layerState, services, parts, source }) {
updateInterval: STATUS_POLL_MS,
/**
* Keep the manager so camera-driven coverage changes can repaint the row
* before the next status poll.
* Kept so camera moves can repaint the row before the next status poll.
* @param {object} dataManager DataLayerManager instance.
*/
attachDataManager(dataManager) {
@@ -84,18 +83,16 @@ export function createControls({ state: layerState, services, parts, source }) {
lastUpdate: layerState._lastUpdate,
loading,
};
// No system in range is guidance, not an empty feed: the camera is too
// high, or no catalogued system is near the view. A city that failed
// leaves range empty too, and reports its failure below instead.
// No system in range: the camera is too high or no system is near. A
// failed city also leaves range empty and reports its failure below.
if (
layerState._enabled &&
!loading &&
layerState._activeCityIds.size === 0 &&
layerState._failedCityIds.size === 0
) {
// English data (the analyst's empty note to the model, and the Layers
// row's prompt); both show it through translateStatusMessage
// (ui/statusText.js).
// English: the analyst's empty note and the row's prompt, both shown
// through translateStatusMessage (ui/statusText.js).
const note = layerState._altitudeGateEnabled
? `No bike share here yet · ${GBFS_CITY_REGISTRY.length} systems available`
: `Fly below ${Math.round(ACTIVATION_ENTER_ALTITUDE_M / 1000).toLocaleString('en-US')} km to a covered city`;
+2 -5
View File
@@ -1,10 +1,7 @@
// BIKESHARE COVERAGE STATUS — a view with no system says so.
//
// Over a city with no catalogued system (London, Tokyo) the layer drew nothing
// and reported nothing, so its row read "ON · — · GBFS · never": the same as a
// feed that had never answered. These cases pin the rule that replaced it:
// with no system in range the layer reports a guidance status that says why,
// and a view it left keeps no date for data it no longer draws.
// With no system in range (London, Tokyo) the layer says why instead of
// "never", and keeps no date for data it no longer draws.
//
// Run with: npm test
import { test } from 'node:test';
-2
View File
@@ -1,5 +1,3 @@
// Bike Share row repaints: entering a city, leaving it or nudging the camera
// mid-load, and leaving a failed city.
// Bike Share: after the camera settles, the last row the panel painted must
// match what the layer reports now. Each case drives the real viewport,
// ingestion, rendering and controls; the manager is a spy that records the
+1 -4
View File
@@ -116,10 +116,7 @@ export function createViewport({ state: layerState, services, parts, source }) {
parts.rendering.removeCityPoints(cityId);
}
/**
* Repaint the layer's row now. Its text follows the camera (coverage
* prompt, station count), and the manager tick is 60 s.
*/
/** Repaint the row now: it follows the camera, the manager tick is 60 s. */
function refreshRow() {
layerState._dataManager?.refreshLayerStats?.('bikeshare');
}