Skip to content

fix(ui): keep a tool-call group collapsed until the reader opens it - #2226

Merged
Astro-Han merged 2 commits into
mainfrom
fix/ui-tool-group-collapsed-default
Aug 5, 2026
Merged

fix(ui): keep a tool-call group collapsed until the reader opens it#2226
Astro-Han merged 2 commits into
mainfrom
fix/ui-tool-group-collapsed-default

Conversation

@Astro-Han

Copy link
Copy Markdown
Contributor

Summary

A turn with multiple tool calls rendered its group expanded, and it stayed expanded forever. ToolTrow seeded Astryx ChatToolCalls with defaultIsExpanded={items.some(isInFlightToolStatus)} so a live group would open, but that prop is uncontrolled: it sets the initial state only, and the timeline key is deliberately stable so a disclosure survives mid-turn inserts. A group opened while running therefore never re-collapsed, and every live turn left a trail of permanently open groups behind it.

This drops the custom seed and returns to Astryx's own default — collapsed. Opening a group is the reader's move, never the turn's.

The accepted trade-off, now recorded in the comment the workaround used to justify: a collapsed header projects the last call alone, so with parallel calls the last one can settle first and the header may briefly show a settled icon while a sibling still runs. It resolves as the group finishes, and expanding shows every row's real status.

Verification

  • npm run test -w @maka/ui — 341/341 pass. Three suites asserted the expanded-by-default seed and now assert the collapsed default: tool-activity-presentation, tool-trow-stability, processing-block.
  • node --test on the desktop renderer contracts that touch this surface (streaming-handoff, tool-error-collapse-contract) — 12/12 pass.
  • npm run typecheck, npm run format, npm run lint — clean.
  • apps/desktop/e2e/disclosure-output.spec.ts and the fixtures.ts readiness selector already gate on a collapsed row (single call), so they are unaffected. The Storybook stories in packages/ui/stories/tool-activity.stories.tsx render settled items and already rendered collapsed.
  • Not run: full npm run test -w @maka/desktop is green except 14 pre-existing failures in project-root/workspace-picker suites, which resolve macOS temp paths and never import the UI package; Playwright E2E was not run locally.

@Astro-Han
Astro-Han marked this pull request as ready for review August 5, 2026 10:45
@Astro-Han
Astro-Han merged commit 0f98836 into main Aug 5, 2026
12 checks passed
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.

1 participant