fix(widget): carry landing message in the URL as well as window.name#8
Merged
Merged
Conversation
The primary path passed the typed message only via window.name, which is destroyed when an iOS universal-link intercept tears down the originating tab — so the message was lost. Send it over both channels (window.name + URL hash); the web app reads window.name first and falls back to the hash. Also export buildTargetUrl/normalizeMessage and add unit tests for URL construction (none existed). Refs DoctorinaAI/doctorina#3940
|
Visit the preview URL for this PR (updated for commit 75c0eb3): https://doctorina-pages--pr-8-wcxf2c5t.web.app (expires Thu, 25 Jun 2026 13:04:30 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: 9cce88f2a7a5916aaad58a2b37340f46f15c32e8 |
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.
Part of DoctorinaAI/doctorina#3940 (epic DoctorinaAI/doctorina#3911). Pairs with app-side PR DoctorinaAI/doctorina#3941.
Problem
The widget's primary path passed the typed message to the web app only via
window.name.window.namelives in the originating browser tab, so when an iOS universal-link intercept tears that tab down (the app.doctorina.com deep-link bug fixed app-side in #3941), the payload is destroyed and the message is lost. The URL carried no copy on this path.Change
src/widget/tab-opener.ts: on the primary (window.open) path, also carry the message in the destination URL (buildTargetUrl(config, text)), so it survives a lostwindow.name. The web app already readswindow.namefirst and falls back to the URL hash, so there's no double-handling — the hash is pure backup. The popup-blocked fallback is unchanged.buildTargetUrlandnormalizeMessage.tests/widget-tab-opener.test.ts— first unit tests for the widget's URL construction (default target,auto_accept_policies/referrer, default + overridableutm_medium, custom params, hash round-trip incl. unicode, custom target URL).8 passed.Notes
data-*config.npm run type-check,eslint, andvitestall pass.