Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.
Location: src/features/cseMachine/components/arrows/GenericArrow.tsx#L203-L207
Potential issue: When an arrow is selected, its source and target nodes are highlighted.
If the user then hovers over and away from a different, unselected arrow that shares a
source or target node, the shared node's highlight is incorrectly removed. This occurs
because the `onMouseLeave` event on the unselected arrow triggers `setNormalStyle()`,
which unconditionally resets the node's style via `setArrowSourceNormalStyle?.()`. This
reset logic is unaware that the node should remain highlighted because it is part of
another arrow that is still selected, leading to incorrect visual feedback for the user.
Bug: Hovering away from an unselected arrow can incorrectly remove the highlight from a shared node that is part of a separate, selected arrow. A video showcasing the same bug is as follows :
doc_2026-03-26_14-15-48.mp4
Severity: CRITICAL
Suggested Fix
Update the
setNormalStyle()andsetArrowSourceNormalStyle()methods. Before resetting a node's style, they should check the global selection state to verify if the node is part of any currently selected arrow. If it is, the highlight style should be maintained instead of being reset.Prompt for AI Agent
Originally posted by @sentry[bot] in #3690 (comment)