Official
sidebar
Built-in sidebar UI (JavaScript UI plugin).
The app opens the listing; nothing installs until an agent in your Plugins workspace has read the files and you enable the plugin. In a terminal: dvg install divergence/sidebar@0.2.6
Permissions in 0.2.6
Files
snooze-command.test.ts1.9 KB
import assert from "node:assert/strict";
import { afterEach, mock, test } from "node:test";
import activate from "./main.ts";
import { fakeHost } from "./testing.ts";
afterEach(() => mock.timers.reset());
test("snoozing the focused chat's row indefinitely replaces a timed snooze and preserves other rows", async () => {
const fake = fakeHost([
{ id: "a", title: "First", at: "2026-10-02T00:00:00Z" },
{ id: "b", title: "Second", at: "2026-10-01T00:00:00Z" },
]);
const dispose = activate(fake.api);
try {
fake.update({ chatId: "a" });
await fake.settle();
await fake.callService("divergence/sidebar", "snooze", { taskId: "t-a", until: Date.now() + 10000 });
await fake.run("sidebar.snoozeChat");
await fake.settle();
const placed = fake.storage.get("placedChats") as Record<string, { section: string; until?: number }>;
assert.equal(placed.a?.section, "snoozed");
assert.equal(placed.a?.until, undefined);
assert.equal(placed.b, undefined);
} finally { await dispose(); }
});
test("the shortcut snoozes a task's row and leaves a completed row alone", async () => {
const fake = fakeHost([
{ id: "a", title: "First", at: "2026-10-02T00:00:00Z" },
{ id: "b", title: "Second", at: "2026-10-01T00:00:00Z" },
{ id: "done", title: "Done", at: "2026-10-01T00:00:00Z", done: "2026-10-02T00:00:00Z" },
], [{ id: "group", chats: ["a", "b"] }]);
const dispose = activate(fake.api);
try {
fake.update({ chatId: "b" });
await fake.settle();
await fake.run("sidebar.snoozeChat");
await fake.settle();
const placed = fake.storage.get("placedChats") as Record<string, { section: string }>;
assert.equal(Object.values(placed).filter((p) => p.section === "snoozed").length, 1);
fake.update({ chatId: "done" });
await fake.run("sidebar.snoozeChat");
await fake.settle();
assert.deepEqual(fake.storage.get("placedChats"), placed);
} finally { await dispose(); }
});
No comments yet.