Skip to content

Local-first AI coding agent desktop: Electron + Rust host core + pi Agent Harness + user-installable plugins

fix(todo-dock): clarify checklist disclosure control

vastsad215d2118da7
diff --git a/apps/desktop/src/components/TodoDock.tsx b/apps/desktop/src/components/TodoDock.tsx
index ef32c2e8d..084f2cad5 100644
--- a/apps/desktop/src/components/TodoDock.tsx
+++ b/apps/desktop/src/components/TodoDock.tsx
@@ -42,32 +42,33 @@ export function TodoDock({ sessionId }: { sessionId: string }) {
: finished
? t("chat.todo.completed", { completed, total: denominator })
: t("chat.todo.progress", { completed, total: denominator });
- const statusLabel = current
- ? t("chat.todo.current", { completed, total: denominator, content: current.content })
- : progressLabel;
-
return (
<div className={`todo-dock${expanded ? " is-expanded" : ""}`}>
- <Button
- type="button"
- variant="ghost"
- className="todo-dock-header"
- aria-label={statusLabel}
- aria-controls={contentId}
- aria-expanded={expanded}
- onClick={() => setExpanded((value) => !value)}
- >
+ <div className="todo-dock-header">
<span className="todo-dock-header-symbol" aria-hidden>
{allCancelled ? "⊘" : finished ? "✓" : "◐"}
</span>
- <span className="todo-dock-header-text">{progressLabel}</span>
- {current ? (
- <span className="todo-dock-header-current" title={current.content}>
- {current.content}
- </span>
- ) : null}
- {expanded ? <IconChevronUp size={14} /> : <IconChevronDown size={14} />}
- </Button>
+ <div className="todo-dock-header-copy">
+ <span className="todo-dock-header-text">{progressLabel}</span>
+ {current ? (
+ <span className="todo-dock-header-current" title={current.content}>
+ {current.content}
+ </span>
+ ) : null}
+ </div>
+ <Button
+ type="button"
+ variant="ghost"
+ className="todo-dock-toggle"
+ aria-label={expanded ? t("chat.todo.collapse") : t("chat.todo.expand")}
+ title={expanded ? t("chat.todo.collapse") : t("chat.todo.expand")}
+ aria-controls={contentId}
+ aria-expanded={expanded}
+ onClick={() => setExpanded((value) => !value)}
+ >
+ {expanded ? <IconChevronDown size={14} /> : <IconChevronUp size={14} />}
+ </Button>
+ </div>
<div id={contentId} className="todo-dock-content" aria-hidden={!expanded}>
<div className="todo-dock-clip">
{/* The expanded dock lists every row (#1319): the list scrolls
diff --git a/apps/desktop/src/styles/composer.css b/apps/desktop/src/styles/composer.css
index 711c32033..8a47131d9 100644
--- a/apps/desktop/src/styles/composer.css
+++ b/apps/desktop/src/styles/composer.css
@@ -740,23 +740,27 @@
min-height: 38px;
align-items: center;
gap: 10px;
- border: 0;
- padding: 7px 12px;
- background: transparent;
+ padding: 5px 8px 5px 12px;
color: var(--ds-text-primary);
text-align: left;
- cursor: pointer;
- transition: background-color var(--motion-duration-fast) var(--motion-ease-out);
}
-/* TodoDock is a disclosure surface; avoid the shared button's scale press
- feedback, which reads as a jelly effect on this compact header. */
-.todo-dock-header:active:not(:disabled) {
+.todo-dock-toggle {
+ width: 28px;
+ min-width: 28px;
+ height: 28px;
+ flex: 0 0 28px;
+ padding: 0;
+ color: var(--ds-text-muted);
+}
+
+/* The separate disclosure control should not use the shared button's scale
+ press feedback, which reads as a jelly effect at this compact size. */
+.todo-dock-toggle:active:not(:disabled) {
transform: none;
}
-.todo-dock-header:hover,
-.todo-dock-header:focus-visible {
+.todo-dock-toggle:hover:not(:disabled) {
background: var(--ds-bg-hover);
}
@@ -774,6 +778,14 @@
font-size: var(--text-sm);
}
+.todo-dock-header-copy {
+ display: flex;
+ min-width: 0;
+ flex: 1;
+ align-items: center;
+ gap: 10px;
+}
+
.todo-dock-header-text {
flex: 0 0 auto;
font-size: var(--text-sm);
@@ -790,11 +802,6 @@
white-space: nowrap;
}
-.todo-dock-header > svg {
- flex: 0 0 auto;
- color: var(--ds-text-muted);
-}
-
.todo-dock-content {
display: grid;
grid-template-rows: 0fr;
@@ -872,6 +879,10 @@
color: var(--ds-text-muted);
}
+.todo-dock-row-completed .todo-dock-row-content {
+ text-decoration: line-through;
+}
+
.todo-dock-row-completed .todo-dock-row-symbol {
border-color: var(--ds-text-muted);
}
@@ -908,6 +919,7 @@
}
.todo-dock-header,
+ .todo-dock-toggle,
.todo-dock-content,
.todo-dock-row {
transition: none;
diff --git a/apps/desktop/test/todo-dock-rendering.test.mjs b/apps/desktop/test/todo-dock-rendering.test.mjs
index 8f09bca4d..72b9d50b2 100644
--- a/apps/desktop/test/todo-dock-rendering.test.mjs
+++ b/apps/desktop/test/todo-dock-rendering.test.mjs
@@ -50,6 +50,9 @@ test("TodoDock renders bounded session progress and cancelled state", async () =
},
});
const html = render();
+ assert.match(html, /<div class="todo-dock-header">/);
+ assert.doesNotMatch(html, /<button[^>]*class="todo-dock-header/);
+ assert.match(html, /class="[^"]*todo-dock-toggle[^"]*"[^>]*aria-label="Expand checklist"/);
assert.match(html, /aria-expanded="false"/);
assert.match(html, /aria-controls="[^"]+"/);
assert.match(html, /class="todo-dock-header-current"[^>]*>second<\/span>/);
@@ -61,6 +64,7 @@ test("TodoDock renders bounded session progress and cancelled state", async () =
assert.equal((html.match(/role="listitem"/g) ?? []).length, 12, "every ordered row renders");
assert.doesNotMatch(html, /more items/);
assert.match(html, /class="todo-dock-list" role="list" tabindex="-1"/);
+ assert.match(html, /lucide-chevron-up/);
assert.match(html, /lucide-check/);
Object.assign(useAppStore.getInitialState(), {
@@ -85,7 +89,9 @@ test("TodoDock renders bounded session progress and cancelled state", async () =
test("TodoDock uses a quiet disclosure animation and state surfaces", async () => {
const { readFile } = await import("node:fs/promises");
const css = await readFile(new URL("../src/styles/composer.css", import.meta.url), "utf8");
- assert.match(css, /\.todo-dock-header:active:not\(:disabled\)\s*\{[\s\S]*?transform:\s*none;/);
+ assert.match(css, /\.todo-dock-toggle:active:not\(:disabled\)\s*\{[\s\S]*?transform:\s*none;/);
+ assert.match(css, /\.todo-dock-header-copy\s*\{[\s\S]*?flex:\s*1;[\s\S]*?align-items:\s*center;/);
+ assert.match(css, /\.todo-dock-row-completed \.todo-dock-row-content\s*\{[\s\S]*?text-decoration:\s*line-through;/);
assert.match(css, /\.todo-dock-content\s*\{[\s\S]*?grid-template-rows:\s*0fr;[\s\S]*?opacity:\s*0;/);
assert.match(css, /\.todo-dock\.is-expanded \.todo-dock-content\s*\{[\s\S]*?grid-template-rows:\s*1fr;/);
assert.match(css, /\.todo-dock-row\s*\{[\s\S]*?min-height:\s*24px;[\s\S]*?font-size:/);
diff --git a/docs/spec/04-ux/08-component-spec.md b/docs/spec/04-ux/08-component-spec.md
index f04ac041c..89aa8089f 100644
--- a/docs/spec/04-ux/08-component-spec.md
+++ b/docs/spec/04-ux/08-component-spec.md
@@ -2950,8 +2950,12 @@ reasoning-level control.
- The Composer stack places TodoDock above Plan/Goal approval surfaces when the
active session has a non-empty host-owned checklist. An empty checklist does
not reserve layout space.
-- The collapsed header separates the completed-task count from the current
- `in_progress` content, truncating only the task title when space is limited.
+- The header keeps progress and current `in_progress` content left-aligned, and
+ places an independent expand/collapse button at the right edge. Only that
+ button toggles the list; the text area is not interactive. Its arrow points
+ up while collapsed because the list opens upward from the Composer, then
+ points down while expanded. The current task title truncates when space is
+ limited.
A checklist whose items are all cancelled has a clear cancelled label
instead of a misleading `0/0 completed` count.
- The disclosure is keyboard accessible, does not take focus on updates, and
@@ -2966,9 +2970,9 @@ reasoning-level control.
immediate state change. A collapsed dock reserves only its header row: the
list's inset is clipped, never laid out below the header.
Expanded rows use a compact, flat checklist layout with square status marks.
- Completed text and cancelled rows are muted; the in-progress row remains
- primary and medium-weight. Each status symbol has a localized accessible
- name, and each row renders plain text.
+ Completed task text is struck through and muted; cancelled rows are muted;
+ the in-progress row remains primary and medium-weight. Each status symbol has
+ a localized accessible name, and each row renders plain text.
- Renderer snapshots are keyed by session id. A `todos.changed` event with an
older or equal revision is ignored. Session activation and host recovery
re-read the authoritative snapshot, including already cached checklists; a
diff --git a/docs/spec/06-delivery/04-e2e-test-plan.md b/docs/spec/06-delivery/04-e2e-test-plan.md
index dcb715946..9196917ff 100644
--- a/docs/spec/06-delivery/04-e2e-test-plan.md
+++ b/docs/spec/06-delivery/04-e2e-test-plan.md
@@ -10032,8 +10032,11 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.
- **Preconditions**: An isolated local Electron profile with a deterministic
Agent/host fixture, two Desktop sessions, and no real provider or paid API.
- **Steps**: Start a multi-step Agent turn that calls `TodoWrite` with ordered
- pending and `in_progress` items. Observe the TodoDock above the Composer,
- expand it, switch sessions, and confirm the checklist stays session-scoped.
+ pending and `in_progress` items. Observe the TodoDock above the Composer;
+ confirm its progress text is left-aligned, its separate arrow button is at
+ the right edge, and clicking the text does not expand it. Click the upward
+ arrow to expand, then confirm the arrow points down. Switch sessions and
+ confirm the checklist stays session-scoped.
Expand a checklist longer than the dock's height cap: every row must render
and the list must scroll inside the dock without growing the Composer stack.
Complete and cancel items, confirm the all-cancelled label, then clear the
@@ -10046,7 +10049,8 @@ must keep splitting are covered by `markdown-blocks.test.mjs`.
snapshot. Invalid or unauthorized writes do not mutate or emit. TodoDock
renders plain text, separates collapsed progress from the current item,
uses compact square status marks in a flat expanded list, does not take focus,
- resets expansion on session changes, lists every ordered row with the dock's
+ strikes through completed task text, resets expansion on session changes,
+ lists every ordered row with the dock's
own list as the scrollport, and keeps a collapsed dock to its header height,
rejects stale events, and skips local recovery for `remote:` sessions because
RACP v1 has no Todo snapshot operation.
diff --git a/packages/i18n/src/locales/de/index.ts b/packages/i18n/src/locales/de/index.ts
index 61f6382d1..f8dac6e2b 100644
--- a/packages/i18n/src/locales/de/index.ts
+++ b/packages/i18n/src/locales/de/index.ts
@@ -379,6 +379,8 @@ export const de = {
"completed": "{{completed}}/{{total}} erledigt",
"updated": "Checkliste aktualisiert",
"updating": "Checkliste wird aktualisiert",
+ "expand": "Checkliste ausklappen",
+ "collapse": "Checkliste einklappen",
"status": { "pending": "Offen", "in_progress": "In Bearbeitung", "completed": "Erledigt", "cancelled": "Abgebrochen" }
},
"queuedPrompts": "Nachrichten in der Warteschlange",
diff --git a/packages/i18n/src/locales/en/index.ts b/packages/i18n/src/locales/en/index.ts
index 2419f3eec..3f4178648 100644
--- a/packages/i18n/src/locales/en/index.ts
+++ b/packages/i18n/src/locales/en/index.ts
@@ -386,6 +386,8 @@ export const en = {
completed: "{{completed}}/{{total}} completed",
updated: "Checklist updated",
updating: "Updating checklist",
+ expand: "Expand checklist",
+ collapse: "Collapse checklist",
status: {
pending: "Pending",
in_progress: "In progress",
diff --git a/packages/i18n/src/locales/es/index.ts b/packages/i18n/src/locales/es/index.ts
index f6b434484..5ecd296b7 100644
--- a/packages/i18n/src/locales/es/index.ts
+++ b/packages/i18n/src/locales/es/index.ts
@@ -379,6 +379,8 @@ export const es = {
"completed": "{{completed}}/{{total}} completadas",
"updated": "Lista actualizada",
"updating": "Actualizando lista",
+ "expand": "Expandir lista de tareas",
+ "collapse": "Contraer lista de tareas",
"status": { "pending": "Pendiente", "in_progress": "En curso", "completed": "Completada", "cancelled": "Cancelada" }
},
"queuedPrompts": "Mensajes en cola",
diff --git a/packages/i18n/src/locales/fr/index.ts b/packages/i18n/src/locales/fr/index.ts
index 248d861ad..06c4466d8 100644
--- a/packages/i18n/src/locales/fr/index.ts
+++ b/packages/i18n/src/locales/fr/index.ts
@@ -379,6 +379,8 @@ export const fr = {
"completed": "{{completed}}/{{total}} terminées",
"updated": "Liste mise à jour",
"updating": "Mise à jour de la liste",
+ "expand": "Développer la liste de tâches",
+ "collapse": "Réduire la liste de tâches",
"status": { "pending": "En attente", "in_progress": "En cours", "completed": "Terminée", "cancelled": "Annulée" }
},
"queuedPrompts": "Messages en file d'attente",
diff --git a/packages/i18n/src/locales/ko/index.ts b/packages/i18n/src/locales/ko/index.ts
index 9fdf3b7b0..2a2672f95 100644
--- a/packages/i18n/src/locales/ko/index.ts
+++ b/packages/i18n/src/locales/ko/index.ts
@@ -388,6 +388,8 @@ export const ko = {
completed: "{{completed}}/{{total}} 완료",
updated: "체크리스트 업데이트됨",
updating: "체크리스트 업데이트 중",
+ expand: "체크리스트 펼치기",
+ collapse: "체크리스트 접기",
status: { pending: "대기", in_progress: "진행 중", completed: "완료", cancelled: "취소됨" },
},
queuedPrompts: "대기 중인 메시지",
diff --git a/packages/i18n/src/locales/pt-BR/index.ts b/packages/i18n/src/locales/pt-BR/index.ts
index ace318154..e8da8824b 100644
--- a/packages/i18n/src/locales/pt-BR/index.ts
+++ b/packages/i18n/src/locales/pt-BR/index.ts
@@ -378,6 +378,8 @@ export const ptBR = {
completed: "{{completed}}/{{total}} concluídos",
updated: "Checklist atualizado",
updating: "Atualizando checklist",
+ expand: "Expandir checklist",
+ collapse: "Recolher checklist",
status: { pending: "Pendente", in_progress: "Em andamento", completed: "Concluído", cancelled: "Cancelado" },
},
queuedPrompts: "Mensagens na fila",
diff --git a/packages/i18n/src/locales/tr/index.ts b/packages/i18n/src/locales/tr/index.ts
index 14c60e47c..9deb04c57 100644
--- a/packages/i18n/src/locales/tr/index.ts
+++ b/packages/i18n/src/locales/tr/index.ts
@@ -388,6 +388,8 @@ export const tr = {
completed: "{{completed}}/{{total}} tamamlandı",
updated: "Kontrol listesi güncellendi",
updating: "Kontrol listesi güncelleniyor",
+ expand: "Kontrol listesini genişlet",
+ collapse: "Kontrol listesini daralt",
status: { pending: "Bekliyor", in_progress: "Devam ediyor", completed: "Tamamlandı", cancelled: "İptal edildi" },
},
queuedPrompts: "Kuyruktaki iletiler",
diff --git a/packages/i18n/src/locales/zh-CN/index.ts b/packages/i18n/src/locales/zh-CN/index.ts
index 809a8550f..000694a23 100644
--- a/packages/i18n/src/locales/zh-CN/index.ts
+++ b/packages/i18n/src/locales/zh-CN/index.ts
@@ -381,6 +381,8 @@ export const zhCN = {
completed: "已完成 {{completed}} 个任务(共 {{total}} 个)",
updated: "清单已更新",
updating: "正在更新清单",
+ expand: "展开任务清单",
+ collapse: "收起任务清单",
status: { pending: "待办", in_progress: "进行中", completed: "已完成", cancelled: "已取消" },
},
queuedPrompts: "待发送消息",
diff --git a/packages/i18n/src/locales/zh-TW/index.ts b/packages/i18n/src/locales/zh-TW/index.ts
index c85d8ff97..e179acdeb 100644
--- a/packages/i18n/src/locales/zh-TW/index.ts
+++ b/packages/i18n/src/locales/zh-TW/index.ts
@@ -381,6 +381,8 @@ export const zhTW = {
completed: "已完成 {{completed}}/{{total}}",
updated: "清單已更新",
updating: "正在更新清單",
+ expand: "展開任務清單",
+ collapse: "收起任務清單",
status: { pending: "待辦", in_progress: "進行中", completed: "已完成", cancelled: "已取消" },
},
queuedPrompts: "待發送訊息",
diff --git a/scripts/e2e/todo-checklist.tsx b/scripts/e2e/todo-checklist.tsx
index 1aadd4d02..547e9fccd 100644
--- a/scripts/e2e/todo-checklist.tsx
+++ b/scripts/e2e/todo-checklist.tsx
@@ -37,7 +37,8 @@ async function mount(sessionId: string) {
await frame();
}
const dock = () => document.querySelector(".todo-dock");
-const header = () => document.querySelector<HTMLButtonElement>(".todo-dock-header");
+const header = () => document.querySelector<HTMLElement>(".todo-dock-header");
+const toggle = () => document.querySelector<HTMLButtonElement>(".todo-dock-toggle");
const box = (selector: string) => document.querySelector(selector)!.getBoundingClientRect();
const collapsedGap = () => Math.round(box(".todo-dock").height - box(".todo-dock-header").height);
const dockGeometry = () => `dock ${box(".todo-dock").height}px, header ${box(".todo-dock-header").height}px, `
@@ -61,7 +62,9 @@ window.todoChecklistProbe = async () => {
const original = await write(first, items(10, "Task"));
await until(() => header()?.textContent?.includes("Task 1") === true, "Committed host notification must reach TodoDock");
- assert(header()?.getAttribute("aria-expanded") === "false", "Dock starts collapsed");
+ assert(toggle()?.getAttribute("aria-expanded") === "false", "Dock starts collapsed");
+ assert(toggle()?.querySelector("svg")?.classList.contains("lucide-chevron-up"),
+ "Collapsed dock arrow points toward its upward expansion");
// The closed disclosure must not reserve the list's inset: vertical padding on
// the collapsing box held the `0fr` row open and left a blank band under it.
assert(Math.round(box(".todo-dock-content").height) === 0,
@@ -71,7 +74,13 @@ window.todoChecklistProbe = async () => {
assert(collapsedGap() === 2, `Collapsed dock must be the header plus its borders (${dockGeometry()})`);
checks.push("collapsed-dock-reserves-no-blank-height");
flushSync(() => header()!.click());
- await until(() => header()?.getAttribute("aria-expanded") === "true", "Click must expand dock");
+ await frame();
+ assert(toggle()?.getAttribute("aria-expanded") === "false", "Clicking the header text does not expand dock");
+ flushSync(() => toggle()!.click());
+ await until(() => toggle()?.getAttribute("aria-expanded") === "true", "Clicking the arrow expands dock");
+ assert(toggle()?.querySelector("svg")?.classList.contains("lucide-chevron-down"),
+ "Expanded dock arrow points toward its downward collapse");
+ checks.push("header-text-no-op-button-only-toggle-arrow-direction");
// The expanded dock lists every row and scrolls inside its own box (#1319).
assert(document.querySelectorAll(".todo-dock-row").length === 10, "Expanded list renders every row");
const list = document.querySelector<HTMLElement>(".todo-dock-list")!;
@@ -102,7 +111,7 @@ window.todoChecklistProbe = async () => {
await write(second, items(1, "Other"));
await mount(second);
await until(() => header()?.textContent?.includes("Other 1") === true, "Session switch must show its own checklist");
- assert(header()?.getAttribute("aria-expanded") === "false", "Session switch collapses dock");
+ assert(toggle()?.getAttribute("aria-expanded") === "false", "Session switch collapses dock");
// Closing after the switch must retract the list completely, not just fade it;
// the transition's end state is the sync point, so no arbitrary delay is used.
await until(() => collapsedGap() === 2,
@@ -119,6 +128,14 @@ window.todoChecklistProbe = async () => {
]);
await until(() => snapshot(first)?.revision === finished.revision, "Completion must reach store");
assert(header()?.textContent?.includes("1/1"), "Cancelled items are excluded from progress denominator");
+ flushSync(() => toggle()!.click());
+ await until(() => toggle()?.getAttribute("aria-expanded") === "true", "Finished checklist expands");
+ const completedText = [...document.querySelectorAll<HTMLElement>(".todo-dock-row-completed .todo-dock-row-content")]
+ .find((element) => element.textContent === "Done");
+ assert(completedText, "Completed task text is rendered");
+ assert(getComputedStyle(completedText).textDecorationLine.includes("line-through"),
+ "Completed task text is crossed out");
+ checks.push("completed-task-strikethrough");
await action("event", original);
await frame();
assert(snapshot(first)?.revision === finished.revision, "Stale event cannot replace newer snapshot");