feat(transcript): merge consecutive thinking/text chunks in agent transcript#3114
Open
sendwealth wants to merge 7 commits into
Open
feat(transcript): merge consecutive thinking/text chunks in agent transcript#3114sendwealth wants to merge 7 commits into
sendwealth wants to merge 7 commits into
Conversation
Agent tasks produce bursts of same-type events (thinking, tool calls) that each render as a separate row. Add a grouping layer that merges consecutive same-type events into a single collapsible row per group, reducing visual noise while preserving all detail on expand. - New `apps/mobile/lib/step-grouping.ts` with pure grouping function - Modified `chat-timeline.tsx` with `StepGroupRow` component - Single items render identically to before (no visual change) - Groups of 2+ show a collapsed summary (e.g. "3 thinking steps") Closes multica-ai#3113 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@oklaM is attempting to deploy a commit to the IndexLabs Team on Vercel. A member of the Team first needs to authorize it. |
Apply the same grouping logic from mobile to the shared packages/views/ chat timeline. Consecutive same-type events (thinking, tool_use, tool_result, error) merge into a single collapsible row per group. Web and desktop both benefit. - New `packages/views/chat/lib/step-grouping.ts` with pure grouping - Modified `chat-message-list.tsx` with `StepGroupRow` component - Added i18n keys for group labels (en + zh-Hans) Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Covers empty input, singles, consecutive groups, alternating types, text breaks, and all event types (thinking, tool_use, tool_result, error). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Ionicons expects a specific string literal union, not a broad \`string\`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…rows Streaming outputs arrive as many small chunks. Consecutive thinking and text (Agent) events are now merged into one row with concatenated content and a ×N badge showing how many chunks were combined. Tool calls, results, and errors stay as individual rows. - New `step-grouping.ts` with `mergeStreamingChunks()` for transcript - Updated `TranscriptEventRow` to render merged items with seq range - Tests: 9 cases covering all merge scenarios Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
getEventLabel only uses `type` and `tool`, but was typed as MergedItem which requires `mergedCount`. The filterOptions loop passes TimelineItem which lacks that field. Widen to a structural type both satisfy. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
step-grouping.tslib inpackages/views/common/task-transcript/with pure grouping functionagent-transcript-dialog.tsxto consume groupingCloses #3113
Files changed
packages/views/common/task-transcript/step-grouping.tspackages/views/common/task-transcript/step-grouping.test.tspackages/views/common/task-transcript/agent-transcript-dialog.tsxTest plan
pnpm --filter @multica/views exec vitest run common/task-transcript/step-grouping.test.ts🤖 Generated with Claude Code