Objective
- Ensure per-inspector mileage in the Slot Scheduler reflects real routing/distance data instead of a repeated constant (observed 20 miles for every inspector on the same property).
Background
- Reproduced on RIA – 959 Briarleigh; screenshot shows identical miles despite different availability/service-area signals—likely a shared variable, cached default, or Mapbox response handling bug.
Scope
Frontend
- Dispatch slot UI:
attik-frontend/src/app/tools/dispatch/SlotBlock.tsxdisplaysMath.round(slot.info.miles); optimal slot types live insrc/util/types/optimalSlotType.ts(miles: number). - Direction helpers:
src/util/functions/mapbox/mapboxDirectionsIntoMilesTimesStops.tsandStatsBox.tsx(aggregate miles for a route). - Form entry:
SlotSchedulerForm.tsx/DynamicMapBar.tsxfeed the slot search pipeline—trace whereinfo.milesis populated per inspector.
Backend
- If miles are computed server-side for optimal slots, follow the dispatch/slot API from the frontend
useServer/ fetch calls (Decision needed on endpoint names).
References
attik-frontend/src/app/tools/dispatch/SlotBlock.tsxattik-frontend/src/util/types/optimalSlotType.tsattik-frontend/src/util/functions/mapbox/mapboxDirectionsIntoMilesTimesStops.ts
Original description
In the Slot Scheduler, all inspectors appear to be showing a distance of 20 miles for the same property, which looks incorrect and may indicate a regression.
Example observed on RIA - 959 Briarleigh. In the screenshot, multiple inspectors are listed with different availability/service-area states, but each one shows Miles: 20.
This should be checked to confirm whether the distance calculation or display is being incorrectly reused across all inspectors.
Ryan was able to replicate this bug.
Google chat: https://chat.google.com/room/AAQAfgRDZA4/VEno0uzGot8/VEno0uzGot8?cls=10