Skip to content

fix(ai): align the tool-call row, steps and approval card across platforms - #37

Merged
VelikovPetar merged 4 commits into
mainfrom
claude/align-tool-rows-7fa9c0
Oct 29, 2026
Merged

VelikovPetar merged 4 commits into
mainfrom
claude/align-tool-rows-7fa9c0

Conversation

@VelikovPetar

@VelikovPetar VelikovPetar commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

Platform alignment for how an agent's steps look. No public API is added or removed. Some theme defaults change.

Tool-call row (AIToolCallView)

  • Declined call: the icon now follows the call's status. While the backend has yet to cancel the call, it shows the shimmering hand; after that, the × in the detail colour. The detail line still says "Declined". The duration now stays once the call has finished.
  • Waiting shimmer: the icon is drawn in accentColor, and a band in the title's colour sweeps across it. The two colours were swapped before.
  • Metrics: the icon defaults to 16 (ToolCallThemeData.iconSize, was 14), with a fixed gap of 8 after it (was max(6, iconSize / 2)).

Parts view (AIMessagePartsView)

  • Steps are spaced 10 apart by default (was 8).
  • The view fills a bounded width and shrink-wraps an unbounded one.
  • AIUnsupportedPartView now reads like a tool-call row: the row's title font in its detail colour, with the same 16 icon and 8 gap. Before, it used bodySmall with an icon 1.25× the text size.

Approval card (AIToolApprovalCard)

  • Spacing: 4 from the title to each line, 12 before the buttons and before the failure line, 8 between buttons.
  • The sending spinner now sits after the buttons, in the accent colour, instead of inside the pressed button. It still announces "Sending your answer…".
  • The Idle / Sending / Sent / Failed states and the "Sent" note are unchanged.

Goldens

CI goldens that change: run update_goldens on this branch.

  • test/src/parts/goldens/ci/ai_tool_call_view_{light,dark}.png
  • test/src/parts/goldens/ci/ai_tool_approval_card_{light,dark}.png
  • test/src/parts/goldens/ci/ai_unsupported_part_view.png
  • test/src/conversation/goldens/ci/ai_conversation_view_{light,dark}.png

Testing

  • melos run lint:all passes.
  • melos run test:all passes: 1287 tests.
  • With CI=true, the failures are only the goldens listed above, plus the voice-view and approval-card CI goldens, which already fail on macOS on main.
  • Updated widget tests: a declined call's icon follows its status; a declined call keeps its duration; the shimmer's base and highlight colours; icon size 16 and gap 8; default part spacing 10 and full width; the spinner placed after the buttons, with its semantics label; the unsupported placeholder's font, colour, icon size and theme.

Before / after

The demo's refund turn: two approval cards, one approved and one declined. Each image is before on the left, after on the right.

Moment What changes Before ← → After
Waiting for approval Steps 10 apart (was 8), tool icon 16 with a gap of 8, accent-colored hand, unsupported-step placeholder in the row's font align-tool-rows-1-layout
Answer being sent Spinner after the buttons instead of inside the pressed one align-tool-rows-2-sending
Declined, call still waiting The hand keeps shimmering until the backend cancels the call (was × straight away) align-tool-rows-3-declined-waiting
Declined, call cancelled × in the detail color, with the call's duration kept (was none) align-tool-rows-4-declined-cancelled

🤖 Generated with Claude Code

VelikovPetar and others added 2 commits October 26, 2026 21:46
…ith iOS

- A declined call's icon follows its status (shimmering hand while still
  awaiting approval, then the cross) and keeps its duration once finished.
- The waiting shimmer draws the icon in the accent with a title-colored band.
- Tool row icon 16 with a gap of 8; parts spaced 10 and full width.
- Unsupported-step placeholder reads like a tool row.
- Approval card spacing 4 / 12 / 8, spinner after the buttons.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@VelikovPetar
VelikovPetar marked this pull request as ready for review October 26, 2026 21:14
@VelikovPetar
VelikovPetar requested a review from a team October 26, 2026 21:14
@VelikovPetar VelikovPetar changed the title fix(ai): align tool-call rows, the parts view and the approval card with iOS fix(ai): align the tool-call row, steps and approval card across platforms Oct 27, 2026
… what they do

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@xsahil03x xsahil03x left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Petar, letting the icon follow the status and keeping a declined call's duration is the right model, and it is what both other SDKs already do. I compared the paddings, sizes, colors and spacing the description names against stream-chat-android-ai-compose and StreamChatAI on develop, and the regenerated CI goldens; apart from the gap below, they match, though I couldn't render either platform side by side. Analyze is clean, the non-golden tests pass, and 12 of the changed tests fail against main's lib, as they should.

Please do these before merging:

  1. Keep the gap between a tool call's row and its approval card at 8. It comes from spacing, so it moved to 10 along with the steps, while Swift and Android keep it at 8.
  2. Make the width test fail without the change: with a tight SizedBox it already passes on main.

The rest is optional and inline.

Comment thread packages/stream_chat_flutter_ai/test/src/parts/ai_message_parts_view_test.dart Outdated
Comment thread packages/stream_chat_flutter_ai/CHANGELOG.md Outdated
`AIMessagePartsView.spacing` also set the gap between a tool call's row
and its approval card, so raising it to 10 moved that gap too. The row
and its question now sit a fixed 8 apart, and `spacing` only spaces steps.

The running spinner is sized to 12 with a 1.5 stroke at the default icon
size, and still scales with it. The width test uses a loose constraint,
so it checks that the view fills its width. The CHANGELOG describes these
views as added rather than listing changes to them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@xsahil03x xsahil03x left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The question now sits a fixed 8 under its row whatever spacing is, the width test fails against main, and the spinner matches Android at 12 with a 1.5 stroke. Verified each against the new code.

@VelikovPetar
VelikovPetar merged commit f694273 into main Oct 29, 2026
8 of 12 checks passed
@VelikovPetar
VelikovPetar deleted the claude/align-tool-rows-7fa9c0 branch October 29, 2026 14:42
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.

2 participants