Skip to content

feat(desktop): fold thinking and tool calls into one activity group - #170

Merged
GoDiao merged 1 commit into
mainfrom
feat/activity-group
Oct 24, 2026
Merged

GoDiao merged 1 commit into
mainfrom
feat/activity-group

Conversation

@GoDiao

@GoDiao GoDiao commented Oct 23, 2026 •

Copy link
Copy Markdown
Owner

Summary

While the model works, every thinking block and every tool call took its own row, so a short turn pushed the answer far down the page. Thinking also split tool groups, so groups almost always held one call and never collapsed.

Now everything between two pieces of reply text (thinking and tool calls) is one collapsed group, like Claude Code's "Ran 4 commands" box.

Behaviour

  • Thinking joins the current group instead of ending it. The group ends at reply text, a permission request, a question card, an error, or any other visible message.
  • The summary counts thinking as well, e.g. "Found files, ran 2 commands, read 1 file, thought 4 times". Expanded, the group lists the steps in their original order; each thinking step and tool call still expands on its own.
  • While a thinking step in the group is streaming, the group shows the running marker.
  • A group with a failed step stays collapsed and shows the red marker. It no longer opens by itself.
  • Unchanged:
    • a lone tool call with no thinking around it is still a single row;
    • thinking with no tool calls is still a standalone Thinking row;
    • agent groups never take in thinking, so their nested view is the same.

Changes

  • MessageList.tsx – the render model collects thinking into the pending group (as ordered steps next to toolCalls). The per-group stable props from perf(desktop): subscribe components to the session fields they use #169 cover steps, and the virtual-list weight and signature include thinking. The group receives activeThinkingId only when it holds that step, so other groups stay memoized.
  • ToolCallGroup.tsx – renders steps in order, adds the thinking count to the summary, treats active thinking as running, and drops the auto-expand on error.
  • en.ts / zh.ts – "thought once / thought N times".

Tests

  • Grouping: thinking between tools folds into one group up to the reply text; thinking without tools stays standalone; thinking stays out of agent groups.
  • ToolCallGroup: summary with thinking count, running marker while thinking streams, steps shown in order; a failed group stays collapsed with the error marker.
  • Render counts: while thinking streams into the live group, only that group re-renders and the finished history group does not.
  • cd desktop && bun run test – 117 files, 1214 passed. bun run lint – clean.

Follow-up

Rebased onto main after #171 (incremental streaming render, closes #154) and #148. No conflicts: #171 changed the streaming-text path and this PR changes tool and thinking grouping. bun run lint and bun run test -- --run in desktop/ pass after the rebase (121 files, 1242 passed, 4 skipped).

Thinking no longer breaks a tool group: every thinking block and tool call between two pieces of reply text renders as one collapsed group, with thinking counted in the summary and shown in order when expanded. A group with a failed step stays collapsed and shows the red marker instead of opening.
@GoDiao
GoDiao force-pushed the feat/activity-group branch from 7081cf9 to 94813ba Compare October 24, 2026 09:27
@GoDiao
GoDiao merged commit db96f88 into main Oct 24, 2026
4 checks passed
GoDiao added a commit that referenced this pull request Oct 24, 2026
@GoDiao
GoDiao deleted the feat/activity-group branch October 24, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Render streaming replies incrementally instead of re-parsing the whole reply

1 participant