@nguyenquangthai/pi-todo 0.2.5 → 0.2.6
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 +6 -0
- package/README.md +2 -2
- package/package.json +1 -1
- package/src/format.ts +5 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.2.6 (2026-07-15)
|
|
4
|
+
|
|
5
|
+
- Restore Unicode block chars (`█`/`░`) for progress bar — looks cleaner.
|
|
6
|
+
- Fix alignment: halve bar width (double-width chars) + pad percentage to 3 chars so heading never shifts when % changes.
|
|
7
|
+
- README: update progress bar example to match.
|
|
8
|
+
|
|
3
9
|
## 0.2.5 (2026-07-15)
|
|
4
10
|
|
|
5
11
|
- Fix progress bar: use single-width ASCII (`#`/`·`) instead of double-width Unicode (`█`/`░`) to avoid alignment issues in terminal.
|
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)
|
|
61
|
+
Heading shows open + running counts + progress bar, e.g. `# Todos (3 open, 1 running) ██░░ 25%`:
|
|
62
62
|
|
|
63
63
|
- **open** = `pending` + `in_progress`
|
|
64
64
|
- **running** = `in_progress` only (0 or 1 after a valid write)
|
|
65
|
-
- **progress bar** =
|
|
65
|
+
- **progress bar** = Unicode block chars, width adapted to terminal
|
|
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
package/src/format.ts
CHANGED
|
@@ -156,14 +156,16 @@ export function renderOverlayLines(
|
|
|
156
156
|
const total = todos.length;
|
|
157
157
|
const done = total - open;
|
|
158
158
|
const pct = total > 0 ? Math.round((done / total) * 100) : 0;
|
|
159
|
-
const barWidth = Math.max(
|
|
159
|
+
const barWidth = Math.max(2, Math.min(6, Math.floor(width / 16)));
|
|
160
160
|
const filled = Math.round((barWidth * done) / total);
|
|
161
|
-
const bar =
|
|
161
|
+
const bar =
|
|
162
|
+
"█".repeat(filled) + "░".repeat(Math.max(0, barWidth - filled));
|
|
163
|
+
const pctPad = pct.toString().padStart(3);
|
|
162
164
|
|
|
163
165
|
const heading = truncate(
|
|
164
166
|
theme.fg("accent", theme.bold(`# Todos`)) +
|
|
165
167
|
theme.fg("dim", ` (${open} open, ${running} running)`) +
|
|
166
|
-
theme.fg("muted", ` ${bar} ${
|
|
168
|
+
theme.fg("muted", ` ${bar} ${pctPad}%`),
|
|
167
169
|
);
|
|
168
170
|
|
|
169
171
|
// Small gap between heading and first row — budget -1 to account for the blank line
|