Interactive workflow simulation and condition testing in the editor (#84) - #89
Merged
Conversation
…testing Replaces the plain textarea JSON fields (sample start context, mock output, inline condition-tester context) with a lightweight, bundled JsonCodeEditor built on react-simple-code-editor + Prism, and renders the evolving simulation context with the same editor in read-only mode. Refs #84
The blocking-node mock output JSON now seeds each declared output with a
placeholder matching its type (false for boolean, -1 for number, {} for
object, "" for string) instead of an empty string for every field, and
honors an explicit output defaultValue when one is set.
Refs #84
The prismjs package (3.7MB, 700 files) was stalling npm ci in CI, pushing install from ~15s to ~5 minutes. Drop prismjs and @types/prismjs and highlight JSON with a small in-repo function fed to react-simple-code-editor's highlight callback, keeping identical syntax highlighting with zero new dependencies. Refs #84
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
WorkflowEditorthat runs a workflow's routing logic against a samplestart context without deploying a real instance. The canvas lights up the path taken, which edges
matched, and which conditions evaluated true/false; blocking nodes (
action/human-task/receive-event) pause for a mock output that is merged into the context, and errors are surfacedtied to the offending node/edge.
elEvaluator.ts(a Jakarta-EL-subset evaluator whose tests mirror
ConditionEvaluatorTest) andsimulate.ts(a routing stepper mirroring
WorkflowEngine.selectEdge/getOutgoingEdges, priority order,isDefaultfallback, andMAX_TRANSITIONS).context), a
Simulateswitch in the toolbar, an auto-generated sample start context from the startnode's declared inputs, a blue canvas border while simulating (reserved via a transparent border
so it never shifts layout), and automatic interactivity lock (with a disabled lock button) during
simulation. Public simulation/evaluator APIs are exported from
index.ts.Related Issue
Fixes #84
Test Plan
cd ui && npx vitest run— full suite (140 tests, includes EL parity + simulation units)cd ui && npx tsc --noEmit— typecheckcd ui && npm run lintcd ui && npm run buildcd ui && npm run dev— toggle Simulate, Start/Step/Run through thecveTriagesample,supply a mock output at the human task, confirm the path + edge true/false light up, verify a
bad condition surfaces an error on the right edge, and test a single condition inline