Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .changeset/flow-builder-back-edge-style.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@objectstack/spec': patch
---

feat(spec): add the `back` edge style to the flow-builder canvas protocol

`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.
2 changes: 1 addition & 1 deletion packages/spec/src/studio/flow-builder.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ describe('FlowCanvasEdgeSchema', () => {
});

it('should accept all edge styles', () => {
const styles = ['solid', 'dashed', 'dotted', 'bold'];
const styles = ['solid', 'dashed', 'dotted', 'bold', 'back'];
styles.forEach(s => {
expect(FlowCanvasEdgeStyleSchema.parse(s)).toBe(s);
});
Expand Down
7 changes: 5 additions & 2 deletions packages/spec/src/studio/flow-builder.zod.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* within ObjectStack Studio. Covers:
* - **Node Shape Registry**: Shape and visual style per FlowNodeAction type
* - **Canvas Node**: Position, size, and rendering hints for each node on canvas
* - **Canvas Edge**: Visual properties for sequence flows (normal, default, fault)
* - **Canvas Edge**: Visual properties for sequence flows (normal, default, fault, back-edge)
* - **Flow Builder Config**: Canvas settings, palette, minimap, and toolbar
*
* ## Architecture
Expand Down Expand Up @@ -132,13 +132,16 @@ export type FlowCanvasNode = z.infer<typeof FlowCanvasNodeSchema>;
// ─── Canvas Edge ─────────────────────────────────────────────────────

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

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