Watch
0
0
Fork
You've already forked hyperhive
0

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.
This commit is contained in:
iris 2026-11-26 21:05:47 +01:00
commit 025d39d141
4 changed files with 25 additions and 22 deletions

View file

@ -1,4 +1,4 @@
// <AgentApiKey> — how one agent is billed, in the claude login row: whether an
// <AgentApiKey> — 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 ? (
<ApiErrorPanel context="reading the API key failed" problem={error} />
) : null}
{stored === null ? null : (
{stored === null ? null : stored ? (
<>stored </>
) : (
<>
<Badge
label="API key"
value={stored ? "stored" : "none"}
tone={stored ? "ok" : "neutral"}
/>{" "}
<Hint as="span">none stored</Hint>{" "}
</>
)}
<Badge

View file

@ -53,10 +53,12 @@ function ClaudeRows({ agent, hive }: { agent: string; hive: string | null }) {
<InferenceRows>
<InferencePair label="claude login">
<AgentClaudeLogin key={agent} agent={agent} />
{hive ? (
<AgentApiKey key={`${hive}/${agent}`} hive={hive} agent={agent} />
) : null}
</InferencePair>
{hive ? (
<InferencePair label="API key">
<AgentApiKey key={`${hive}/${agent}`} hive={hive} agent={agent} />
</InferencePair>
) : null}
</InferenceRows>
);
}

View file

@ -1,5 +1,5 @@
/* <AgentInference> — the settings as labelled values, two to a line where there
is room, each value followed by where it comes from. */
/* <AgentInference> — 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. */

View file

@ -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 <dl class="ui-agent-inference-rows">{children}</dl>;
}