-
Notifications
You must be signed in to change notification settings - Fork 595
improvement(connection) #527
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
base: main
Are you sure you want to change the base?
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
PR Summary
Enhanced connection blocks and workflow visualization with improved block relationship handling and UI refinements.
- Improved
TagDropdown
inapps/sim/components/ui/tag-dropdown.tsx
with block-based grouping and distance-based sorting using BFS - Added horizontal/vertical handle orientation support in
apps/sim/app/w/[id]/components/workflow-block/components/connection-blocks/connection-blocks.tsx
- Modified
findAllPathNodes
inuse-block-connections.ts
to include distance information for connected blocks with proper sorting - Enhanced text overflow handling in
workflow-block.tsx
with dynamic max width based on block state
4 files reviewed, 4 comments
Edit PR Review Bot Settings | Greptile
maxWidth: !isEnabled | ||
? isWide | ||
? '200px' | ||
: '140px' | ||
: isWide | ||
? '220px' | ||
: '180px', |
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.
style: Consider extracting these width values into a config object for better maintainability
function findAllPathNodes( | ||
edges: any[], | ||
targetNodeId: string | ||
): Array<{ nodeId: string; distance: number }> { |
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.
style: Consider adding type definitions for edges
array parameter instead of using any[]
. This would improve type safety.
const displayName = connection.name.replace(/\s+/g, '').toLowerCase() | ||
// Get block configuration for icon and color | ||
const blockConfig = getBlock(connection.type) | ||
const displayName = connection.name // Use the actual block name instead of transforming it |
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.
style: Comment previously mentioned transforming name but code shows raw usage. Remove outdated comment
const displayName = connection.name // Use the actual block name instead of transforming it | |
const displayName = connection.name |
|
||
return ( | ||
<Card | ||
key={`${field ? field.name : connection.id}`} | ||
key={`${connection.id}-${field ? field.name : 'default'}`} |
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.
logic: Key should include index to handle duplicate field names across different blocks
010c826
to
3810313
Compare
Description
Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context.
Fixes # (issue)
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Checklist:
bun run test
)Security Considerations:
Additional Information:
Any additional information, configuration or data that might be necessary to reproduce the issue or use the feature.