feat(ChatTool): add actions prop for tool approval#257
Merged
Conversation
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
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.
Syncs upstream nuxt/ui commit
1a3a9dc— feat(ChatTool): addactionsprop for tool approval.What
Ports the version-agnostic ChatTool actions feature:
ChatTool.vue— newactions?: ButtonProps[]prop rendering a button row below the trigger, plus anactionsslot. Auto-opens once when actions first appear (uncontrolled only, respects an explicitdefaultOpen) so the tool content is visible while the user decides.theme/chat-tool.ts—actionsslot withinline/cardvariant classes; thechevron.leading/alone.falseleading-icon hover-swap is refactored sogroup-hover:opacity-0only applies when the icon overlaps the chevron.utils/ai.ts—isToolApprovalPending()andisToolStreamingnow treatsapproval-requestedas a paused state. Pure string-state helpers; harmless on b24ui's AI-SDK v6 line (the state simply never occurs).air-secondarycolor), 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
toolApproval,addToolApprovalResponse,lastAssistantMessageIsCompleteWithApprovalResponses,approval-requestedwiring inchat.md/chat.vue/chat.post.ts/ the newChatToolApprovalExample.vue) is not ported — b24ui stays on the deferred AI-SDK v6 line. Only the version-agnostic component/theme/util feature is synced.chat-message.tsbody: 'w-full'tweak targets thenakedvariant, 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 existingchevron leadingcases).Ledger: cursor advanced to
1a3a9dc; previous entryc256997reconciled to PR #256.🤖 Generated with Claude Code
Generated by Claude Code