fix(blocks): resolve variable display in mothership resource preview#4226
fix(blocks): resolve variable display in mothership resource preview#4226waleedlatif1 merged 2 commits intostagingfrom
Conversation
Variables block showed empty assignments in the embedded workflow preview because currentWorkflowId was read from URL params, which don't contain workflowId in the mothership route. Fall back to activeWorkflowId from the workflow registry.
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryLow Risk Overview This ensures downstream workflow-scoped queries (e.g., variable hydration and other block metadata lookups) receive a valid workflow ID even when Reviewed by Cursor Bugbot for commit 4efea0d. Configure here. |
Greptile SummaryThis PR fixes a bug where the Variables block showed empty assignments in the Mothership resource preview. The root cause was that Confidence Score: 5/5Safe to merge — minimal, targeted fix with no side effects on the existing canvas path. Single-line change with a clear fallback chain; the previous type-widening concern from the thread is resolved by the No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[WorkflowBlock renders] --> B{isSandbox?}
B -- Yes --> C[currentWorkflowId = '']
B -- No --> D{params.workflowId available?}
D -- Yes --> E[currentWorkflowId = params.workflowId]
D -- No e.g. Mothership route --> F{activeWorkflowId from registry?}
F -- Yes --> G[currentWorkflowId = activeWorkflowId]
F -- No --> H[currentWorkflowId = '' disables workspace-scoped queries]
C --> I[Pass to useWebhookInfo / useScheduleInfo / SubBlockRow]
E --> I
G --> I
H --> I
Reviews (2): Last reviewed commit: "fix(blocks): narrow currentWorkflowId to..." | Re-trigger Greptile |
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 4efea0d. Configure here.
Summary
currentWorkflowIdwas read from URL params, which don't includeworkflowIdin the mothership routeactiveWorkflowIdfrom the workflow registry for embedded contextsType of Change
Testing
Tested manually
Checklist