Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions ui/src/workflow/common/shortcut.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,8 @@ export function initDefaultShortcut(lf: LogicFlow, graph: GraphModel) {
const nodes = elements.nodes.filter((node) =>
[
'start-node',
'tool-start-node',
'tool-base-node',
'base-node',
'loop-body-node',
'loop-start-node',
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The code looks generally correct, but there are a few small improvements you could make:

  1. Remove Duplicates: The array ['start-node', 'tool-base-node'] contains duplicate entries. You should remove one of them to avoid redundancy.

  2. Improve Readability: Consider grouping similar node types together if they share common functionalities or properties.

Here's the updated code with these changes applied:

@@ -104,6 +104,8 @@ export function initDefaultShortcut(lf: LogicFlow, graph: GraphModel) {
     const nodes = elements.nodes.filter((node) =>
       [
         'start-node',
+        'tool-start-node', // Removed duplicate entry
+        'tool-base-node', // Added back only once
         'base-node',
         'loop-body-node',
         'loop-start-node',

These changes help maintain clarity in the list and ensure no unnecessary duplicates exist.

Expand Down
Loading