swarm ui: the delete confirmation says the agent keeps its session
The dialog only said the agent has to log in again, which reads as a logout. It now says the agent is not logged out and keeps its current session, and a delete that succeeded shows the empty row at once instead of waiting on the re-read.
This commit is contained in:
parent
7dd147adb4
commit
cac9b40714
3 changed files with 7 additions and 3 deletions
|
|
@ -25,7 +25,7 @@ export function storedAtMs(login: StoredLogin): number | null {
|
||||||
}
|
}
|
||||||
|
|
||||||
// What the delete's confirmation says: it removes the swarm's copy, and an
|
// What the delete's confirmation says: it removes the swarm's copy, and an
|
||||||
// agent that already holds a session keeps it.
|
// agent that already holds a session keeps it. The agent is not logged out.
|
||||||
export function deleteMessage(agent: string): string {
|
export function deleteMessage(agent: string): string {
|
||||||
return `Delete the stored claude login for ${agent}? ${agent} has to be logged in again to get a new one.`;
|
return `Delete the stored claude login for ${agent}? ${agent} is not logged out: it keeps its current session. A new login has to be made to get another stored copy.`;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -55,6 +55,8 @@ export function AgentClaudeLogin({ agent }: { agent: string }) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setConfirming(false);
|
setConfirming(false);
|
||||||
|
// Nothing is stored now, whatever the re-read says.
|
||||||
|
setLogin({ stored_at: null });
|
||||||
showToast(`Stored login for ${agent} deleted.`, "ok");
|
showToast(`Stored login for ${agent} deleted.`, "ok");
|
||||||
await load();
|
await load();
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
@ -81,7 +83,8 @@ export function AgentClaudeLogin({ agent }: { agent: string }) {
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<span title={login.stored_at}>
|
<span title={login.stored_at}>
|
||||||
stored {at === null ? login.stored_at : <RelativeTime epochMs={at} />}
|
stored{" "}
|
||||||
|
{at === null ? login.stored_at : <RelativeTime epochMs={at} />}
|
||||||
</span>{" "}
|
</span>{" "}
|
||||||
<Badge
|
<Badge
|
||||||
variant="quiet"
|
variant="quiet"
|
||||||
|
|
|
||||||
|
|
@ -30,4 +30,5 @@ test("the time the store gives is read as an instant, or as nothing", () => {
|
||||||
|
|
||||||
test("the delete's confirmation names the agent", () => {
|
test("the delete's confirmation names the agent", () => {
|
||||||
assert.match(deleteMessage("atlas"), /stored claude login for atlas/);
|
assert.match(deleteMessage("atlas"), /stored claude login for atlas/);
|
||||||
|
assert.match(deleteMessage("atlas"), /not logged out/);
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue