fix(templates-page): loading issue due to loading extensive workflow block in preview for all listings#2166
Merged
icecrasher321 merged 2 commits intostagingfrom Dec 3, 2025
Merged
Conversation
…block in preview for all listings
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile OverviewGreptile SummaryThis PR optimizes template page performance by implementing lightweight preview components for workflow blocks.
Confidence Score: 5/5
Important Files ChangedFile Analysis
Sequence DiagramsequenceDiagram
participant TC as TemplateCard
participant WP as WorkflowPreview
participant LWT as lightweightNodeTypes
participant WPB as WorkflowPreviewBlock
participant WPS as WorkflowPreviewSubflow
participant BR as Block Registry
participant RF as ReactFlow
Note over TC,WP: Template Page Rendering
TC->>WP: render with lightweight={true}
Note over WP: Select node types based on mode
WP->>WP: nodeTypes = lightweight ? lightweightNodeTypes : fullNodeTypes
Note over WP: Build nodes array
loop For each block in workflow
WP->>WP: Check if lightweight mode
alt Lightweight Mode
alt Block is loop/parallel
WP->>WPS: Create minimal subflow node data
WPS-->>WP: {name, width, height, kind}
else Regular block
WP->>WPB: Create minimal block node data
WPB-->>WP: {type, name, isTrigger, horizontalHandles, enabled}
end
else Full Mode
WP->>WP: Create detailed node with subBlockValues
end
end
Note over WP,RF: Render with ReactFlow
WP->>RF: Pass nodes, edges, nodeTypes
alt Lightweight Mode
RF->>WPB: Render WorkflowPreviewBlock
WPB->>BR: getBlock(type) - config only
BR-->>WPB: blockConfig
WPB->>WPB: Filter visible subblocks from config
WPB->>RF: Render static skeleton UI
else Full Mode
RF->>RF: Render full WorkflowBlock with hooks
end
RF-->>TC: Rendered preview
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Workflow preview in templates page renders full workflow block causing it to be slow when there are a lot of templates. This PR makes lightweight preview components.
Type of Change
Testing
Tested manually
Checklist