Fix user-visible labels: MTB->2W, ATV->4W + grep cleanup

Update the user-facing travel-mode labels to match the renamed ids:
- DirectionsPanel TRAVEL_MODES (2w -> "2W", 4w -> "4W") + SELECTED_MODE_LABEL values.
- Panel TRAVEL_MODES labels.
- Stale test comment: mode=mtb -> mode=2w.

Grep pass over frontend/src + backend/services/navi_offroute found no remaining
mode-identifier string literals to rename. Residual hits are all out-of-scope: MVUM
vehicle-access vocabulary (mvum.py, /api/mvum output, single-quoted test fixtures), the
cost.py __main__ demo locals, the offroute_route.py back-compat shim, and comments
referencing the historical names.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt 2026-05-25 21:29:36 +00:00
commit 41048578aa
3 changed files with 6 additions and 6 deletions

View file

@ -691,7 +691,7 @@ def test_pathfind_wilderness_always_uses_foot_effort(monkeypatch):
out = r._pathfind_wilderness(44.0, -115.0, 44.001, -115.001, ep, "pragmatic", "start", mode="2w")
assert out["status"] == "ok"
assert captured["mult_mode"] == "foot" # cost grid built as foot despite mode=mtb
assert captured["mult_mode"] == "foot" # cost grid built as foot despite mode=2w
assert captured["speed_function_id"] == 0 # tobler (foot)
assert captured["base_speed"] == 6.0 # foot base speed
assert captured["lookup"][5] == 0.1 # foot road

View file

@ -10,13 +10,13 @@ import ManeuverList from "./ManeuverList"
const TRAVEL_MODES = [
{ id: "auto", label: "Auto", Icon: Zap },
{ id: "foot", label: "Foot", Icon: Footprints },
{ id: "2w", label: "MTB", Icon: Bike },
{ id: "4w", label: "ATV", Icon: Car },
{ id: "2w", label: "2W", Icon: Bike },
{ id: "4w", label: "4W", Icon: Car },
{ id: "vehicle", label: "Drive", Icon: Car },
]
// Maps the backend's selected_mode to the chip label shown in the "Auto chose X" badge.
const SELECTED_MODE_LABEL = { vehicle: "Drive", "4w": "ATV", "2w": "MTB", foot: "Foot" }
const SELECTED_MODE_LABEL = { vehicle: "Drive", "4w": "4W", "2w": "2W", foot: "Foot" }
const BOUNDARY_MODES = [
{ id: "strict", label: "Strict", Icon: Shield, title: "Avoid barriers" },

View file

@ -14,8 +14,8 @@ import PlaceDetail from './PlaceDetail'
const TRAVEL_MODES = [
{ id: 'auto', label: 'Drive', Icon: Car },
{ id: 'foot', label: 'Foot', Icon: Footprints },
{ id: '2w', label: 'MTB', Icon: Bike },
{ id: '4w', label: 'ATV', Icon: Car },
{ id: '2w', label: '2W', Icon: Bike },
{ id: '4w', label: '4W', Icon: Car },
{ id: 'vehicle', label: '4x4', Icon: Car },
]