-
Pre-compute
edgeMapandnodeInstanceMapwithuseMemo, and keep the existingnodeMapas the authoritative node-label lookup for rendered selections.selectEdgeusesedgeMap.get(String(edgeId)).selectNodeusesnodeMap.get(String(nodeId))with the node identifier as the no-entry fallback.selectGraphNodeusesnodeMap.get(String(node.id))with the node identifier as the no-entry fallback.handleRelationshipOptionChangeusesedgeMap.get(value).handleNodeOptionChangeusesnodeInstanceMap.get(value).- Selection handlers must not fall back to
Array.prototype.find()orfindNodeLabel()scans. edgeMapandnodeInstanceMapare first-wins, matchingnodeMapand the previous.find()path. Last-winsnew Map(items.map(...))construction is rejected.
-
Verify the exact branch head from
frontend/with these commands:pnpm test -- src/components/NetworkGraph.test.tsx src/components/NetworkGraph.map-lookup.test.ts pnpm exec eslint src/components/NetworkGraph.tsx src/components/NetworkGraph.test.tsx src/components/NetworkGraph.map-lookup.test.ts pnpm typecheck pnpm build
-
Keep the pull request open until the unchanged exact head has terminal-success required checks, all addressed review threads are resolved, and protected-branch review requirements are satisfied without bypass.