From 0dfd6612cecf932d92ab1a51286303fb6de5bf73 Mon Sep 17 00:00:00 2001 From: wassname Date: Thu, 2 Jul 2026 06:44:19 +0800 Subject: [PATCH] widget: hide finished goals entirely (no summary line) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop the '✔ N done' summary line -- done/cancelled goals now render nothing in the widget. The done count is already in the status bar (◷ n/N goals) and full history is in goals.md / the ## Log. Co-Authored-By: Claudypoo <288921227+claudypoo@users.noreply.github.com> --- src/index.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/index.ts b/src/index.ts index aa89645..9eb2a16 100644 --- a/src/index.ts +++ b/src/index.ts @@ -134,21 +134,15 @@ export default function piGoalsExtension(pi: ExtensionAPI): void { // plus a footer path -- one line carries both. Title trails the path when set. const header = ctx.ui.theme.fg("muted", doc.title ? `${PLAN_REL}: ${doc.title}` : PLAN_REL); const lines = [header]; - // Show the live work (active + open) in full, in file order; finished goals (done/cancelled) get - // cropped to one muted summary line so completed goals don't push the current work off screen as - // they pile up across sessions. Full history still lives in goals.md / the ## Log. + // Only the live work (active + open) gets lines; finished goals (done/cancelled) are hidden so + // they never push the current work off screen. The done count lives in the status bar (◷ n/N + // goals) and the full history in goals.md / the ## Log. const live = doc.goals.filter((g) => g.status === "active" || g.status === "open"); for (const g of live) { const total = g.subtasks.length; const done = g.subtasks.filter((s) => s.status === "done").length; lines.push(`${mark[g.status]} ${g.subject}${total ? ` (${done}/${total} tasks)` : ""}`); } - const doneN = doc.goals.filter((g) => g.status === "done").length; - const cancN = doc.goals.filter((g) => g.status === "cancelled").length; - if (doneN || cancN) { - const parts = [doneN ? `✔ ${doneN} done` : "", cancN ? `✗ ${cancN} cancelled` : ""].filter(Boolean); - lines.push(ctx.ui.theme.fg("muted", parts.join(" "))); - } return lines; }