-
Notifications
You must be signed in to change notification settings - Fork 7
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
port-suggestion-menu #606
base: master
Are you sure you want to change the base?
port-suggestion-menu #606
Conversation
This change adds a new PortSuggestionMenu component that is displayed when a port is dragged and there are compatible ports available. The menu allows the user to select a compatible port and create a new node of the corresponding type at the current mouse position. The main changes include: - Adding the PortSuggestionMenu component and its corresponding CSS module - Integrating the PortSuggestionMenu into the EditorApp component, showing it when a compatible port is being dragged - Implementing the logic to create a new node when a port is selected from the menu
|
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|
||
// TODO: After dropping the node we should try to connect the node if it has 1 handler only | ||
console.log('Setting draggedPort with positions:', { clientX, clientY, flowPosition }); |
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.
Remove console logs when ready
constructor(nodeTypes: Record<string, typeof Node>) { | ||
this.nodeTypes = nodeTypes; | ||
this.graph = new Graph(); | ||
this.graph.capabilities = new Map(); |
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.
We don't need this explicitly
@@ -827,6 +937,14 @@ export const EditorApp = React.forwardRef< | |||
</div> | |||
{props.children} | |||
</ReactFlow> | |||
{draggedPort && compatiblePorts.length > 0 && ( |
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.
Does this need to be in the Hotkeys group?
@@ -827,6 +937,14 @@ export const EditorApp = React.forwardRef< | |||
</div> | |||
{props.children} | |||
</ReactFlow> | |||
{draggedPort && compatiblePorts.length > 0 && ( | |||
<PortSuggestionMenu |
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.
Does this need to be an observer based on its usage?
User description
Adds a port search menu when dragging an edge out
PR Type
Enhancement, Tests
Description
PortSuggestionMenu
component to allow users to select compatible ports when dragging a port.PortRegistry
class to manage and query compatible ports, improving the logic for port compatibility checks.PortSuggestionMenu
into the editor, enabling dynamic port selection and edge creation.4.3.9
to reflect the new feature additions.PortSuggestionMenu
component with a focus on usability and aesthetics.Changes walkthrough 📝
portSuggestionMenu.tsx
Introduced `PortSuggestionMenu` component with search and grouping.
packages/graph-editor/src/components/flow/portSuggestionMenu.tsx
PortSuggestionMenu
component for selecting compatibleports.
title.
createPortal
for rendering.graph.tsx
Integrated port dragging and `PortSuggestionMenu` into editor.
packages/graph-editor/src/editor/graph.tsx
tracking.
PortSuggestionMenu
into the editor for port selection.PortRegistry
.PortRegistry.ts
Added `PortRegistry` for managing and querying ports.
packages/graph-editor/src/services/PortRegistry.ts
PortRegistry
class to manage and index ports.portSuggestionMenu.module.css
Styled `PortSuggestionMenu` component with CSS.
packages/graph-editor/src/components/flow/portSuggestionMenu.module.css
PortSuggestionMenu
component.version.ts
Bumped version to 4.3.9.
packages/graph-editor/src/data/version.ts
4.3.8
to4.3.9
.