fix(1707, 1708): fix path-to-component visibility and hover animation#654
fix(1707, 1708): fix path-to-component visibility and hover animation#654juliankepka wants to merge 6 commits intomainfrom
Conversation
There was a problem hiding this comment.
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
enableContextMenuthroughgetLayoutedElementsinto nodedataso node rendering can react to it. - Adjusts
DependencyGraphNodecursor styling based onenableContextMenu(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.
| childrenLimitMap, | ||
| previousNodesRef.current, | ||
| handleExpansionToggle, | ||
| enableContextMenu, | ||
| ); |
There was a problem hiding this comment.
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).
| <style>{`.react-flow__edge.selectable { cursor: grab !important; }`}</style> | ||
| )} | ||
| <ReactFlow |
There was a problem hiding this comment.
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.
| <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" |
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.