Add mid-conversation suggested-reply chips (quick replies)#25
Merged
Conversation
The terminal eventual_response already carries follow-up suggestions at response.suggestedNextActions, but the widget dropped them. Surface them as tappable chips under the latest assistant turn so a visitor can advance the conversation in one tap. - conversation.ts: attach suggestedNextActions to the finalized assistant ChatMessage (defensive parse mirroring extractCitations; non-empty strings only, capped at 4; set only from the terminal event). - element.ts: render the latest finalized assistant message's suggestions as chips above the composer, reusing the empty-state .prompts/.chip styling and send path. Hidden while an OTP / tool-confirmation / restore overlay is active, and when showSuggestedReplies is false. A new turn or a manual message clears them (latest-message-only logic). - config.ts: new showSuggestedReplies option (default true), honored in both popover and full-page modes. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FczKhti6h4s6yhYXG6V86o
🦋 Changeset detectedLatest commit: edca6ab The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
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.
Problem
The terminal
eventual_responsealready carries agent follow-up suggestions atresponse.suggestedNextActions, but@smooai/chat-widgetdropped them. Visitors had no one-tap way to advance a conversation.Solution
Surface those suggestions as tappable "quick reply" chips under the latest assistant message.
suggestedNextActionsto the finalized assistantChatMessagevia a defensive parser (mirrorsextractCitations: tolerates absence / non-array / non-string / blank entries, capped at 4). Set only from the terminal event, never mid-stream..prompts/.chipstyling and the existing send path. Shown only for the latest, non-streaming assistant message; hidden while an OTP / tool-confirmation / restore overlay is active and whenshowSuggestedRepliesisfalse. A new agent turn or a manual message clears them (latest-message-only logic).showSuggestedRepliesoption (defaulttrue), honored in both popover and full-page modes; documented in the README.Different seam from the concurrent interrupt-overlay work: these are message-level suggestions rendered in their own
.reply-suggestionsslot, not overlays.Verification
pnpm checkgreen (typecheck + test + build). Added tests: extraction from a stubbedeventual_response(cap at 4, non-string/blank dropped, absent/non-array → undefined) and element-level (chips render for the latest assistant message, tap sends text, clear on the next turn, hidden while an interrupt is active, hidden whenshowSuggestedReplies=false). 122 tests pass.Changeset: minor.
🤖 Generated with Claude Code