Conversation
added 3 commits
September 8, 2026 20:55
…R 0001) When an agent run finishes, its intermediate steps (thinking + tool calls across consecutive messages) now collapse into a single expandable header row, so the final answer leads the conversation. - process-groups.ts: grouping rule (assistant messages without body text, with thinking and/or tool calls), span detection, master switch hook (localStorage 'llm-space-collapse-process-groups', on by default) - display-messages.ts: resolveDisplayRows folds settled runs into group rows; live streaming messages are never wrapped - process-group-header.tsx: collapsed header shows 'N tool calls', last tool name, and a warning state when a step failed - message-list-view.tsx: virtualizer treats a collapsed group as one fixed header row; id->display-index map keeps jump/autofocus/validation targets correct while member rows are hidden; navigator anchors to the group's first member - thread-store: expandedProcessGroupIds + toggleProcessGroupExpanded (store-only, never persisted); removeMessage cleans up stale ids - Settings → General: 'Collapse process steps' toggle (en/zh) - i18n: playground-labels processGroups block (en/zh + type) Tests: process-groups.test.ts (grouping boundaries, expand/collapse, virtualization row mapping).
- Keep historical process groups collapsed while a new run is in flight: grouping is now purely structural instead of disabled for the whole conversation while preparing/running, so a long thread's list height and reading position no longer shift mid-run. A new run's steps stay expanded because they form a trailing, unterminated span. - Reveal a collapsed group before scrolling/focusing a run-validation or autofocus target inside it. Hidden members no longer map to their header row (they map to nothing), and a small effect expands the owning group so the target row mounts before the scroll/focus effects run. - A user message now only ends a candidate span instead of qualifying it: only an assistant message with a result body makes a group collapsible, so steps from an interrupted run (followed by a user message) stay expanded as failure context, matching the stated goal. Tests: interrupted-run grouping, older-group stability during a run, and findCollapsedGroupIdForMessage lookup.
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
Implements spec 0001: after an agent run finishes, its intermediate steps (thinking + tool calls spread across consecutive messages) collapse into a single expandable header row, so the final answer leads the conversation.
Grouping rule (derived view layer, no store/runtime changes):
Details
process-groups.ts: grouping rule, span detection, master switch hook (localStoragellm-space-collapse-process-groups, on by default)display-messages.ts:resolveDisplayRowsfolds settled runs into group rowsprocess-group-header.tsx: "N tool calls · Last: " with a warning state when a step failedmessage-list-view.tsx: virtualizer treats a collapsed group as one fixed header row; an id→display-index map keeps jump/autofocus/validation targets correct while member rows are hidden; message navigator anchors to the group's first memberthread-store:expandedProcessGroupIds+toggleProcessGroupExpanded(store-only, never persisted);removeMessagecleans up stale idsTest plan
process-groups.test.ts(grouping boundaries, expand/collapse, virtualization row mapping) — passespackages/uisuite (121 tests) and i18n tests passbun run typecheck:changed/bun run lint:changedcleanNotes
This PR is a dependency for the planned agent-layout PR (run timeline jumps reference result rows).