Initial release

This commit is contained in:
lesetong
2026-07-22 23:35:04 +08:00
commit 281f3c1615
17 changed files with 5001 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
import type { ExtensionContext } from "@earendil-works/pi-coding-agent";
import type { TaskState } from "./state.ts";
import { renderProgressHeader, renderTree } from "./ui.ts";
const WIDGET_ID = "pi-todo-herdr";
export function clearTaskWidget(ctx: ExtensionContext): void {
ctx.ui.setWidget(WIDGET_ID, undefined);
}
export function updateTaskWidget(state: TaskState, ctx: ExtensionContext, visible: boolean): void {
const tasks = state.list();
if (!visible || tasks.length === 0) {
clearTaskWidget(ctx);
return;
}
const stats = state.stats();
ctx.ui.setWidget(WIDGET_ID, (_tui, theme) => ({
render(width: number): string[] {
return [renderProgressHeader(stats, theme, width), ...renderTree(tasks, theme, width)];
},
invalidate(): void {},
}));
}