@nguyenquangthai/pi-todo 0.2.6 → 0.2.7

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,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.2.7 (2026-07-15)
4
+
5
+ - Progress bar: use ANSI background-color (reverse video) instead of Unicode chars — zero alignment issues.
6
+ - Progress bar colors: filled uses theme `accent`, empty uses theme `muted` for full theme compatibility.
7
+ - Progress format: `[bg-bar] done/total` with single-width spaces.
8
+ - Clean up heading: remove all Unicode block characters, simple and reliable.
9
+
3
10
  ## 0.2.6 (2026-07-15)
4
11
 
5
12
  - Restore Unicode block chars (`█`/`░`) for progress bar — looks cleaner.
package/README.md CHANGED
@@ -58,11 +58,11 @@ Shown above the editor while any **open** todo remains (`pending` / `in_progress
58
58
 
59
59
  Hidden when the list is empty or every item is `completed` / `cancelled`.
60
60
 
61
- Heading shows open + running counts + progress bar, e.g. `# Todos (3 open, 1 running) ██░░ 25%`:
61
+ Heading shows open + running counts + background-color progress bar, e.g. `# Todos (3 open, 1 running) ▓▓▓▓░░░░ 1/4`:
62
62
 
63
63
  - **open** = `pending` + `in_progress`
64
64
  - **running** = `in_progress` only (0 or 1 after a valid write)
65
- - **progress bar** = Unicode block chars, width adapted to terminal
65
+ - **progress bar** = ANSI background color via reverse video, using theme `accent` (filled) and `muted` (empty)
66
66
 
67
67
  Items within each status group are sorted by priority (high → medium → low).
68
68
  When space is tight, completed/cancelled items collapse into `+N done`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nguyenquangthai/pi-todo",
3
- "version": "0.2.6",
3
+ "version": "0.2.7",
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
@@ -139,7 +139,7 @@ export interface RenderOverlayOptions {
139
139
  * - open = pending + in_progress
140
140
  * - running = in_progress only (0 or 1 after a valid todo_write)
141
141
  * Overlay is hidden when open === 0, so "(0 open, 0 running)" is never shown.
142
- * Includes a visual progress bar: completed / total.
142
+ * Includes a background-color progress bar using theme colors.
143
143
  */
144
144
  export function renderOverlayLines(
145
145
  todos: readonly TodoItem[],
@@ -153,19 +153,22 @@ export function renderOverlayLines(
153
153
  const truncate = (line: string) => truncateToWidth(line, width, "…");
154
154
  const open = countOpenTodos(todos);
155
155
  const running = countRunningTodos(todos);
156
+
157
+ // Background-color progress bar via reverse video — uses theme accent/dim
156
158
  const total = todos.length;
157
159
  const done = total - open;
158
- const pct = total > 0 ? Math.round((done / total) * 100) : 0;
159
- const barWidth = Math.max(2, Math.min(6, Math.floor(width / 16)));
160
+ const barWidth = Math.max(4, Math.min(10, Math.floor(width / 8)));
160
161
  const filled = Math.round((barWidth * done) / total);
161
- const bar =
162
- "".repeat(filled) + "░".repeat(Math.max(0, barWidth - filled));
163
- const pctPad = pct.toString().padStart(3);
162
+ const REV = "\x1b[7m";
163
+ const filledBar = REV + theme.fg("accent", " ".repeat(filled));
164
+ const emptyBar =
165
+ filled < barWidth ? REV + theme.fg("muted", " ".repeat(barWidth - filled)) : "";
166
+ const bar = filledBar + emptyBar + "\x1b[0m";
164
167
 
165
168
  const heading = truncate(
166
169
  theme.fg("accent", theme.bold(`# Todos`)) +
167
170
  theme.fg("dim", ` (${open} open, ${running} running)`) +
168
- theme.fg("muted", ` ${bar} ${pctPad}%`),
171
+ ` ${bar}` + theme.fg("dim", ` ${done}/${total}`),
169
172
  );
170
173
 
171
174
  // Small gap between heading and first row — budget -1 to account for the blank line