Skip to content

Comments

fix(1707, 1708): fix path-to-component visibility and hover animation#654

Open
juliankepka wants to merge 6 commits intomainfrom
path-to-component-fix
Open

fix(1707, 1708): fix path-to-component visibility and hover animation#654
juliankepka wants to merge 6 commits intomainfrom
path-to-component-fix

Conversation

@juliankepka
Copy link
Collaborator

Issues: l3montree-dev/devguard#1707 and l3montree-dev/devguard#1708

Die Hover oder Klickmöglichkeit ist bei allen States außer Open nicht mehr gegeben.

Bildschirmfoto 2026-02-19 um 14 59 02

Copilot AI review requested due to automatic review settings February 19, 2026 17:59
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses issues #1707/#1708 by restoring clear interaction affordances (hover/click vs drag) in the dependency graph “path-to-component” view, especially when the context menu is disabled for non-open vulnerability states.

Changes:

  • Plumbs enableContextMenu through getLayoutedElements into node data so node rendering can react to it.
  • Adjusts DependencyGraphNode cursor styling based on enableContextMenu (pointer vs grab).
  • Adds a small UI hint and a cursor override for edges when context menu interactions are disabled.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/utils/dependencyGraphHelpers.ts Adds enableContextMenu param and forwards it into node data for downstream UI behavior.
src/components/DependencyGraphNode.tsx Switches node cursor classes based on data.enableContextMenu.
src/components/DependencyGraph.tsx Passes enableContextMenu into layout generation and adds UI/edge cursor behavior for non-context-menu mode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines 182 to 186
childrenLimitMap,
previousNodesRef.current,
handleExpansionToggle,
enableContextMenu,
);
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enableContextMenu is passed into getLayoutedElements, but it’s not included in the useMemo dependency list for computing initialNodes/initialEdges. If enableContextMenu changes (e.g. when vuln state changes), node data.enableContextMenu (and thus cursor/interaction affordance) can stay stale. Add enableContextMenu to the useMemo deps (and ensure downstream state updates run when it toggles).

Copilot uses AI. Check for mistakes.
Comment on lines +771 to 773
<style>{`.react-flow__edge.selectable { cursor: grab !important; }`}</style>
)}
<ReactFlow
Copy link

Copilot AI Feb 19, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline <style> adds a global selector .react-flow__edge.selectable { ... }, which will affect every ReactFlow instance on the page while this component is mounted. Consider scoping the selector to this graph’s container (e.g., prefix with a container class) or using a component-scoped styling approach to avoid cross-component side effects.

Suggested change
<style>{`.react-flow__edge.selectable { cursor: grab !important; }`}</style>
)}
<ReactFlow
<style>{`.dependency-graph-container .react-flow__edge.selectable { cursor: grab !important; }`}</style>
)}
<ReactFlow
className="dependency-graph-container"

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant