Skip to content

feat(ChatTool): add actions prop for tool approval#257

Merged
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-1a3a9dc
Jul 10, 2026
Merged

feat(ChatTool): add actions prop for tool approval#257
IgorShevchik merged 1 commit into
mainfrom
sync/nuxt-1a3a9dc

Conversation

@IgorShevchik

Copy link
Copy Markdown
Collaborator

Syncs upstream nuxt/ui commit 1a3a9dcfeat(ChatTool): add actions prop for tool approval.

What

Ports the version-agnostic ChatTool actions feature:

  • ChatTool.vue — new actions?: ButtonProps[] prop rendering a button row below the trigger, plus an actions slot. Auto-opens once when actions first appear (uncontrolled only, respects an explicit defaultOpen) so the tool content is visible while the user decides.
  • theme/chat-tool.tsactions slot with inline/card variant classes; the chevron.leading / alone.false leading-icon hover-swap is refactored so group-hover:opacity-0 only applies when the icon overlaps the chevron.
  • utils/ai.tsisToolApprovalPending() and isToolStreaming now treats approval-requested as a paused state. Pure string-state helpers; harmless on b24ui's AI-SDK v6 line (the state simply never occurs).
  • Docs / playgrounds / tests — added the Actions doc section (adapted to a b24ui icon + air-secondary color), the actions demo in the nuxt & demo playgrounds (kept in parity), and the new render + unit tests (auto-open ×3, onClick, no-actions).

Deferred / deviations

  • The v7 tool-approval flow (toolApproval, addToolApprovalResponse, lastAssistantMessageIsCompleteWithApprovalResponses, approval-requested wiring in chat.md / chat.vue / chat.post.ts / the new ChatToolApprovalExample.vue) is not ported — b24ui stays on the deferred AI-SDK v6 line. Only the version-agnostic component/theme/util feature is synced.
  • Upstream's chat-message.ts body: 'w-full' tweak targets the naked variant, which b24ui's chat-message theme does not have, so it has no applicable target and was skipped.

Verify (CI=true)

dev:prepare · lint · typecheck · test · build — all green. Test suite 5309 passed / 6 skipped (was 5289; +20 from the new ChatTool cases). 40 ChatTool snapshots updated (10 new actions cases + the benign hover-swap refactor on existing chevron leading cases).

Ledger: cursor advanced to 1a3a9dc; previous entry c256997 reconciled to PR #256.

🤖 Generated with Claude Code


Generated by Claude Code

Port the version-agnostic ChatTool actions feature from nuxt/ui: an
actions ButtonProps[] prop (+ actions slot) rendering a button row below
the trigger, auto-opening once when actions first appear. Adds the theme
actions slot, the chevron.leading hover-swap refactor, and the
isToolApprovalPending / isToolStreaming(approval-requested) helpers.

The v7 tool-approval flow (toolApproval, addToolApprovalResponse) is
deferred with the AI-SDK v7 migration; only the component/theme/util
feature is ported.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JS8ypVfQSFzYVZzkTHhURb
@IgorShevchik IgorShevchik merged commit 5f78902 into main Jul 10, 2026
1 check passed
@IgorShevchik IgorShevchik deleted the sync/nuxt-1a3a9dc branch July 10, 2026 13:46
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