From the 2026-07-16 debt review (finding 2). Severity: high.
RouteMapController.kt:600-629 decides "am I in stop focus with this route emphasized?" by whether routeColors[selected.routeDirection] happens to return non-null — a proxy, not a predicate; the controller has the real mode state (stopFocusSession, emphasizedRoute) one line up. The lookup key is built in selectedTripPresentation() (line 680) as activeTrip?.directionId ?: currentDirectionId, while the emphasized route uses presentationDirectionId (lines 156-160, 595) — two independently derived direction values. If a selected vehicle's direction isn't among the focused stop's trip set (e.g. opposite-direction vehicle inside stop focus), the presentation silently degrades to GTFS color + generic underlay — the exact visual #1899 fixed.
Commit 0f9bfa63 shipped no test changes; the decision lives inside the private, stateful publishMapPresentation().
Bonus: in the selected branch, badges (lines 597-599) is provably always empty, so setRouteBadges(badges) at line 627 is an obfuscated emptyList().
Fix (small–medium): extract a pure selectedTripStyle(stopFocusActive, emphasizedRoute, selectedRouteDirection, routeColors, gtfsColor) -> (color, includeUnderlay) into RouteViewGeometry.kt (sibling presentation logic already lives and is tested there) and table-test the four mode combinations.
From the 2026-07-16 debt review (finding 2). Severity: high.
RouteMapController.kt:600-629decides "am I in stop focus with this route emphasized?" by whetherrouteColors[selected.routeDirection]happens to return non-null — a proxy, not a predicate; the controller has the real mode state (stopFocusSession,emphasizedRoute) one line up. The lookup key is built inselectedTripPresentation()(line 680) asactiveTrip?.directionId ?: currentDirectionId, while the emphasized route usespresentationDirectionId(lines 156-160, 595) — two independently derived direction values. If a selected vehicle's direction isn't among the focused stop's trip set (e.g. opposite-direction vehicle inside stop focus), the presentation silently degrades to GTFS color + generic underlay — the exact visual #1899 fixed.Commit
0f9bfa63shipped no test changes; the decision lives inside the private, statefulpublishMapPresentation().Bonus: in the selected branch,
badges(lines 597-599) is provably always empty, sosetRouteBadges(badges)at line 627 is an obfuscatedemptyList().Fix (small–medium): extract a pure
selectedTripStyle(stopFocusActive, emphasizedRoute, selectedRouteDirection, routeColors, gtfsColor) -> (color, includeUnderlay)intoRouteViewGeometry.kt(sibling presentation logic already lives and is tested there) and table-test the four mode combinations.