Watch
0
0
Fork
You've already forked hyperhive
0

swarm-ui: fix the stale refusal comment, guard the create dialog's submit, say what create another keeps

The refusal comment still described collapsed sections the dialog no longer
has. The form's submit now returns while a create is in flight. The docs say
create another keeps only the hive.
This commit is contained in:
iris 2026-10-25 01:44:24 +02:00
commit b93eaaff51
2 changed files with 5 additions and 4 deletions

View file

@ -548,7 +548,8 @@ order with **next** and can step back through with **back** or the step tabs:
The header, the step tabs and the buttons stay in place and only the step's own The header, the step tabs and the buttons stay in place and only the step's own
fields scroll, so a long step never pushes **next** out of view. After fields scroll, so a long step never pushes **next** out of view. After
**create**, the dialog says it queued the job and links to **jobs**, and offers **create**, the dialog says it queued the job and links to **jobs**, and offers
**create another** and **close**. If the controller refuses the `AGENTS.md` text, **create another** and **close**. **create another** starts on step 1 with every field back at
its start, and keeps only the hive you picked. If the controller refuses the `AGENTS.md` text,
the dialog goes back to step 2 and shows the reason there. the dialog goes back to step 2 and shows the reason there.
### Settings at creation ### Settings at creation

View file

@ -208,8 +208,8 @@ export function CreateAgentForm({
label: h.name, label: h.name,
})); }));
const hivesReady = hives !== null && hives.length > 0; const hivesReady = hives !== null && hives.length > 0;
// The controller's size refusal of the AGENTS.md text, shown under its // The controller's size refusal of the AGENTS.md text. It shows under the
// section so a collapsed section still shows it. // instructions box, and `submit` sends the dialog back to that step.
const refusal = const refusal =
result.status === "error" ? agentsMdRefusal(result.problem) : null; result.status === "error" ? agentsMdRefusal(result.problem) : null;
@ -268,7 +268,7 @@ export function CreateAgentForm({
// Enter goes on to the next step, and creates only from the summary. // Enter goes on to the next step, and creates only from the summary.
function onSubmit(e: Event) { function onSubmit(e: Event) {
e.preventDefault(); e.preventDefault();
if (done) return; if (done || result.status === "submitting") return;
if (step === "summary") void submit(); if (step === "summary") void submit();
else if (problem === null) setStep(nextStep(step)); else if (problem === null) setStep(nextStep(step));
} }