feat(widget): render Typebot choice blocks as interactive button list - #90
Merged
DavidsonGomes merged 1 commit intoMay 20, 2026
Conversation
- MessageList: add button grid for input_select messages; buttons disable after selection via submittedValues; passes onSelectOption callback down - index.tsx: normalizeContentType maps numeric content_type enum to string (4 -> input_select) for API responses that serialize as integer; propagate items and submittedValues from content_attributes to MessageItem; fix sender_type guard to treat AgentBot messages as incoming so bot replies are rendered as inbound messages in the widget - handleSelectOption: marks the chosen item in local state, calls handleSend with the option text, and PATCHes submitted_values via widgetService - widgetService: add updateMessageSubmittedValues to PATCH /widget/messages/:id with the submitted choice value
Reviewer's GuideImplements interactive rendering and state persistence for Typebot Sequence diagram for selecting a Typebot input_select option in the widgetsequenceDiagram
actor User
participant MessageList
participant Widget
participant widgetService
participant BackendAPI
User->>MessageList: click option button
MessageList->>Widget: onSelectOption(message, item)
activate Widget
Widget->>Widget: setMessages(update submittedValues)
Widget->>MessageList: render buttons as disabled
Widget->>Widget: handleSend(selectedText)
Widget->>widgetService: updateMessageSubmittedValues(websiteToken, messageId, submittedValues)
activate widgetService
widgetService->>widgetService: requestWithBaseFallback(client)
widgetService->>BackendAPI: client.patch(/widget/messages/:id, submitted_values)
BackendAPI-->>widgetService: 200 OK
deactivate widgetService
widgetService-->>Widget: updated message data
deactivate Widget
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
DavidsonGomes
merged commit May 20, 2026
3b5431f
into
evolution-foundation:develop
1 check was pending
Luizcc87
pushed a commit
to Luizcc87/evo-ai-frontend-community
that referenced
this pull request
Jul 15, 2026
…evolution-foundation#90) - MessageList: add button grid for input_select messages; buttons disable after selection via submittedValues; passes onSelectOption callback down - index.tsx: normalizeContentType maps numeric content_type enum to string (4 -> input_select) for API responses that serialize as integer; propagate items and submittedValues from content_attributes to MessageItem; fix sender_type guard to treat AgentBot messages as incoming so bot replies are rendered as inbound messages in the widget - handleSelectOption: marks the chosen item in local state, calls handleSend with the option text, and PATCHes submitted_values via widgetService - widgetService: add updateMessageSubmittedValues to PATCH /widget/messages/:id with the submitted choice value Co-authored-by: Milton Sosa <milton.sosa.22@gmail.com>
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.
Summary
Renders
input_selectmessages from Typebot as interactive button groupsin the web widget. When the user clicks an option, the selection is sent as
a text message and the buttons disable to prevent double submission.
Dependencies
Changes
src/components/widget/MessageList.tsxmessage.contentType === 'input_select'anditemsare present.(
submittedValuesis set) or when theonSelectOptioncallback is absent.selection.
src/pages/Widget/index.tsxnormalizeContentType: maps the numericcontent_typeenum the API mayreturn (e.g.
4) to its string equivalent ("input_select"), since theserializer can return either format.
transformMessage: propagatesitemsfromcontent_attributes.itemsandsubmittedValuesfromcontent_attributes.submitted_valuesto the localMessageItemtype.sender_typeguard extended to include'AgentBot'so that bot replies aretreated as inbound messages and rendered on the left side of the widget.
handleSelectOption: marks the chosen item in local state, callshandleSendwith the option text, and persists the selection viawidgetService.updateMessageSubmittedValues.src/services/widget/widgetService.tsupdateMessageSubmittedValues(websiteToken, messageId, submittedValues):sends a
PATCH /widget/messages/:idrequest withsubmitted_valuestopersist the user's choice on the message record.
Notes
content_type: input_selectorwithout
itemsrender exactly as before.normalizeContentTypeguard handles both legacy numeric and currentstring serialization of
content_type.Summary by Sourcery
Render Typebot input_select messages as interactive choice buttons in the web widget and persist user selections.
New Features:
Enhancements:
Chores: