Add served Webchat runtime support#45
Merged
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 1e84319. Configure here.
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
Adds package-side support for the served Webchat runtime.
The package now treats the Webchat HTML as the source of truth for teaser messages, opening-sequence messages, attachments, and configured appearance. Hellotext.js wires runtime behavior around that DOM instead of rebuilding those surfaces from JSON.
Added
appearance.header.nameandappearance.launcher.iconUrl.whatsapp.numberandwhatsapp.restrictToChannel.Changed
[data-attachments-container]contract.9, matching the served Webchat badge.dist/hellotext.jsbundle.classesandtriggerClasseswere removed from the public Webchat config.Compatibility Notes
webchat: falsestill disables automatic Webchat mounting.dist/hellotext.js.Tests
git diff --checknpm testnpm run buildBuild completed successfully. The initial browser bundle is now about
188 KBraw /43.6 KBgzip /36.6 KBbrotli, with emoji picker code split into lazy chunks.Note
Medium Risk
Updates core webchat runtime behavior (auto-open/teaser/opening-sequence flows, message rendering, and request serialization), which could affect widget UX and message delivery if edge cases are missed. No auth or sensitive data handling changes, but the surface area is broad across controllers, config, and API calls.
Overview
Adds new Webchat config surface for
mode, runtimebehaviour(with explicit override tracking), plusappearanceandwhatsappoverrides, and serializes these overrides onto thepublic/webchatsrequest and (optionally) onto the rendered Stimulusdata-...-behaviour-value.Updates the webchat controller/runtime to better align with served DOM contracts: supports
[data-attachments-container], clamps unread badge at9, de-dupes inbound messages, adds popover close-on-outside-click for popover mode, and introduces teaser + opening-sequence flows (including sending revealed opening-sequence ids with the first customer interaction and new teaser quick-reply sending).Improves performance/UX by cancelling pending auto-open timers when manually opening/toggling, and lazy-loads the emoji picker assets only when the picker popover opens.
Reviewed by Cursor Bugbot for commit ab24695. Bugbot is set up for automated code reviews on this repo. Configure here.