Rename task widget to todos

This commit is contained in:
jb
2026-08-26 16:40:05 -04:00
parent b654c3c81b
commit 1a437f50b4
6 changed files with 48 additions and 12 deletions
+6 -2
View File
@@ -12,7 +12,7 @@ import {
renderWidgetTree,
snapshotStats,
} from "../src/ui.ts";
import { updateTaskWidget } from "../src/widget.ts";
import { TODO_ANIMATION_INTERVAL_MS, updateTaskWidget } from "../src/widget.ts";
const plainTheme = {
fg: (_color: string, text: string) => text,
@@ -49,7 +49,7 @@ function fixture(): TaskState {
test("renders an adaptive progress bar and stays within width", () => {
const stats = fixture().stats();
const wide = stripAnsi(renderProgressHeader(stats, plainTheme as never, 40));
assert.match(wide, /^ Tasks 1\/5 · !1 ━{4}─{16}$/);
assert.match(wide, /^ Todos 1\/5 · !1 ━{4}─{16}$/);
assert.ok(visibleWidth(wide) <= 40);
const narrow = renderProgressHeader(stats, plainTheme as never, 12);
@@ -353,6 +353,10 @@ test("hides an empty widget and renders a populated one", () => {
assert.ok(lines.every((line) => visibleWidth(line) <= 30));
});
test("animates active todos twice per second", () => {
assert.equal(TODO_ANIMATION_INTERVAL_MS, 500);
});
test("live widgets request rerenders and dispose their interval", async () => {
let now = 0;
const state = new TaskState(() => now);