Skip to content

Commit 72759e1

Browse files
os-zhuangclaude
andauthored
feat(spec): add the back edge style to the flow-builder canvas protocol (#2291)
`FlowCanvasEdgeStyleSchema` gains a `back` value alongside solid/dashed/dotted/bold, marking an ADR-0044 declared back-edge (a `revise` loop's resubmit edge). Flow-builder-protocol consumers can render it as a distinct curved/dashed return arc, set apart from forward flow — matching the objectui designer's canvas (objectstack-ai/objectui#1954). Additive enum value: public API surface + factory signatures unchanged. Part of #2274 (ADR-0044 AI/designer parity). Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 205e9ca commit 72759e1

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
feat(spec): add the `back` edge style to the flow-builder canvas protocol
6+
7+
`FlowCanvasEdgeStyleSchema` gains a `back` value alongside `solid`/`dashed`/`dotted`/`bold`, marking an ADR-0044 declared back-edge (a `revise` loop's resubmit edge). Flow-builder-protocol consumers can now render it as a distinct curved/dashed return arc, set apart from forward flow — matching the objectui designer's hand-rolled canvas (objectstack-ai/objectui#1954). Part of #2274.

packages/spec/src/studio/flow-builder.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ describe('FlowCanvasEdgeSchema', () => {
128128
});
129129

130130
it('should accept all edge styles', () => {
131-
const styles = ['solid', 'dashed', 'dotted', 'bold'];
131+
const styles = ['solid', 'dashed', 'dotted', 'bold', 'back'];
132132
styles.forEach(s => {
133133
expect(FlowCanvasEdgeStyleSchema.parse(s)).toBe(s);
134134
});

packages/spec/src/studio/flow-builder.zod.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* within ObjectStack Studio. Covers:
1010
* - **Node Shape Registry**: Shape and visual style per FlowNodeAction type
1111
* - **Canvas Node**: Position, size, and rendering hints for each node on canvas
12-
* - **Canvas Edge**: Visual properties for sequence flows (normal, default, fault)
12+
* - **Canvas Edge**: Visual properties for sequence flows (normal, default, fault, back-edge)
1313
* - **Flow Builder Config**: Canvas settings, palette, minimap, and toolbar
1414
*
1515
* ## Architecture
@@ -132,13 +132,16 @@ export type FlowCanvasNode = z.infer<typeof FlowCanvasNodeSchema>;
132132
// ─── Canvas Edge ─────────────────────────────────────────────────────
133133

134134
/**
135-
* Visual style for a sequence flow edge on the canvas.
135+
* Visual style for a sequence flow edge on the canvas. The `back` style marks an
136+
* ADR-0044 declared back-edge (a `revise` loop's resubmit edge): consumers render
137+
* it as a distinct curved/dashed return arc, set apart from forward flow.
136138
*/
137139
export const FlowCanvasEdgeStyleSchema = lazySchema(() => z.enum([
138140
'solid', // Normal sequence flow
139141
'dashed', // Default sequence flow (isDefault: true)
140142
'dotted', // Conditional edge
141143
'bold', // Fault / error edge
144+
'back', // ADR-0044 back-edge (revise loop) — curved dashed return arc
142145
]).describe('Edge line style'));
143146

144147
export type FlowCanvasEdgeStyle = z.infer<typeof FlowCanvasEdgeStyleSchema>;

0 commit comments

Comments
 (0)