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 /); });