@xynogen/pix-todo 0.1.23 → 0.1.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/src/todo.test.ts +11 -4
- package/src/todo.ts +6 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xynogen/pix-todo",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.25",
|
|
4
4
|
"description": "Pi tool — durable execution checklist (todo)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@xynogen/pix-data": "^0.4.3",
|
|
38
38
|
"@xynogen/pix-pretty": "^1.11.2",
|
|
39
|
-
"@xynogen/pix-runtime": "^0.
|
|
39
|
+
"@xynogen/pix-runtime": "^0.6.0",
|
|
40
40
|
"typebox": "^1.1.38"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
package/src/todo.test.ts
CHANGED
|
@@ -819,7 +819,7 @@ describe("todo card layout", () => {
|
|
|
819
819
|
|
|
820
820
|
expect(rendered).toContain("1. alpha");
|
|
821
821
|
expect(rendered).toContain("[muted]○[/]");
|
|
822
|
-
expect(rendered).not.toContain("[success]✓[/] [toolTitle]<b>todo</b>[/]");
|
|
822
|
+
expect(rendered).not.toContain("[success]✓ [/] [toolTitle]<b>todo</b>[/]");
|
|
823
823
|
});
|
|
824
824
|
|
|
825
825
|
test("failed todo actions render their exact error", async () => {
|
|
@@ -860,7 +860,7 @@ describe("todo card layout", () => {
|
|
|
860
860
|
expect(result.details).toBeDefined();
|
|
861
861
|
expect(lines).toHaveLength(1);
|
|
862
862
|
expect(lines[0]?.trimEnd()).toBe(
|
|
863
|
-
"[success]✓[/] [toolTitle]<b>todo</b>[/] [muted]#2 todo renderer[/] [dim]·[/] [dim]1/2 done[/]",
|
|
863
|
+
"[success]✓ [/] [toolTitle]<b>todo</b>[/] [muted]#2 todo renderer[/] [dim]·[/] [dim]1/2 done[/]",
|
|
864
864
|
);
|
|
865
865
|
});
|
|
866
866
|
});
|
|
@@ -891,7 +891,14 @@ describe("renderResult snapshot isolation", () => {
|
|
|
891
891
|
describe("renderTodoSummaryLine (collapsed one-liner)", () => {
|
|
892
892
|
test("empty list renders a compact tool row", () => {
|
|
893
893
|
expect(renderTodoSummaryLine([], tagTheme)).toBe(
|
|
894
|
-
"[success]✓[/] [toolTitle]<b>todo</b>[/] [muted]empty[/]",
|
|
894
|
+
"[success]✓ [/] [toolTitle]<b>todo</b>[/] [muted]empty[/]",
|
|
895
|
+
);
|
|
896
|
+
});
|
|
897
|
+
|
|
898
|
+
test("uses warning status when work is blocked", () => {
|
|
899
|
+
const items: TodoItem[] = [{ id: 1, text: "Need approval", status: "blocked" }];
|
|
900
|
+
expect(renderTodoSummaryLine(items, tagTheme)).toBe(
|
|
901
|
+
"[warning]⚠ [/] [toolTitle]<b>todo</b>[/] [muted]checklist[/] [dim]·[/] [dim]0/1 done · 1 blocked[/]",
|
|
895
902
|
);
|
|
896
903
|
});
|
|
897
904
|
|
|
@@ -901,7 +908,7 @@ describe("renderTodoSummaryLine (collapsed one-liner)", () => {
|
|
|
901
908
|
{ id: 2, text: "b", status: "in_progress" },
|
|
902
909
|
];
|
|
903
910
|
expect(renderTodoSummaryLine(items, tagTheme)).toBe(
|
|
904
|
-
"[success]✓[/] [toolTitle]<b>todo</b>[/] [muted]#2 b[/] [dim]·[/] [dim]1/2 done[/]",
|
|
911
|
+
"[success]✓ [/] [toolTitle]<b>todo</b>[/] [muted]#2 b[/] [dim]·[/] [dim]1/2 done[/]",
|
|
905
912
|
);
|
|
906
913
|
});
|
|
907
914
|
});
|
package/src/todo.ts
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
13
13
|
import { Text } from "@earendil-works/pi-tui";
|
|
14
14
|
import { icon } from "@xynogen/pix-pretty/icon-catalog";
|
|
15
|
-
import { formatCollapsedToolRow } from "@xynogen/pix-pretty/utils";
|
|
15
|
+
import { dotJoin, formatCollapsedToolRow } from "@xynogen/pix-pretty/utils";
|
|
16
16
|
import { type CollapseState, tickCollapse } from "@xynogen/pix-runtime/collapse";
|
|
17
17
|
import { once } from "@xynogen/pix-runtime/once";
|
|
18
18
|
import { Type } from "typebox";
|
|
@@ -64,15 +64,16 @@ export function renderTodoSummaryLine(items: TodoItem[], theme: TodoTheme): stri
|
|
|
64
64
|
const done = items.filter((t) => t.status === "done").length;
|
|
65
65
|
const active = items.find((t) => t.status === "in_progress");
|
|
66
66
|
const blocked = items.filter((t) => t.status === "blocked").length;
|
|
67
|
-
const meta = [`${done}/${items.length} done`, blocked > 0
|
|
68
|
-
.filter(Boolean)
|
|
69
|
-
.join(" · ");
|
|
67
|
+
const meta = dotJoin([`${done}/${items.length} done`, blocked > 0 && `${blocked} blocked`]);
|
|
70
68
|
const target = active
|
|
71
69
|
? `#${active.id} ${active.text}`
|
|
72
70
|
: done === items.length
|
|
73
71
|
? "complete"
|
|
74
72
|
: "checklist";
|
|
75
|
-
|
|
73
|
+
// Blocked work with nothing active is not a success — surface the warning glyph
|
|
74
|
+
// (text meta already names the block count) so status is not color-only.
|
|
75
|
+
const status = blocked > 0 && !active && done !== items.length ? "warning" : "success";
|
|
76
|
+
return formatCollapsedToolRow(theme, "todo", target, meta, status);
|
|
76
77
|
}
|
|
77
78
|
|
|
78
79
|
/** Colored checklist for the TUI: glyphs tinted by status, active row bold. */
|