From f6a0bb4bb3dfbeab57aae3c67e56506dbafc9928 Mon Sep 17 00:00:00 2001 From: iris Date: Sat, 28 Nov 2026 02:51:27 +0100 Subject: [PATCH] swarm-ui: the three toasts that didn't match read like the rest Two toasts started with a capital and ended with a full stop (the stored login dialog's and the login delete's), and the API key removal had no tone. They are short lowercase phrases with the ok tone now, and the design guide says so. --- docs/5-project/web-ui/design-guide.md | 1 + .../swarm-ui/src/agent/claude-login/ClaudeLoginSteps.ts | 2 +- frontend/packages/swarm-ui/src/agent/detail/AgentApiKey.tsx | 2 +- .../packages/swarm-ui/src/agent/detail/AgentClaudeLogin.tsx | 2 +- frontend/packages/swarm-ui/test/claude-login.test.mjs | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/docs/5-project/web-ui/design-guide.md b/docs/5-project/web-ui/design-guide.md index faf30bb43..643dc0831 100644 --- a/docs/5-project/web-ui/design-guide.md +++ b/docs/5-project/web-ui/design-guide.md @@ -134,6 +134,7 @@ on save, which leaves no button to put it under: that confirms with a toast. An a list that refreshes confirms with a toast. A change the page already shows (a card that flips or goes, a row that appears) says nothing. A new action picks the way by this rule and doesn't add a fourth. +A toast is a short lowercase phrase with no full stop, and its tone is `ok` when it confirms a change (`removed example.com`, `sent to 2 agents`). ## Empty states diff --git a/frontend/packages/swarm-ui/src/agent/claude-login/ClaudeLoginSteps.ts b/frontend/packages/swarm-ui/src/agent/claude-login/ClaudeLoginSteps.ts index e0912649e..54cfd1977 100644 --- a/frontend/packages/swarm-ui/src/agent/claude-login/ClaudeLoginSteps.ts +++ b/frontend/packages/swarm-ui/src/agent/claude-login/ClaudeLoginSteps.ts @@ -30,7 +30,7 @@ export function afterCode(problem: ProblemDetails | null): LoginStep { // What the toast says once the login is stored. export function storedMessage(agent: string): string { - return `Login stored. ${agent} picks it up within a minute and resumes.`; + return `login stored: ${agent} picks it up within a minute and resumes`; } // Whether closing the dialog leaves a login running that should be diff --git a/frontend/packages/swarm-ui/src/agent/detail/AgentApiKey.tsx b/frontend/packages/swarm-ui/src/agent/detail/AgentApiKey.tsx index 665a5b3ab..c68373b4a 100644 --- a/frontend/packages/swarm-ui/src/agent/detail/AgentApiKey.tsx +++ b/frontend/packages/swarm-ui/src/agent/detail/AgentApiKey.tsx @@ -57,7 +57,7 @@ export function AgentApiKey({ hive, agent }: { hive: string; agent: string }) { return; } setConfirming(false); - showToast(`removed the API key for ${agent}`); + showToast(`removed the API key for ${agent}`, "ok"); await load(); } catch (err) { setRemoveError({ detail: String(err) }); diff --git a/frontend/packages/swarm-ui/src/agent/detail/AgentClaudeLogin.tsx b/frontend/packages/swarm-ui/src/agent/detail/AgentClaudeLogin.tsx index 67797cc51..685bdf099 100644 --- a/frontend/packages/swarm-ui/src/agent/detail/AgentClaudeLogin.tsx +++ b/frontend/packages/swarm-ui/src/agent/detail/AgentClaudeLogin.tsx @@ -61,7 +61,7 @@ export function AgentClaudeLogin({ agent }: { agent: string }) { setConfirming(false); // Nothing is stored now, whatever the re-read says. setLogin({ stored_at: null }); - showToast(`Stored login for ${agent} deleted.`, "ok"); + showToast(`deleted the stored login for ${agent}`, "ok"); await load(); } catch (err) { setDeleteError({ detail: String(err) }); diff --git a/frontend/packages/swarm-ui/test/claude-login.test.mjs b/frontend/packages/swarm-ui/test/claude-login.test.mjs index 194b0560a..33f2bfe4c 100644 --- a/frontend/packages/swarm-ui/test/claude-login.test.mjs +++ b/frontend/packages/swarm-ui/test/claude-login.test.mjs @@ -80,5 +80,5 @@ test("a pasted code is trimmed, and a blank one is nothing", () => { }); test("the stored toast names the agent", () => { - assert.match(storedMessage("atlas"), /^Login stored\. atlas /); + assert.match(storedMessage("atlas"), /^login stored: atlas /); });