Skip to content

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

improvement(connection) #527

wants to merge 5 commits into from

Conversation

emir-karabeg
Copy link
Collaborator

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.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Security enhancement
  • Performance improvement
  • Code refactoring (no functional changes)

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:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added tests that prove my fix is effective or that my feature works
  • All tests pass locally and in CI (bun run test)
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules
  • I have updated version numbers as needed (if needed)
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

Security Considerations:

  • My changes do not introduce any new security vulnerabilities
  • I have considered the security implications of my changes

Additional Information:

Any additional information, configuration or data that might be necessary to reproduce the issue or use the feature.

Copy link

vercel bot commented Jun 20, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 22, 2025 3:23am
sim ❌ Failed (Inspect) Jun 22, 2025 3:23am

@emir-karabeg emir-karabeg marked this pull request as draft June 20, 2025 22:14
Copy link
Contributor

@greptile-apps greptile-apps bot left a 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 in apps/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 in use-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

Comment on lines +501 to +507
maxWidth: !isEnabled
? isWide
? '200px'
: '140px'
: isWide
? '220px'
: '180px',
Copy link
Contributor

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

Comment on lines +64 to +67
function findAllPathNodes(
edges: any[],
targetNodeId: string
): Array<{ nodeId: string; distance: number }> {
Copy link
Contributor

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
Copy link
Contributor

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

Suggested change
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'}`}
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant