-
Notifications
You must be signed in to change notification settings - Fork 3.3k
improvement(preview): consolidate block rendering and fix handle configurations #3013
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile OverviewGreptile SummaryConsolidated subflow and block rendering into a single component (
The changes maintain visual parity with existing workflow blocks while improving rendering performance and correctness. Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant TemplateCard
participant WorkflowPreview
participant WorkflowPreviewBlock
participant SubflowContainer
participant BlockConfig
TemplateCard->>WorkflowPreview: render(workflowState, lightweight=true)
WorkflowPreview->>WorkflowPreview: Build containerChildIndex (O(n) parent-child mapping)
WorkflowPreview->>WorkflowPreview: Calculate nodes from workflowState.blocks
loop For each block
alt Block is loop/parallel
WorkflowPreview->>WorkflowPreview: Get childBlocks from containerChildIndex (O(1))
WorkflowPreview->>WorkflowPreview: calculateContainerDimensions(childBlocks)
WorkflowPreview->>WorkflowPreviewBlock: render(isSubflow=true, subflowKind, width, height)
WorkflowPreviewBlock->>SubflowContainer: render(name, width, height, kind)
SubflowContainer-->>WorkflowPreviewBlock: Container with handles (target, start-source, end-source)
else Block is regular
WorkflowPreview->>WorkflowPreviewBlock: render(type, name, isTrigger, subBlockValues, lightweight)
WorkflowPreviewBlock->>BlockConfig: getBlock(type)
alt lightweight=false
WorkflowPreviewBlock->>WorkflowPreviewBlock: buildCanonicalIndex(subBlocks)
WorkflowPreviewBlock->>WorkflowPreviewBlock: Calculate visibleSubBlocks with trigger mode logic
alt effectiveTrigger=true AND isPureTriggerBlock=true
WorkflowPreviewBlock->>WorkflowPreviewBlock: Show subblocks with mode=trigger OR no mode
else effectiveTrigger=true AND isPureTriggerBlock=false
WorkflowPreviewBlock->>WorkflowPreviewBlock: Show only subblocks with mode=trigger
else effectiveTrigger=false
WorkflowPreviewBlock->>WorkflowPreviewBlock: Hide all subblocks with mode=trigger
end
alt Block is condition
WorkflowPreviewBlock->>WorkflowPreviewBlock: Calculate condition rows from rawValues
WorkflowPreviewBlock->>WorkflowPreviewBlock: Render handles for each condition branch + error handle
else Block is router_v2
WorkflowPreviewBlock->>WorkflowPreviewBlock: Calculate router rows from rawValues
WorkflowPreviewBlock->>WorkflowPreviewBlock: Render handles for each route + error handle
else Block is standard
WorkflowPreviewBlock->>WorkflowPreviewBlock: Render source handle + error handle (if not trigger)
end
else lightweight=true
WorkflowPreviewBlock->>WorkflowPreviewBlock: Skip expensive computations (empty canonicalIndex, rawValues, visibleSubBlocks)
end
end
end
WorkflowPreview->>WorkflowPreview: Calculate edges with execution status
WorkflowPreview-->>TemplateCard: ReactFlow with consolidated rendering
|
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.
1 file reviewed, 1 comment
Summary
Type of Change
Testing
Tested manually
Checklist