feat(workflow): starter templates for the blank-canvas cold start#2607
Open
simlarsen wants to merge 1 commit into
Open
feat(workflow): starter templates for the blank-canvas cold start#2607simlarsen wants to merge 1 commit into
simlarsen wants to merge 1 commit into
Conversation
A brand-new workflow opened to an empty canvas with a lone placeholder trigger — an intimidating "now what?" for non-technical authors. This offers a few pre-wired starter workflows instead; picking one drops a ready graph you just fill in, and "Start from scratch" keeps the empty canvas. - WorkflowTemplates: engine-agnostic recipes (which components, where, how they connect) using only STATIC components, so there's no per-model id-fidelity risk. buildTemplateGraph resolves each against the live catalog and produces the exact node/edge shape addToGraph already creates (returns null rather than dropping a broken graph if a component is missing). - WorkflowTemplateGallery: the cards + "Start from scratch" overlay. - Wired into Workflow.tsx: shown only when the graph has no real steps yet (every node is a placeholder), gated on the catalog being loaded, and dismissed once the user picks a template or opts out. Existing workflows (which have real nodes) never see it. Tests: buildTemplateGraph (shape matches addToGraph, first-port wiring, duplicate-id disambiguation, null on missing component) + a guard that EVERY shipped template resolves against the real static catalog (so no broken metadataIds ship) + gallery RTL (lists templates, select, dismiss). 62 workflow tests pass; tsc + eslint clean. Note: loaded-template canvas rendering goes through the same node shape as manually added components (unit-verified), but is worth a quick manual smoke-test since ReactFlow rendering isn't exercised in jsdom. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
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.
Fixes the intimidating blank-canvas cold start the design flagged. Stacked on #2606.
What
A brand-new workflow opened to an empty canvas with a lone placeholder trigger — a "now what?" moment. This offers a few pre-wired starter workflows instead; picking one drops a ready graph you just fill in, and "Start from scratch" keeps the empty canvas.
WorkflowTemplates— engine-agnostic recipes (which components, where, how they connect). Uses only static components, so there's no per-model id-fidelity risk.buildTemplateGraphresolves each against the live catalog and produces the exact node/edge shapeaddToGraphalready creates (returnsnullrather than dropping a broken graph if a component is missing).WorkflowTemplateGallery— the cards + "Start from scratch" overlay.Workflow.tsx— shown only when the graph has no real steps yet (every node is a placeholder), gated on the catalog being loaded, dismissed once the user picks a template or opts out. Existing workflows (which have real nodes) never see it.Ships 3 templates: Scheduled Slack message, Scheduled email, Webhook → Slack.
Verification
WorkflowTemplates.test.ts:buildTemplateGraphshape matchesaddToGraph; connects first out-port → first in-port; disambiguates duplicate data ids; returnsnullon a missing component; and a guard that every shipped template resolves against the real static catalog (so no brokenmetadataIdcan ship).WorkflowTemplateGallery.test.tsx(RTL): lists templates, select firesonSelect(template), "Start from scratch" firesonDismiss.tsc✓,eslint✓.One caveat: loaded-template canvas rendering goes through the same node shape as manually-added components (unit-verified), but ReactFlow rendering isn't exercised in jsdom — worth a 30-second manual smoke-test when convenient.
🤖 Generated with Claude Code