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:
parent
e8538d8690
commit
404d8334aa
1 changed files with 97 additions and 6 deletions
|
|
@ -10,6 +10,9 @@ import { NODE_HEIGHT, NODE_WIDTH } from "./FlowLayout.js";
|
|||
|
||||
const PAD = 10;
|
||||
|
||||
// The long kind name would run into the aside beside it.
|
||||
const SHORT_KIND: Record<string, string> = { request_reviewer: "reviewer" };
|
||||
|
||||
export function BoxFace({
|
||||
kind,
|
||||
text,
|
||||
|
|
@ -33,7 +36,7 @@ export function BoxFace({
|
|||
<>
|
||||
<rect width={NODE_WIDTH} height={NODE_HEIGHT} rx="6" />
|
||||
<text class="notify-box-kind" x={PAD} y="17">
|
||||
{kind}
|
||||
{SHORT_KIND[kind] ?? kind}
|
||||
</text>
|
||||
{aside ? (
|
||||
<text
|
||||
|
|
|
|||
Loading…
Reference in a new issue