Conversation
🚀 PR Environment DeployedYour PR environment has been successfully deployed! Environment Details:
Components:
The environment will be automatically cleaned up when this PR is closed or merged. |
🚀 PR Environment DeployedYour PR environment has been successfully deployed! Environment Details:
Components:
The environment will be automatically cleaned up when this PR is closed or merged. |
…ests Introduce the visual condition builder data model: - ConditionRule, ConditionGroup, ConditionOperator types - visualConditionToExpression: converts visual tree to JS expression - expressionToConditionGroup: parses expression back to visual form - Operator metadata with labels, unary flags, and categories - Empty rule skipping to prevent false positives from unfilled rules
Condition nodes now render two source handles like For Each nodes. Canvas auto-assigns sourceHandle on condition edges and onConnect.
New ConditionQueryBuilder component for visual rule editing with AND/OR groups, operator dropdowns, and nested group support. ConditionFields provides Visual/Expression mode toggle. Widen config value type to support structured conditionConfig objects.
Build edgesBySourceHandle map from edge sourceHandle metadata. Condition nodes route to true/false targets based on evaluation result. Falls back to legacy gate behavior for edges without sourceHandle. Propagates handle map through loop body execution for nested conditions.
Use edgesBySourceHandle to resolve true/false targets in generated code. Falls back to positional edge order for legacy workflows.
Document sourceHandles, conditionConfig field, and branch behavior. Update tips to reflect handle-based edge routing.
Strip {{@...}} template variables before checking for dangerous keywords
so node IDs like 'process' don't trigger the security check.
Rewrite Backspace/Delete handler to walk up ancestors for badge detection, check adjacent children at container level, and handle empty text nodes.
Eagerly fetch last execution logs when a workflow loads so template autocomplete has runtime output data immediately. Guards against stale data from navigation race conditions by checking current workflow ID.
- Codegen: support multiple targets per handle (use generateParallelNodeCode instead of single-node codegen). Fixes silent target drop. - Executor: filter handle targets to body-only nodes in identifyLoopBody to prevent condition handles routing outside loop body. - MCP schema: fix edgeStructure.note contradiction (was "Do NOT use sourceHandle" while tips said to use it for Condition nodes). - UI: fix hasPersisted ref not resetting across node switches, clear conditionConfig when switching to expression mode, memoize empty group.
- Widen ConfigValue to include undefined, replacing the `"" as unknown as ConfigValue` cast when clearing conditionConfig on mode switch - Extract buildEdgesBySourceHandle() into keeperhub/lib/edge-handle-utils.ts, replacing duplicated map-building logic in workflow-codegen.ts and workflow-executor.workflow.ts - Use EdgesBySourceHandle type alias in LoopBodyInfo, identifyLoopBody, and executeBodyNode parameters
- Eliminate double expressionToConditionGroup parse on initial load by combining parsedGroup and initialMode into a single useMemo - Extract resolveConditionTargets() helper in codegen, replacing duplicated handle/fallback logic in generateConditionNodeCode and generateConditionBranchCode - Add condition-executor-handles.test.ts with 9 tests covering buildEdgesBySourceHandle and identifyLoopBody handle-aware filtering
The edgeStructure note only mentioned Condition nodes using sourceHandle but For Each nodes also use it (loop/done). Updated to document both.
The empty catch swallowed all errors silently, making failures impossible to diagnose. Added console.debug for visibility.
When both true and false handles already have edges, reject the new connection by returning current edges unchanged. Previously a third edge would silently be assigned to the false handle.
In executeBodyNode, when a condition node had handle-aware edges but the chosen handle (true/false) had no targets, execution would skip downstream continuation entirely. Now falls through to bodyEdgesBySource when the chosen handle has zero targets.
Long operator labels like "greater than or equal" could cause layout shifts on narrow panels. Fixed width ensures consistent alignment.
0cf7459 to
50c5c23
Compare
🚀 PR Environment DeployedYour PR environment has been successfully deployed! Environment Details:
Components:
The environment will be automatically cleaned up when this PR is closed or merged. |
suisuss
left a comment
There was a problem hiding this comment.
We had to rebase with staging to fix the redis deploy issue.
LGTM
…ayout Add == and != as separate operators alongside === and !==. Move the delete button inline to the right of each condition row and align the AND/OR logic toggle with the operator column. Re-parse stored visual config when it drifts from the actual expression so legacy conditions render correctly.
🚀 PR Environment DeployedYour PR environment has been successfully deployed! Environment Details:
Components:
The environment will be automatically cleaned up when this PR is closed or merged. |
🚀 PR Environment DeployedYour PR environment has been successfully deployed! Environment Details:
Components:
The environment will be automatically cleaned up when this PR is closed or merged. |
Summary
Changes
Core (keeperhub/)
keeperhub/lib/condition-builder-types.ts-- condition builder type definitions (groups, rules, operators)keeperhub/lib/condition-builder-utils.ts-- expression-to-builder and builder-to-expression conversion utilitieskeeperhub/lib/edge-handle-utils.ts-- shared utility for building handle-aware edge maps (used by executor and codegen)keeperhub/components/workflow/condition-query-builder.tsx-- visual query builder UI componentkeeperhub/api/mcp/schemas/route.ts-- updated MCP schema for condition dual handlesWorkflow engine
lib/workflow-executor.workflow.ts-- handle-aware condition routing in executorlib/workflow-codegen.ts-- handle-aware condition routing in codegen with resolveConditionTargets helper, multi-target parallel supportlib/condition-validator.ts-- fix false positive on template node IDslib/workflow-store.ts-- pre-fetch execution logs on workflow load for autocompleteUI
components/workflow/workflow-canvas.tsx-- dual output handle rendering and edge managementcomponents/workflow/nodes/action-node.tsx-- true/false handle ports on condition nodescomponents/workflow/config/action-config.tsx-- query builder integration in config panel, single-parse mode derivationcomponents/workflow/node-config-panel.tsx-- mode toggle supportcomponents/overlays/configuration-overlay.tsx-- overlay adjustments for buildercomponents/ui/template-badge-input.tsx-- improved badge deletion behaviorTests
tests/unit/condition-builder-utils.test.ts-- 67 tests for expression conversion utilitiestests/unit/condition-codegen-handles.test.ts-- 9 tests for handle-aware codegentests/unit/condition-executor-handles.test.ts-- 9 tests for buildEdgesBySourceHandle and identifyLoopBody handle filtering