Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: give the new-flow draft a route no flow id can take, and drop the dead hit-count rule

/notifications/new could be a saved flow's own page, so the draft now opens at
/notifications/draft/new, which has a segment more than any flow's route. The
placeholder id no longer needs reserving. The .notify-node-hits rule styled the
removed tree rows; nothing renders it.
This commit is contained in:
iris 2026-10-25 01:33:29 +02:00 • committed by mara
commit 6e7b5f84e9

View file

@ -356,16 +356,15 @@ export function duplicateFlow(
});
}
// The id of a flow nobody has saved yet. It is the editor's route for one, so
// no saved flow may take it.
// The editor's route for a flow nobody has saved yet. It has a segment more
// than a flow's own route, so no flow's id can reach it.
export const NEW_FLOW_PATH = "/notifications/draft/new";
// The id a draft carries until it is saved (see `savedAs`).
export const NEW_FLOW_ID = "new";
function savedIds(view: FlowsView): string[] {
return [
NEW_FLOW_ID,
...view.builtins.map((f) => f.id),
...view.flows.map((f) => f.id),
];
return [...view.builtins.map((f) => f.id), ...view.flows.map((f) => f.id)];
}
// The draft the editor opens for a flow not saved yet: an empty one, or a copy