-
Notifications
You must be signed in to change notification settings - Fork 3.2k
feat(workflow-block): preview #2935
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. |
8ef5b5b to
679b384
Compare
Greptile SummaryThis PR implements a workflow block preview feature that displays child workflows inline when editing workflow blocks, along with improvements to the workflow query system. The feature adds a 160px preview panel within the editor that shows the child workflow's structure, includes loading states, and provides a button to open the child workflow in a new tab. Key Changes:
The implementation follows established patterns, maintains type safety, and properly handles edge cases (no workflow selected, loading states, errors). Confidence Score: 4/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant User
participant EditorPanel as Editor Panel
participant WorkflowHook as useWorkflowState Hook
participant API as Backend API
participant Preview as WorkflowPreview Component
User->>EditorPanel: Selects workflow block
EditorPanel->>EditorPanel: Detects block type === 'workflow' or 'workflow_input'
EditorPanel->>WorkflowHook: useWorkflowState(childWorkflowId)
alt workflowId exists
WorkflowHook->>API: GET /api/workflows/{id}
API-->>WorkflowHook: Returns WorkflowState
WorkflowHook-->>EditorPanel: data: WorkflowState, isLoading: false
else no workflowId selected
EditorPanel->>EditorPanel: Render 'No workflow selected' message
end
EditorPanel->>EditorPanel: isLoadingChildWorkflow check
alt loading
EditorPanel->>EditorPanel: Render loading spinner
else loaded
EditorPanel->>Preview: Pass workflowState to WorkflowPreview
Preview->>Preview: Render nodes and edges from state
Preview-->>EditorPanel: Rendered preview canvas
EditorPanel->>EditorPanel: Show open-in-new-tab button
end
User->>EditorPanel: Clicks open button
EditorPanel->>API: window.open(/workspace/{id}/w/{childWorkflowId})
API-->>User: Opens child workflow in new tab
|
Summary
Added workflow block preview. Made some improvements to workflow query.
Type of Change
Testing
Solo.
Checklist