Reuse Unicode goal symbols in widget status counts

Co-Authored-By: Pi/OpenAI <288921227+claudypoo@users.noreply.github.com>
This commit is contained in:
wassname
2026-09-14 05:11:41 +08:00
co-authored by Pi/OpenAI
parent 9b5a4747af
commit 52d7c463d9
2 changed files with 5 additions and 6 deletions
+1 -2
View File
@@ -141,10 +141,9 @@ export default function mainSupervisor(pi: ExtensionAPI) {
const lines = visible.map((g) => `${mark(g.status)} G${items.indexOf(g) + 1}: ${g.subject}`);
const hidden = sorted.slice(WIDGET_GOAL_LIMIT);
if (hidden.length) {
const symbols: Record<GoalStatus, string> = { done: "[x]", active: "[/]", open: "[ ]", cancelled: "[-]" };
const counts = (["done", "active", "open", "cancelled"] as const).map(status => {
const count = hidden.filter(g => g.status === status).length;
return count ? `${count} ${symbols[status]}` : "";
return count ? `${count} ${mark(status)}` : "";
}).filter(Boolean);
lines.push(`… ${counts.join(", ")}`);
}
+4 -4
View File
@@ -683,14 +683,14 @@ it("prioritizes unfinished goals and says when the widget list is truncated", as
const f = fixture(); await f.draft();
writeFileSync(f.path, "- [x] goal: completed one\n- [x] goal: completed two\n- [/] goal: active work\n- [ ] goal: open one\n- [ ] goal: open two\n");
await f.command("ready");
expect(f.ctx.ui.setWidget.mock.lastCall?.[1]).toEqual(["◼ G3: active work", "◻ G4: open one", "◻ G5: open two", "… 2 [x]"]);
expect(f.ctx.ui.setWidget.mock.lastCall?.[1]).toEqual(["◼ G3: active work", "◻ G4: open one", "◻ G5: open two", "… 2 ✔"]);
f.shutdown();
});
it.each([
["[x]", "[ ]", "[ ]", "… 1 [x], 2 [ ]"],
["[/]", "[x]", "[-]", "… 1 [x], 1 [/], 1 [-]"],
["[ ]", "[ ]", "[ ]", "… 3 [ ]"],
["[x]", "[ ]", "[ ]", "… 1 ✔, 2 ◻"],
["[/]", "[x]", "[-]", "… 1 ✔, 1 ◼, 1 ✗"],
["[ ]", "[ ]", "[ ]", "… 3 ◻"],
])("summarizes only hidden goal statuses: %s %s %s", async (first, second, third, summary) => {
const f = fixture(); await f.draft();
const marks = ["[/]", "[/]", "[/]", first, second, third];