Consume the hosted agent widget script instead of owning the chrome#240
Merged
Conversation
AgentChatWidget.tsx shrinks from ~300 lines of ported launcher/teaser/panel chrome + postMessage bridge to a client-side loader for the embedded-agent worker's /widget.js — the standard embed superwall.com now uses — so the widget deploys with the agent and can never drift from its bridge protocol. AgentLauncherDither.tsx and the @paper-design/shaders-react dependency go away; the dither launcher ships inside widget.js on the vanilla shader core. Behavior parity: same visuals, same z-40 stacking, same agentWidget.* localStorage keys (visitors keep their conversation), same SPA page-context re-pushes with Markdown twins, same live theme follow. The search dialog's "Ask AI" keeps dispatching OPEN_AGENT_EVENT — the hosted widget listens for that exact event, and the agent now actually consumes the seeded query (pre-fill + auto-send), which the old copy forwarded to no effect. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DxD3A8vSXgLxyVTPpugXFj
Deploying with
|
| Status | Name | Latest Commit | Preview URL | Updated (UTC) |
|---|---|---|---|---|
| ✅ Deployment successful! View logs |
superwall-docs | 8a38f11 | Commit Preview URL Branch Preview URL |
Jul 07 2026, 08:18 PM |
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.
What
AgentChatWidget.tsxshrinks from ~300 lines of ported launcher/teaser/panel chrome + postMessage bridge to a small client-side loader for the embedded-agent worker's/widget.js— the standard hosted embed superwall.com now uses (superwall-com#14, merged) — so the widget deploys in lockstep with the agent and can never drift from its bridge protocol.AgentLauncherDither.tsxand the@paper-design/shaders-reactdependency are deleted; the dither launcher ships inside widget.js on the vanilla shader core.Behavior parity (and one fix)
z-40stacking viadata-z-index, all chrome in a shadow root.agentWidget.*localStorage keys — visitors keep their conversation, open state, and teaser dismissal.OPEN_AGENT_EVENT— the hosted widget listens for that exact event. Bonus fix: the agent app now actually consumes the seeded query (composer pre-fill + auto-send, shipped to embedded-agent main today); the old copy forwarded?query=…&send=1to an agent that ignored it.Testing
bun run build:cfclean,bun test65/65.Docs for every embed use case: https://github.com/superwall/embedded-agent#embedding-the-agent
🤖 Generated with Claude Code
https://claude.ai/code/session_01DxD3A8vSXgLxyVTPpugXFj
Generated by Claude Code