Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: preview a draft flow's hit counts in the editor with the dry-run route

The editor's preview button posts the draft to POST /api/notify/dry-run and
puts each box's hit count on the canvas; any edit hides the numbers. Boxes of
kind request_reviewer label themselves "reviewer", so the long kind name no
longer runs into the hit count shown beside it.
This commit is contained in:
iris 2026-10-25 01:57:29 +02:00 • committed by mara
commit 404d8334aa

View file

@ -429,6 +429,19 @@ export function saveRequest(
};
}
// The `POST /api/notify/dry-run` request for the draft: the same document a
// save sends, without a revision since nothing is stored.
export function previewRequest(
flows: Flow[],
disabledBuiltins: string[],
): { method: "POST"; headers: Record<string, string>; body: string } {
return {
method: "POST",
headers: { "content-type": "application/json" },
body: JSON.stringify({ disabled_builtins: disabledBuiltins, flows }),
};
}
export type SaveOutcome = "saved" | "conflict" | "invalid" | "error";
// What a save's HTTP status means to the editor: 409 is a stale revision (read