Skip to content

CSE Machine : **Bug:** Hovering away from an unselected arrow can incorrectly remove the highlight from a shared node that is part of a separate, selected arrow. #3696

@RichDom2185

Description

@RichDom2185

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() and setArrowSourceNormalStyle() 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
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.

Originally posted by @sentry[bot] in #3690 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't workingminorLess important than important, but more than nice-to-havenice-to-haveIssue is a non-critical, non-important

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions