feat: a green check confirms a send and info notices fade after 3 s

Co-Authored-By: Ovis Fast (Claude) <[email protected]>
This commit is contained in:
FactorandOvis Fast committed 2026-11-20 10:06:17 +01:00
1 parent 0fad0a2e4e
commit 56be86391b
5 files changed
+126 -15

No files matched your search

+23 -1
View File
@@ -2,7 +2,7 @@ import test from "node:test";
import assert from "node:assert/strict";
import {
targetAgent, agentKey, agentName, agentStatus, createGate, gatePasses, openGate, closeGate,
isPlainEnter, statusText, queueLabel, applySuggestion, insertedNewline,
isPlainEnter, statusText, queueLabel, applySuggestion, insertedNewline, noticeExpired,
} from "../herdr/herdr-composer/mods/herdr-composer/view.js";
const agents = [{ address: "t1", app: "claude-code" }, { address: "a2" }];
@@ -165,3 +165,25 @@ test("fieldBackground: the darkest color the theme has, darker than the panel",
assert.equal(fieldBackground({}, "#2a2c31"), "#2a2c31");
assert.equal(fieldBackground({ background: "nope" }, "#2a2c31"), "#2a2c31");
});
test("noticeExpired: the same info notice expires", () => {
const info = { text: "a", level: "info" };
assert.equal(noticeExpired(info, info), true);
});
test("noticeExpired: another notice with the same text is not touched", () => {
const scheduled = { text: "a", level: "info" };
assert.equal(noticeExpired({ text: "a", level: "info" }, scheduled), false);
});
test("noticeExpired: a problem or an error stays, and so does an info that was replaced by one", () => {
const problem = { text: "b", level: "problem" };
const error = { text: "c", level: "error" };
assert.equal(noticeExpired(problem, problem), false);
assert.equal(noticeExpired(error, error), false);
assert.equal(noticeExpired(problem, { text: "a", level: "info" }), false);
});
test("noticeExpired: no current notice is nothing to clear", () => {
assert.equal(noticeExpired(null, { text: "a", level: "info" }), false);
});