HI-FI: Route Colors#128
Conversation
|
Hey @KesarSidhu — thanks for the PR! The color palette implementation is clean and the PR description doesn't match the diff Scope Directions API billing Minor: comments in
The good stuff — |
|
Nice work overall — the cancellation pattern and state-update guards in particular are well thought out. A few things worth discussing before merge: Map polylines don't pick up the per-route colors The sidebar uses Re-render cascade causes polylines to be recreated twice on load The flow is: Directions result arrives → Module-level cache has no TTL
Minor: It's cheap, but moving it to a |
cad6f25 to
4726f46
Compare
|
The latest round addresses all the feedback — per-route colors land on the map now, One thing is still missing before this is mergeable: // Map.tsx:273 — callback never passed
<RoutePolylinesOverlay routes={routes} pendingPinMove={pendingPinMove} />
Related: once that's wired up, Minor: two palette entries used as text color on a white background ( |
Co-authored-by: Cursor <cursoragent@cursor.com>
f832d60 to
3058008
Compare
Summary
Per-route colors in the sidebar and road-following polylines on the map. Directions API supplies driving geometry and can update each route’s
distanceMi; a coordinate-keyed cache limits repeat Directions calls.Motivation
Routes were hard to distinguish when all map lines were the same color while the sidebar needed per-route accents. Reviewers also wanted driving paths and distance from Directions instead of straight lines only.
Changes
routeColors.ts— Five-color palette;routeColorHex(routeIndex)for consistent route colors.Sidebar.tsx— Left border, swatch, and route title userouteColorHex(idx).Map.tsx— Directions polylines, cache (path + meters),onRouteDistanceUpdate, straight-line fallback when Directions fails or waypoints > 25.page.tsx—handleRouteDistanceUpdateupdatesdistanceMiwhen the map reports a new value.Validation
npm --prefix app/ui run lintnpm --prefix app/ui run build/results: sidebar colors match map polylines.Risk
Low — UI-only; existing directions/distance behavior preserved with caching and cleanup on unmount.
Rollout and Recovery
Ship with results page; revert PR if palette or map styling needs adjustment.