From 025d39d14149acefc12233b0d4eee9ed3020b2e4 Mon Sep 17 00:00:00 2001 From: iris Date: Thu, 26 Nov 2026 21:05:47 +0100 Subject: [PATCH] swarm-ui: the inference editor fills the section, and the login and API key get a row each The editor stopped at 60em, and the claude login row packed the login and the API key badges into one wrapping line. The width cap is gone, and the API key has its own row beside the login's. --- docs/4-implementation/web-ui/swarm-ui.md | 14 ++++++++------ .../swarm-ui/src/agent/detail/AgentApiKey.tsx | 13 ++++++------- .../swarm-ui/src/agent/detail/AgentDetail.tsx | 8 +++++--- .../swarm-ui/src/agent/detail/AgentInference.css | 10 +++++----- .../swarm-ui/src/agent/detail/AgentInference.tsx | 2 +- 5 files changed, 25 insertions(+), 22 deletions(-) diff --git a/docs/4-implementation/web-ui/swarm-ui.md b/docs/4-implementation/web-ui/swarm-ui.md index c52662a70..5b4d0040c 100644 --- a/docs/4-implementation/web-ui/swarm-ui.md +++ b/docs/4-implementation/web-ui/swarm-ui.md @@ -204,8 +204,9 @@ starts open, the other five folded: - **instructions**: the agent's AGENTS.md, as an editor you can type in. - **inference**: how the agent thinks and what it costs, as an editor in place: its model and effort, the subagent settings and the two context limits, then - the claude login and API key (the login's state, **log in**, and **set API - key**), since the key is how the agent reaches claude. + the claude login and API key, each on its own row (the login's state and + **log in**, then the key's state and **set API key**), since the key is how + the agent reaches claude. The editor fills the section's width. - **access**: what the agent may reach and use: internet, allowed domains, repositories, SSH, permissions and its resource caps. Each shows a badge; select it to open the control that changes it (described below). @@ -1180,10 +1181,11 @@ reads back and its box starts with the stored text. The secrets never read back, so their box starts empty and replaces the stored secrets only when filled and saved. -The **claude login** row of an agent's details also sets the API key: **set API -key** (or **replace API key**) sends the key as `ANTHROPIC_API_KEY=` to the -agent's secrets, **remove API key** deletes them, and **advanced** opens the -form above. The row shows whether the store holds a key and never the key. The +The **API key** row of an agent's details, under the **claude login** row, sets +the API key: **set API key** (or **replace API key**) sends the key as +`ANTHROPIC_API_KEY=` to the agent's secrets, **remove API key** deletes +them, and **advanced** opens the form above. The row shows whether the store +holds a key and never the key. The form reads the stored configuration first: a 404 means the store holds none, and any other failed read shows the error with a **retry** button and keeps **save** disabled, so a save can't replace text that was never read. A diff --git a/frontend/packages/swarm-ui/src/agent/detail/AgentApiKey.tsx b/frontend/packages/swarm-ui/src/agent/detail/AgentApiKey.tsx index ec5e0eca6..665a5b3ab 100644 --- a/frontend/packages/swarm-ui/src/agent/detail/AgentApiKey.tsx +++ b/frontend/packages/swarm-ui/src/agent/detail/AgentApiKey.tsx @@ -1,4 +1,4 @@ -// — how one agent is billed, in the claude login row: whether an +// — how one agent is billed, in the API key row: whether an // API key is stored (`GET …/backend-secrets`, which never returns the key), a // button that sets or replaces it, one that removes it, and the advanced // backend settings. With a key stored the agent tries the key instead of @@ -11,6 +11,7 @@ import { readApiError, type ProblemDetails } from "@hive/shared/api-error.js"; import { Badge } from "@hive/shared/badge.js"; import { ConfirmDialog } from "../../ui/confirm-dialog/ConfirmDialog.js"; import { Dialog } from "../../ui/dialog/Dialog.js"; +import { Hint } from "../../ui/hint/Hint.js"; import { showToast } from "../../ui/toast/toasts.js"; import { LinkApiKeyForm } from "../../pages/LinkApiKeyForm.js"; import { LinkBackendEnvForm } from "../../pages/LinkBackendEnvForm.js"; @@ -70,13 +71,11 @@ export function AgentApiKey({ hive, agent }: { hive: string; agent: string }) { {error ? ( ) : null} - {stored === null ? null : ( + {stored === null ? null : stored ? ( + <>stored + ) : ( <> - {" "} + none stored{" "} )} - {hive ? ( - - ) : null} + {hive ? ( + + + + ) : null} ); } diff --git a/frontend/packages/swarm-ui/src/agent/detail/AgentInference.css b/frontend/packages/swarm-ui/src/agent/detail/AgentInference.css index c636a4fd4..359553236 100644 --- a/frontend/packages/swarm-ui/src/agent/detail/AgentInference.css +++ b/frontend/packages/swarm-ui/src/agent/detail/AgentInference.css @@ -1,5 +1,5 @@ -/* — the settings as labelled values, two to a line where there - is room, each value followed by where it comes from. */ +/* — the settings as labelled values, one to a line, each + value followed by where it comes from. */ .ui-agent-inference { display: flex; flex-direction: column; @@ -8,14 +8,15 @@ } .ui-agent-inference-rows { display: grid; - grid-template-columns: repeat(auto-fit, minmax(22em, 1fr)); - gap: 0.3em 2em; + grid-template-columns: minmax(0, 1fr); + gap: 0.4em; align-self: stretch; margin: 0; } .ui-agent-inference-pair { display: grid; grid-template-columns: 12em minmax(0, 1fr); + align-items: baseline; gap: 0 1em; } .ui-agent-inference-pair dt { @@ -33,7 +34,6 @@ .ui-agent-inference .ui-form-stack { align-items: stretch; align-self: stretch; - max-width: 60em; margin-top: 0; } /* The claude login row under the editor. */ diff --git a/frontend/packages/swarm-ui/src/agent/detail/AgentInference.tsx b/frontend/packages/swarm-ui/src/agent/detail/AgentInference.tsx index dffa701f2..fff341cb5 100644 --- a/frontend/packages/swarm-ui/src/agent/detail/AgentInference.tsx +++ b/frontend/packages/swarm-ui/src/agent/detail/AgentInference.tsx @@ -259,7 +259,7 @@ export function InferenceFields({ ); } -/** Labelled values, two to a line where there is room. */ +/** Labelled values, one to a line. */ export function InferenceRows({ children }: { children: ComponentChildren }) { return
{children}
; }