@nguyenquangthai/pi-todo 0.3.2 → 0.3.3

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/CHANGELOG.md CHANGED
@@ -1,5 +1,27 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.3 (2026-07-16)
4
+
5
+ ### Changed
6
+
7
+ - **Overlay heading**: Shows open, running, and completed counts. Completed
8
+ counts include only `completed` todos; `cancelled` todos remain excluded.
9
+ - **Simplified status display**: Removed the ANSI progress bar and `done/total`
10
+ counter from the overlay.
11
+ - **Documentation and screenshot**: Updated the README, screenshot PNG, and
12
+ screenshot HTML source to match the new heading.
13
+
14
+ ## 0.3.2 (2026-07-16)
15
+
16
+ ### Fixed
17
+
18
+ - **Todo ID integrity**: Prevented id-less todos from taking IDs explicitly
19
+ retained by another todo during a full `todo_write` replacement.
20
+ - **Diagnostics**: Added ID-integrity reporting and `repair_needed` status to
21
+ `todo_diagnose`.
22
+ - **Mutation bounds**: Capped todo mutations and persisted snapshots at 200
23
+ items.
24
+
3
25
  ## 0.3.1 (2026-07-15)
4
26
 
5
27
  ### Fixed
package/README.md CHANGED
@@ -81,12 +81,12 @@ Shown above the editor while any **open** todo remains (`pending` / `in_progress
81
81
 
82
82
  Hidden when the list is empty or every item is `completed` / `cancelled`.
83
83
 
84
- Heading shows open + running counts + background-color progress bar, e.g. `# Todos (3 open, 1 running) ▓▓▓▓░░░░ 1/4`:
85
-
86
- - **open** = `pending` + `in_progress`
87
- - **running** = `in_progress` only (0 or 1 after a valid write)
88
- - **progress bar** = ANSI background color via reverse video, using theme `accent` (filled) and `muted` (empty)
89
-
84
+ Heading shows open, running, and completed counts, e.g. `# Todos (3 open, 1 running, 1 completed)`:
85
+
86
+ - **open** = `pending` + `in_progress`
87
+ - **running** = `in_progress` only (0 or 1 after a valid write)
88
+ - **completed** = `completed` only; `cancelled` todos are not counted
89
+
90
90
  Items always stay in the array's workflow order; status changes only their marker/color.
91
91
  When space is tight, the overlay shows the earliest checklist items and `+N more`. If the active item is outside that prefix, it is repeated as `Active: [•] …` rather than moved ahead of earlier work.
92
92
  A blank line separates the heading from the first todo row for visual breathing room.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nguyenquangthai/pi-todo",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "OpenCode-like session todo checklist for the pi coding agent — todowrite/todoread with a live TUI overlay",
5
5
  "type": "module",
6
6
  "author": "QuangThai",
package/src/format.ts CHANGED
@@ -2,7 +2,7 @@ import type { Theme } from "@earendil-works/pi-coding-agent";
2
2
  import { truncateToWidth } from "@earendil-works/pi-tui";
3
3
  import type { TodoItem, TodoStatus } from "./types.js";
4
4
  import { MAX_OVERLAY_LINES, MAX_RESULT_LINES } from "./types.js";
5
- import { countOpenTodos, countRunningTodos, hasOpenTodos } from "./validate.js";
5
+ import { countCompletedTodos, countOpenTodos, countRunningTodos, hasOpenTodos } from "./validate.js";
6
6
 
7
7
 
8
8
  export function getTodoMarker(status: TodoStatus): string {
@@ -107,13 +107,9 @@ export interface RenderOverlayOptions {
107
107
  maxLines?: number;
108
108
  }
109
109
 
110
- /**
111
- * Heading counts (when overlay is visible):
112
- * - open = pending + in_progress
113
- * - running = in_progress only (0 or 1 after a valid todo_write)
114
- * Overlay is hidden when open === 0, so "(0 open, 0 running)" is never shown.
115
- * Includes a background-color progress bar using theme colors.
116
- */
110
+ /**
111
+ * The overlay is hidden when no work remains open.
112
+ */
117
113
  export function renderOverlayLines(
118
114
  todos: readonly TodoItem[],
119
115
  theme: Theme,
@@ -123,27 +119,15 @@ export function renderOverlayLines(
123
119
  if (!shouldShowOverlay(todos)) return [];
124
120
 
125
121
  const maxLines = Math.max(1, options.maxLines ?? MAX_OVERLAY_LINES);
126
- const truncate = (line: string) => truncateToWidth(line, width, "…");
127
- const open = countOpenTodos(todos);
128
- const running = countRunningTodos(todos);
129
-
130
- // Background-color progress bar via reverse video — uses theme accent/dim
131
- const total = todos.length;
132
- const done = total - open;
133
- const barWidth = Math.max(4, Math.min(10, Math.floor(width / 8)));
134
- const filled = Math.round((barWidth * done) / total);
135
- const REV = "\x1b[7m";
136
- const filledBar = REV + theme.fg("accent", " ".repeat(filled));
137
- const emptyBar =
138
- filled < barWidth ? REV + theme.fg("muted", " ".repeat(barWidth - filled)) : "";
139
- const bar = filledBar + emptyBar + "\x1b[0m";
140
-
141
- const heading = truncate(
142
- theme.fg("accent", theme.bold(`# Todos`)) +
143
- theme.fg("dim", ` (${open} open, ${running} running)`) +
144
- ` ${bar}` + theme.fg("dim", ` ${done}/${total}`),
145
- );
146
-
122
+ const truncate = (line: string) => truncateToWidth(line, width, "…");
123
+ const open = countOpenTodos(todos);
124
+ const running = countRunningTodos(todos);
125
+ const completed = countCompletedTodos(todos);
126
+ const heading = truncate(
127
+ theme.fg("accent", theme.bold("# Todos")) +
128
+ theme.fg("dim", ` (${open} open, ${running} running, ${completed} completed)`),
129
+ );
130
+
147
131
  // Small gap between heading and first row — budget -1 to account for the blank line
148
132
  const layout = selectOverlayLayout(todos, Math.max(3, maxLines - 1));
149
133
  const lines: string[] = [heading, ""];
package/src/validate.ts CHANGED
@@ -228,3 +228,8 @@ export function countOpenTodos(todos: readonly TodoItem[]): number {
228
228
  export function countRunningTodos(todos: readonly TodoItem[]): number {
229
229
  return todos.filter((t) => t.status === "in_progress").length;
230
230
  }
231
+
232
+ /** Count successfully finished items; cancelled items are intentionally excluded. */
233
+ export function countCompletedTodos(todos: readonly TodoItem[]): number {
234
+ return todos.filter((todo) => todo.status === "completed").length;
235
+ }