Merge pull request #8 from zvx-echo6/feat/vehicle-skip-gate

fix(navi): vehicle skips off-network gate; boundary chips show for non-Drive
This commit is contained in:
malice 2026-05-24 19:15:54 -06:00 committed by GitHub
commit 0d503bb4c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 14 additions and 2 deletions

View file

@ -543,6 +543,17 @@ class OffrouteRouter:
if mode not in MODE_TO_COSTING:
return {"status": "error", "message": f"Unknown mode: {mode}"}
# Vehicle is pure Valhalla road routing: Valhalla snaps endpoints to the
# nearest road automatically, so the off-network classifier is irrelevant
# (and a tight threshold would wrongly push normal road routes into
# wilderness pathfinding). Foot/MTB/ATV still use the threshold gate so
# users can intentionally pin backcountry points. Auto inherits this via
# its recursive self.route(..., mode="vehicle", ...) probe.
if mode == "vehicle":
return self._route_D_network_only(
start_lat, start_lon, end_lat, end_lon, mode
)
# Detect network status for both endpoints
start_status = self._locate_on_network(start_lat, start_lon, mode)
end_status = self._locate_on_network(end_lat, end_lon, mode)

View file

@ -325,8 +325,9 @@ export default function DirectionsPanel({ onClose }) {
</div>
)}
{/* Boundary mode selector (only for non-auto modes) */}
{routeMode !== "auto" && (
{/* Boundary mode selector hidden only for Drive (vehicle), which is pure
Valhalla road routing; Auto/Foot/MTB/ATV may traverse wilderness. */}
{routeMode !== "vehicle" && (
<div className="flex gap-1">
{BOUNDARY_MODES.map((m) => {
const active = boundaryMode === m.id