Repository navigation
Description
Optionally collapse back-to-back tool calls in Session Chat into one summary Tool Call Card. Settings → Appearance toggle; default off.
Remaining:
- Open pull request and merge.
Completed:
- Session Chat display preference (collapse consecutive tool calls, default off)
- Settings → Appearance toggle on iOS and Android
- Widen
SessionChatTimelineBlocksgrouping when preference is on (all families, ≥2 consecutive) - Keep OPE-50 context-only grouping when preference is off
- Mixed-family group title counts
- Option E group chrome (
N tools+ family one-liner) and tool group screen - Group status via the Tool Call Card dot only (no status-colored outline)
- Clear All Data resets the preference
- Unit tests for on/off grouping rules on both platforms
- Live re-project when preference flips while Session Chat is open
Docs: docs/features/collapse-consecutive-tool-calls/
Related: OPE-46 Assistant Tool Parts, OPE-50 Lightweight tool chrome (baseline context groups).
Problem Statement
Long assistant turns fire many tool calls one after another. Each becomes its own Tool Call Card, so Session Chat gets noisy and hard to scan. Users who want a denser view have no way to collapse sequential tools.
Today only consecutive context tools (read / glob / grep) auto-group, and that behavior is always on with no settings control.
Solution
Add a Settings → Appearance toggle Collapse consecutive tool calls (off by default).
When on, a run of two or more consecutive tool-call messages (Shell, Edit, Read, and other non-task tools) collapses into one tool group summary card. That is the primary case: some models emit one tool per assistant message, stacked. Tools that share one message also group. task never groups.
When off, keep today’s behavior: only consecutive context tools auto-group; other tools stay individual Tool Call Cards with specialized chrome and taps.
User Stories
- As a mobile user, I want a Settings toggle to collapse sequential tool calls, so that long tool runs are easier to scan.
- As a mobile user, I want the toggle off by default, so that specialized tool chrome and taps stay available until I opt in.
- As a mobile user, I want the control under Appearance, so that I find it with other display preferences.
- As a mobile user, when collapse is on, I want any back-to-back tools (not only read/glob/grep) to group, so that mixed tool runs also densify.
- As a mobile user, I want a single tool to stay a normal card, so that one-off tools remain clear.
- As a mobile user, I want text or attachments between tools to break a group, so that the structure of the turn stays readable.
- As a mobile user, I want group status to reflect the worst member state, so that errors and running work remain visible.
- As a mobile user, I want a compact group card (
N toolsplus a family one-liner likeEdit · Write · 5 shells), so that I can scan what ran without a census of raw tool names. - As a mobile user, I want tapping the group to open a tool group screen of member Tool Call Cards, so that I can review edits (Changes) and inspect shells without an in-list accordion. Status is the card dot only — no colored outline on the message.
- As a mobile user, I want changing the toggle to update an open Session Chat immediately, so that I do not restart the app.
- As a mobile user, I want Clear All Data to reset the preference, so that wipe behaves consistently with other display prefs.
- As a developer, I want the same pure grouping rules and tests on iOS and Android, so that parity holds.
- As a mobile user, I want hide rules unchanged (
todowritealways hidden; in-flightquestionhidden), so that collapse does not resurrect hidden tools. - As a mobile user, when collapse is off, I still want consecutive context tools grouped as today, so that existing dense context runs do not regress.
Implementation Decisions
- Presentation-only; no server API or ToolPart schema changes.
- Primary seam: pure Session Chat timeline block builders (
SessionChatTimelineBlockson both platforms). Pass the collapse preference into build.- Preference on: group any consecutive visible tools when count ≥ 2.
- Preference off: keep OPE-50 context-only grouping.
- Hide rules apply before grouping.
- Reuse existing Tool Call Card for groups; no new design-system component.
- New device-local boolean preference (default
false), Settings list-item + switch in Appearance, included in Clear All Data. Follow existing preference patterns (HomeDisplayPreferences/ equivalent Session Chat display prefs). - Group block IDs stay ordered member part IDs; status worst-of (error > running/pending > completed); first error text when present.
- Group card copy is option E: title
N tools; subtitle family one-liner in encounter order. Human labels (Shell, notbash). - Tap pushes a tool group screen of member Tool Call Cards (back,
N tools, family subtitle). File-change members open Changes; shell/network members open the existing tool-detail sheet. No in-list accordion. - Status is the Tool Call Card dot only; hairline stays
border.weaker(no status-colored outline). - Live rebuild when parts/status update or the preference flips.
Testing Decisions
- Test external timeline-block output of the pure builders, not UI wiring internals.
- Cases:
- toggle off + consecutive context → one group
- toggle off + mixed tools → separate cards (context still groups among themselves)
- toggle on + mixed consecutive tools → one group
- text/attachment breaks group
- single tool never groups
- hide rules still apply
- worst-of status
- title counts for mixed families
- preference defaults false
- Clear All Data resets preference
- Prior art:
SessionChatTimelineBlockstests on both platforms.
Out of Scope
- In-group expand / accordion
- Cross-message aggregation across user turns, or across visible text / attachments /
tasktools - Grouping across text interruptions
- Per-session override of the preference
- New design-system component
- Domain ToolPart schema or server API changes
- Push / background sync
Further Notes
Canonical docs: docs/features/collapse-consecutive-tool-calls/
Baseline behavior from OPE-50 context tool groups remains when the new toggle is off.
Imported from Linear OPE-144. Linear status: Done. Priority: Medium. Created 2026-08-12. Completed 2026-08-14.
Related: OPE-50, OPE-46, OPE-171, OPE-163.
Activity