Uh oh!
There was an error while loading. Please reload this page.
feat(studio): surface flow validation errors inline on the canvas - #1958
Merged
Conversation
The flow designer's structural validation (un-declared cycle, missing entry, duplicate ids, dangling edges, …) was only visible in the Debug panel. Surface it INLINE on the canvas so a broken graph is obvious without opening Debug: - An un-declared cycle paints its offending edges + nodes red (the same `validateFlowDraft` the simulator preflight uses); the closing edge's tooltip points at the fix (mark it as a back-edge). A declared revise loop (ADR-0044 back-edge) is excluded from cycle detection and stays un-flagged. - An error banner on the canvas lists the structural-error messages. The cycle Diagnostic now carries the closing node path so the canvas can derive the exact edges/nodes to highlight. FlowPreview runs validation continuously and passes `invalidNodeIds` / `invalidEdges` / `validationErrors` to FlowCanvas; invalid edges/nodes also expose `data-invalid` for styling + tests. Follows #1954, #1955. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This was referenced Jun 24, 2026
os-zhuang added a commit
that referenced
this pull request
Jun 24, 2026
The inline structural-error banner (ADR-0044 cycle surfacing) was display-only, duplicating the newer Problems-panel data via a separate `validationErrors` string[]. Drive it from the unified `problems` list instead and make each row with a concrete target a button: clicking selects + pans-to-reveal the offending node/edge (reusing the Problems panel's reveal handler), so the always-visible banner is actionable without opening the panel. The `validationErrors` prop + its duplicate validateFlowDraft-message derivation are removed; the red edge/node highlighting stays. Refs #1958 (ADR-0044 inline cycle surfacing). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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 freeto 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.
What & why
Third in the ADR-0044 revise-loop series (after #1954 authoring and #1955 debugger). The flow designer's structural validation — an un-declared cycle, missing entry node, duplicate ids, dangling edges — was only visible in the Debug panel, which the author has to open. Now it surfaces inline on the canvas.
Change
validateFlowDraftthe simulator preflight runs (no second rule). The edge that closes the loop carries a tooltip pointing at the fix: "mark the edge that closes the loop as a back-edge". A declared revise loop (ADR-0044type: 'back') is excluded from cycle detection and stays un-flagged.Diagnosticnow carries the closing node path, soFlowPreviewcan derive the exact edges/nodes to highlight. It runs validation continuously and passesinvalidNodeIds/invalidEdges/validationErrorstoFlowCanvas. Invalid edges/nodes also expose adata-invalidattribute (styling + tests).Files
simulator/flow-sim-types.ts/flow-sim-validate.ts—Diagnostic.cycle(closing node path) set on the cycle error.previews/FlowCanvas.tsx— red edge/marker/banner;invalidNodeIds/invalidEdges/validationErrorsprops;data-invalid.previews/flow-canvas-parts.tsx—NodeCardred error ring (invalidprop).previews/FlowPreview.tsx— continuousvalidateFlowDraft; derive + pass highlights (nodes/edges memoized for stable hook deps).Verification
FlowCanvas.test.tsx): renders the real canvas with a cyclic flow → asserts the error banner shows the message and the cycle's edges + nodes carrydata-invalid; a clean flow shows neither.Diagnosticcarries the closing node path (a → … → a).type-check0 errors;eslint0 errors.Pairs with the canvas-validation direction noted in framework#1770.
🤖 Generated with Claude Code