Skip to content

Conversation

@icecrasher321
Copy link
Collaborator

Summary

Seed subblock values correctly.

Type of Change

  • Bug fix

Testing

Tested manually

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

vercel bot commented Jan 17, 2026

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
docs Skipped Skipped Jan 17, 2026 4:00am

Request Review

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Jan 17, 2026

Greptile Summary

  • Fixes subblock value seeding bug where blocks were added with empty/undefined values instead of their configured defaults
  • Adds logic to extract default values from block configuration and pass them to the collaborative batch add operation
  • Ensures newly added blocks start with proper initial state rather than requiring manual configuration

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/w/[workflowId]/workflow.tsx Fixed subblock initialization to properly seed default values from block configuration during batch add operations

Confidence score: 5/5

  • This PR is safe to merge with minimal risk as it fixes a straightforward initialization bug
  • Score reflects focused bug fix with clear purpose and limited scope of changes
  • No files require special attention

Sequence Diagram

sequenceDiagram
    participant User
    participant Toolbar
    participant WorkflowContent
    participant ReactFlow
    participant Store
    participant CollaborativeWorkflow

    User->>Toolbar: "Drag block from toolbar"
    Toolbar->>ReactFlow: "onDrop event with block data"
    ReactFlow->>WorkflowContent: "handleToolbarDrop(data, position)"
    
    WorkflowContent->>WorkflowContent: "checkTriggerConstraints()"
    WorkflowContent->>WorkflowContent: "isPointInLoopNode(position)"
    WorkflowContent->>WorkflowContent: "tryCreateAutoConnectEdge()"
    WorkflowContent->>WorkflowContent: "prepareBlockState()"
    
    WorkflowContent->>CollaborativeWorkflow: "collaborativeBatchAddBlocks([block], [edge], {}, {}, subBlockValues)"
    CollaborativeWorkflow->>Store: "Update workflow state"
    Store->>ReactFlow: "Trigger re-render with new nodes"
    ReactFlow->>User: "Display new block on canvas"
Loading

@icecrasher321 icecrasher321 merged commit 75898c6 into staging Jan 17, 2026
11 checks passed
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.

2 participants