swarm-ui: show the AGENTS.md size refusal when the instructions section is collapsed
The refusal sat inside the collapsed section, and the general error panel hides while a refusal is set, so a refused submit with the section closed showed nothing. The refusal now renders under the section, outside the details element.
This commit is contained in:
parent
f068d0b2fc
commit
dd7fc1c9af
3 changed files with 9 additions and 7 deletions
|
|
@ -394,8 +394,9 @@ whitespace, it sends nothing and the agent starts without the file. Otherwise
|
||||||
the text goes as typed in the optional `agents_md` field of `POST /api/agents`.
|
the text goes as typed in the optional `agents_md` field of `POST /api/agents`.
|
||||||
The agent writes it on its first start, and only when it has no `AGENTS.md`
|
The agent writes it on its first start, and only when it has no `AGENTS.md`
|
||||||
yet, so creating an agent again under a name that has one never replaces it.
|
yet, so creating an agent again under a name that has one never replaces it.
|
||||||
The controller refuses a text over 64 KiB; its reason shows under the box and
|
The controller refuses a text over 64 KiB. Its reason shows under the
|
||||||
the swarm creates no agent. After a successful create the box empties. The
|
section, open or not, and the swarm creates no agent. After a successful
|
||||||
|
create the box empties. The
|
||||||
[instructions editor](#editing-an-agents-instructions) changes the file later.
|
[instructions editor](#editing-an-agents-instructions) changes the file later.
|
||||||
The [swarm README](README.md#an-agents-agentsmd) has the wire details.
|
The [swarm README](README.md#an-agents-agentsmd) has the wire details.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
.create-agent-result-ok {
|
.create-agent-result-ok {
|
||||||
color: var(--green);
|
color: var(--green);
|
||||||
}
|
}
|
||||||
/* The controller's refusal of the AGENTS.md text, under its box. */
|
/* The controller's refusal of the AGENTS.md text, under its section. */
|
||||||
.create-agent-field-error {
|
.create-agent-field-error {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: var(--red);
|
color: var(--red);
|
||||||
|
|
|
||||||
|
|
@ -215,7 +215,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 by its box.
|
// The controller's size refusal of the AGENTS.md text, shown under its
|
||||||
|
// section so a collapsed section still shows it.
|
||||||
const refusal =
|
const refusal =
|
||||||
result.status === "error" ? agentsMdRefusal(result.problem) : null;
|
result.status === "error" ? agentsMdRefusal(result.problem) : null;
|
||||||
|
|
||||||
|
|
@ -385,11 +386,11 @@ export function CreateAgentForm({
|
||||||
placeholder="the text the agent's AGENTS.md starts with; leave empty for none"
|
placeholder="the text the agent's AGENTS.md starts with; leave empty for none"
|
||||||
onInput={setAgentsMd}
|
onInput={setAgentsMd}
|
||||||
/>
|
/>
|
||||||
{refusal !== null && (
|
|
||||||
<p class="create-agent-field-error">{refusal}</p>
|
|
||||||
)}
|
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
|
{refusal !== null && (
|
||||||
|
<p class="create-agent-field-error">{refusal}</p>
|
||||||
|
)}
|
||||||
<Button
|
<Button
|
||||||
variant="primary"
|
variant="primary"
|
||||||
type="submit"
|
type="submit"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue