-
Notifications
You must be signed in to change notification settings - Fork 14
fix(1707, 1708): fix path-to-component visibility and hover animation #654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 5 commits
612b639
fcb50b2
18007b9
3b8880d
cccd938
bee86f9
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -59,6 +59,7 @@ import { | |||||||||||||||
| DropdownMenuTrigger, | ||||||||||||||||
| } from "./ui/dropdown-menu"; | ||||||||||||||||
| import { Popover, PopoverContent, PopoverTrigger } from "./ui/popover"; | ||||||||||||||||
| import { Move } from "lucide-react"; | ||||||||||||||||
|
|
||||||||||||||||
| // Types for the context menu | ||||||||||||||||
| type MenuType = "edge" | "node" | null; | ||||||||||||||||
|
|
@@ -181,6 +182,7 @@ const DependencyGraph: FunctionComponent<{ | |||||||||||||||
| childrenLimitMap, | ||||||||||||||||
| previousNodesRef.current, | ||||||||||||||||
| handleExpansionToggle, | ||||||||||||||||
| enableContextMenu, | ||||||||||||||||
| ); | ||||||||||||||||
| previousNodesRef.current = nodes; | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -757,6 +759,17 @@ const DependencyGraph: FunctionComponent<{ | |||||||||||||||
| )} | ||||||||||||||||
| </Button> | ||||||||||||||||
| </div> | ||||||||||||||||
| <div className="absolute z-10 left-2 top-2"> | ||||||||||||||||
| <span className="text-sm text-muted-foreground/60 flex items-center gap-1"> | ||||||||||||||||
| <Move className="h-3 w-3" /> | ||||||||||||||||
| You can interact with this graph | ||||||||||||||||
| </span> | ||||||||||||||||
| </div> | ||||||||||||||||
| {/* Todo: Find a better way to disable edge cursor pointer when context menu | ||||||||||||||||
| is disabled. This is a bit hacky but works for now. Issue 1708 */} | ||||||||||||||||
| {!enableContextMenu && ( | ||||||||||||||||
| <style>{`.react-flow__edge.selectable { cursor: grab !important; }`}</style> | ||||||||||||||||
| )} | ||||||||||||||||
| <ReactFlow | ||||||||||||||||
|
Comment on lines
+778
to
780
|
||||||||||||||||
| <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" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enableContextMenuis passed intogetLayoutedElements, but it’s not included in theuseMemodependency list for computinginitialNodes/initialEdges. IfenableContextMenuchanges (e.g. when vuln state changes), nodedata.enableContextMenu(and thus cursor/interaction affordance) can stay stale. AddenableContextMenuto theuseMemodeps (and ensure downstream state updates run when it toggles).