qwen-code/packages
Shaojin Wen 9f2168f78e
feat(web-shell): collapsible TodoWrite history with status diff (#5109)
* feat(web-shell): collapsible TodoWrite history with status diff

Inline todo_write updates rendered as a generic, non-collapsible tool row
crammed in with surrounding tool calls — the todo-specific renderer was
effectively dead code because the detector matched the literal "todowrite"
while the wire name is "todo_write" (kind "think").

- Detect the todo tool by name (todo_write / todowrite) instead of relying
  on the unrelated tool kind, reviving the rich rendering and also
  populating the floating todo panel that was empty on the daemon path.
- Render each update as its own standalone group, collapsed by default to
  the per-snapshot diff (just-completed / just-started items) or the current
  step, expanding to the full checklist; the header shows completed/total.
- Use consistent status glyphs (●/◐/○) in both collapsed and expanded views
  via a shared TodoView component used by ToolGroup and PlanMessage.

* fix(web-shell): scope todo diff per task identity; address review

- [Critical] computeTodoTimeline keyed its running state on todo.id alone, but
  ids aren't globally unique (ACP assigns positional ids, models renumber per
  plan), so a later plan diffed against a previous plan's stale terminal status
  and silently dropped events in the collapsed view. Key on id+content so
  distinct tasks stay separate; add an id-reuse regression test.
- Stabilize the TodoTimelineContext value with a signature-cached Map so
  streaming ticks that don't touch a todo snapshot no longer re-render every
  todo/plan row.
- Drop the unused completed/total from TodoSnapshotDiff (consumers compute the
  count locally — single source of truth).
- Fall back to the raw result summary when a todo_write payload is unparseable.
- Add PlanMessage rendering tests and extractTodosFromToolCall coverage; remove
  stale "step time" comments left after dropping per-step timing.

* test(web-shell): document todo-diff keying limits; cover signature

Follow-up to review on the id+content keying in computeTodoTimeline:
- Document the two rare trade-offs in the todoStateKey doc (a mid-task reword on
  a stable id, and unrelated plans reusing both id and content), both degrading
  to "the collapsed diff omits one event" while the expanded list stays correct.
- Pin behavior with tests: an item carried over and completed in a later turn
  (which id+content handles but a user-turn reset would drop), plus the two
  documented gaps.
- Add todoTimelineSignature tests: stable across non-todo edits; changes on any
  id/status/content change.

* refactor(web-shell): isolate plan context read; expand todo test coverage

Address follow-up review:
- Extract PlanEventSummary as the sole TodoTimelineContext consumer, mirroring
  ToolGroup's TodoToolBody so the memo-shielded PlanMessage stays stable when
  the timeline Map reference changes.
- Note the spurious-`started` axis of the reword trade-off in the todoStateKey
  doc (a reword can drop a completion or emit a stray start).
- Add direct isTodoWriteToolName tests (incl. the `todowrite` ACP variant) and
  a todoTimelineSignature empty-transcript test.
2026-06-15 00:44:15 +08:00
..
acp-bridge fix(cli,core): harden OOM prevention — idempotent compaction tests, explicit GC, debug log defaults (#4914) 2026-06-14 10:40:53 +08:00
channels fix(cli,core): harden OOM prevention — idempotent compaction tests, explicit GC, debug log defaults (#4914) 2026-06-14 10:40:53 +08:00
cli feat(cli): improve /copy command argumentHint and description (#5110) 2026-06-15 00:33:19 +08:00
core fix(core): Repair duplicate tool call IDs (#5107) 2026-06-14 23:53:36 +08:00
desktop fix(desktop): allow unsigned Windows auto-updates (#5028) 2026-06-12 16:53:08 +08:00
sdk-java feat(core): add NotebookEdit tool for Jupyter notebooks 2026-05-21 00:06:15 +08:00
sdk-python doc[sdk-python] Expand Python SDK usage documentation (#3995) 2026-05-12 15:27:00 +08:00
sdk-typescript feat(cli,web-shell): persist goal status in daemon transcript events (#5098) 2026-06-14 21:08:06 +08:00
vscode-ide-companion feat(acp): dedicated agent permission dialog via _meta.toolName (follow-up to #5085) (#5105) 2026-06-14 23:27:38 +08:00
web-shell feat(web-shell): collapsible TodoWrite history with status diff (#5109) 2026-06-15 00:44:15 +08:00
web-templates chore(release): v0.18.0 [skip ci] 2026-06-12 22:59:56 +08:00
webui feat(acp): dedicated agent permission dialog via _meta.toolName (follow-up to #5085) (#5105) 2026-06-14 23:27:38 +08:00
zed-extension chore(deps): upgrade ink 6.2.3 → 7.0.2 + bump Node engine to 22 (#3860) 2026-05-11 17:29:50 +08:00