Problem
public/map.js starts asynchronous node/config loads and delayed invalidateSize() work that can complete after the map page is destroyed or replaced. A simple if (map) guard is insufficient because an old callback can mutate a newly created global map. Multiple loadNodes() calls on one instance can also resolve out of order.
The Path Inspector/control layout additionally overlaps or becomes inaccessible at affected desktop/tablet widths.
Upstream reference: Kpa-clawbot/CoreScope#2048.
Acceptance criteria
- Give every map mount a generation/lifecycle token and every same-instance node load a request generation.
- Async results and delayed callbacks affect only their active generation; only the newest same-instance load renders.
- Destroy cancels timers/listeners where practical and makes remaining work inert.
- Old work cannot clear, recenter, or populate a later map.
- Path Inspector controls remain visible, non-overlapping, and clickable at supported tablet/desktop widths.
- Preserve route rendering, filters, saved viewport, and selected-node behavior.
Tests
Cover navigation during pending requests, quick return, reverse-resolution loads, stale invalidateSize, representative tablet/desktop/short-desktop layouts, and blocked clicks/console errors.
Non-goals
No broad map redesign, data semantic change, or deploy.
Problem
public/map.jsstarts asynchronous node/config loads and delayedinvalidateSize()work that can complete after the map page is destroyed or replaced. A simpleif (map)guard is insufficient because an old callback can mutate a newly created global map. MultipleloadNodes()calls on one instance can also resolve out of order.The Path Inspector/control layout additionally overlaps or becomes inaccessible at affected desktop/tablet widths.
Upstream reference: Kpa-clawbot/CoreScope#2048.
Acceptance criteria
Tests
Cover navigation during pending requests, quick return, reverse-resolution loads, stale
invalidateSize, representative tablet/desktop/short-desktop layouts, and blocked clicks/console errors.Non-goals
No broad map redesign, data semantic change, or deploy.