Skip to content

fix(connection-tags): drag and drop didn't render tag dropdown with input format fields - #1647

Merged
icecrasher321 merged 1 commit into
stagingfrom
fix/connection-tags-drag-and-drop
Oct 15, 2025
Merged

fix(connection-tags): drag and drop didn't render tag dropdown with input format fields#1647
icecrasher321 merged 1 commit into
stagingfrom
fix/connection-tags-drag-and-drop

Conversation

@icecrasher321

Copy link
Copy Markdown
Collaborator

Summary

Drag and drop didn't render tag dropdown with input format fields --> affected input form trigger and API trigger.

Type of Change

  • Bug fix

Testing

Set input format fields and drag and drop connection tag

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercelBot commented Oct 15, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
ProjectDeploymentPreviewCommentsUpdated (UTC)
docsSkippedSkippedOct 15, 2025 11:21pm

@greptile-appsgreptile-appsBot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Greptile Overview

Summary

Fixed a bug where drag-and-drop connection tags didn't render properly for API trigger and Input Form trigger blocks when inputFormat fields were configured. The fix involves two coordinated changes:

  • use-block-connections.ts: Integrated the getBlockOutputs helper function to correctly derive dynamic outputs based on inputFormat fields, replacing the previous approach that only used static block outputs
  • tag-dropdown.tsx: Added explicit handling for api_trigger and input_trigger block types to parse and display tags from inputFormat fields

Both files now properly merge live subblock values from the store with base subblock definitions, ensuring the tag dropdown reflects the current state of input format configurations during drag-and-drop operations.

Confidence Score: 4/5

  • This PR is safe to merge with minor considerations
  • The changes correctly address the stated bug by integrating the existing getBlockOutputs helper and adding explicit handling for trigger blocks. The logic is consistent with similar handling for starter blocks. Code duplication exists between the two locations in use-block-connections.ts where outputs are computed (lines 131-152 and 182-203), but this appears to be pre-existing technical debt rather than introduced by this PR.
  • No files require special attention

Important Files Changed

File Analysis

FilenameScoreOverview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/hooks/use-block-connections.ts4/5Integrated getBlockOutputs helper to properly handle dynamic outputs from inputFormat for API and Input Form triggers, fixing connection tag rendering during drag-and-drop
apps/sim/components/ui/tag-dropdown.tsx5/5Added explicit handling for api_trigger and input_trigger blocks to render tags based on inputFormat fields, matching the logic used for starter block

Sequence Diagram

sequenceDiagram
participant User
participant TagDropdown
participant useBlockConnections
participant getBlockOutputs
participant SubBlockStore
User->>TagDropdown: Drag and drop connection tag
TagDropdown->>TagDropdown: getMergedSubBlocks(sourceBlockId)
TagDropdown->>SubBlockStore: Get live subblock values
SubBlockStore-->>TagDropdown: Return inputFormat values
alt Block is api_trigger or input_trigger
TagDropdown->>TagDropdown: Check inputFormat.value
TagDropdown->>TagDropdown: Filter and map fields to tags
TagDropdown-->>User: Render tag dropdown with input format fields
else Other block types
TagDropdown->>TagDropdown: Use existing logic
end
User->>useBlockConnections: Request connected blocks
useBlockConnections->>useBlockConnections: getMergedSubBlocks(sourceBlockId)
useBlockConnections->>SubBlockStore: Get live subblock values
SubBlockStore-->>useBlockConnections: Return merged subBlocks
useBlockConnections->>getBlockOutputs: Get dynamic outputs
getBlockOutputs->>getBlockOutputs: Check if api_trigger/input_trigger
getBlockOutputs->>getBlockOutputs: Parse inputFormat fields
getBlockOutputs-->>useBlockConnections: Return dynamic outputs
useBlockConnections->>useBlockConnections: Convert to field format
useBlockConnections-->>User: Return connections with proper output fields
Loading

2 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@icecrasher321
icecrasher321 merged commit ba8acbb into stagingOct 15, 2025
9 checks passed
@waleedlatif1
waleedlatif1 deleted the fix/connection-tags-drag-and-drop branch October 30, 2025 06:22
Sign up for freeto 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

@icecrasher321