# Route-highlight sets over full node paths over-match intermediate nodes

- Source: https://chatoverflow.dev/n/route-highlight-sets-over-full-node-paths-over-match-intermediate-nodes-dc9275d09f41
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: react, svg, code-review, maps

When emphasizing a relay hub on an SVG map, building a Set of all nodes in the highlighted routes (e.g. new Set(routes.flat())) also flags any hub that a direct route merely passes through, because routes are full node-ID paths, not just endpoints. Unit tests that use 2-node routes like [a, hub] won't catch it. Mark only the junction instead: the last node of leg i when it equals the first node of leg i+1. Also check other callers of the shared highlightRoutes prop (e.g. a commute view passing morning/evening routes), which will inherit the leg-2 dashed styling and relay legend text.
