Repository navigation
Fix widget config in <head> and stale mention selection - #207
Merged
Merged
Conversation
Capture document.currentScript while the bundle is evaluated and pass it to boot(), since it is null by DOMContentLoaded. Fall back to a script whose src points at /widget/embed.js as well as data-escalated-widget.
Suggestions now record the query they were fetched for. While the list on screen belongs to an older query, Enter/Tab are swallowed: no stale agent is inserted and the chat message is not sent. The list stays visible.
…fication TicketList and QuickFilters fall back to the light panel preset colours when the host sets no theme.panel. Guest/Create only shows the ticket lookup when both lookup_url and verification_url are present.
Merged
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
embed.jssits in<head>, boot waits forDOMContentLoaded, by which pointdocument.currentScriptis null, so everydata-*setting and the src-derived backend URL were lost (requests went to the host page's own origin). The script tag is now captured while the bundle is evaluated and passed toboot(). There is also a fallback toscript[src*="/widget/embed.js"]next toscript[data-escalated-widget].theme.panel. Guest/Create shows the ticket lookup only when bothlookup_urlandverification_urlare present, instead of posting tonull.Tests
tests/widget/loader.test.js: loads the bundle from<head>(no body andcurrentScriptset during evaluation, then DOMContentLoaded) and checks that config and the backend URL are used. A second test covers the src fallback.pendingstate, the dropdown swallowing Enter/Tab, and a ChatComposer end-to-end test (Enter during the debounce neither sends nor inserts, and the fresh result is picked once it lands). The existing "keeps the current suggestions visible" test still passes.verification_url.npm run lintand prettier are clean.