Repository navigation
release: v1.0.0 - #514
Merged
Merged
release: v1.0.0#514
Conversation
sync: production into dev
* feat(widget): support CSP nonces for styles * docs(widget): update nonce API snapshot --------- Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
* feat(widget): wait for cookie consent before using storage (#405) `waitForConsent` (and `data-wait-for-consent`) holds the chat behind a notice until `ChatCops.setConsent(true)`. While it waits the widget reads and writes no localStorage or sessionStorage and calls no API, and the welcome bubble stays hidden. The notice has a button that calls `onConsentRequest`, left out when there is none. `setConsent(true)` shows the normal chat (the saved conversation comes back); `setConsent(false)` closes the chat and removes the conversation, the session token and the bubble's flag. Both work before init() and before the chat has loaded, through the loader and the Widget class. Panel.hideMessages/showMessages become one setBodyVisible(), and the new private members join the mangle list, to keep the panel in budget. The single-file limit goes from 19 KB to 19.5 KB. * fix(widget): add setConsent to the npm and single-file ChatCops object, fix docs samples Review of #468: window.ChatCops and the default export had no setConsent, so those builds could not give consent. It now keeps the value until init() and applies it before init(), like the loader. Also declares consentBanner in the docs sample, notes that sendMessage() resolves without sending while consent is missing, and drops the .size-limit.json change (rebased on dev's new budgets). --------- Co-authored-by: Saif Ullah jafri <saifullahjafri@Saifs-MacBook-Air.local> Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
…476) The widget calls it once each time it asks the server for a session, not per message. A function that throws, rejects, returns a non-string or takes over 5 seconds means the session starts without the visitor, with a console warning. A string still works as before, and setUser() replaces the function. Co-authored-by: Saif Ullah jafri <saifullahjafri@Saifs-MacBook-Air.local>
Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com>
Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com> Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
…en (#491) The token in setUser(), ChatCops.setUser() and the script tag loader is now a UserToken: a string, or a function (sync or async) that returns a fresh token each time a session is requested. Passing the same function again keeps the chat; a different function, a string or no token counts as another visitor. Co-authored-by: Saif Ullah jafri <saifullahjafri@Saifs-MacBook-Air.local> Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
…499) Found by upgrading the 0.6 examples with only the upgrade guide's steps. The Express example and homepage tab mounted with app.all('/chat'), which never routes /chat/session, and 33 server configs in the docs, READMEs and homepage set neither sessionSecrets nor allowAnonymous, so 1.0 refuses to start them. The curl commands now get a session token first. docs:check fails on a handler or full ChatCopsServerConfig without either option.
Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
* feat(widget): a Stop button while a reply streams (#494) While a reply streams the send button becomes a Stop button, named by the new stopButton string. Clicking it aborts the request and keeps what has streamed as a finished reply, with Regenerate and no error. * test(widget): check the stopped reply exists instead of asserting it --------- Co-authored-by: Saif Ullah jafri <saifullahjafri@Saifs-MacBook-Air.local> Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
… connection is back (#495) (#502) A message sent while navigator.onLine is false is shown with a waiting note (the messageWaiting string, announced through the reply live region) and not sent. The widget sends the waiting messages in order, one at a time, on the window's online event, and removes the listener in destroy(). They are never saved. Co-authored-by: Saif Ullah jafri <saifullahjafri@Saifs-MacBook-Air.local>
…enu (#508) Panel 18 to 19 kB, single file 20 to 22 kB, ESM guard 30 to 32 kB. The loader stays at 5 kB. The next room is the launcher the panel draws again.
Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
docs:check now type-checks README code too. Fixed what it found: persistHistory in the root README, chat()/chatSync() in core (now runTurn), and the server README's RateLimiter, 0.5 stream format and made-up Redis store sections, rewritten from the current API.
…505) * Added widget menu Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com> * test(widget): configure privacyUrl in dev.html Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com> * fix(widget): address review feedback on header menu Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com> --------- Signed-off-by: Anurag Yadav <anuragyadav2787@gmail.com> Co-authored-by: Anurag Verma <78868769+anurag629@users.noreply.github.com>
pre.json to exit, so the next version PR gives core, server and widget 1.0.0. Live smoke 22/23 as at rc (cache verified at provider level), upgrade check 13/13.
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.
1.0.0: everything on dev since
1.0.0-rc.0, with rc mode turned off (#513). The version PR this opens publishes core, server and widget1.0.0under npm'slatesttag. After this, breaking changes wait for 2.0.Nothing breaks between the rc and 1.0.0. The breaking changes from 0.x are the ones in the rc, and Upgrading to 1.0 covers them.
New since the rc:
privacyUrl) (feat(widget): add header menu with conversation and privacy options #505)waitForConsent,setConsent) (feat(widget): wait for cookie consent before using storage #468)init()has none (feat(widget): support CSP nonces for styles #473, (widget): reuse script nonce for manual init #490)userTokenandsetUser({ token })take a function for a fresh token (feat(widget): userToken can be a function that returns a fresh token #476, feat(widget): setUser({ token }) takes a token function, like userToken #491)chatcops searchusesingest.index(fix(cli): search the index set in ingest.index #480)docs:checkenforces it on the docs, READMEs, homepage and examples, type-checking the READMEs too (docs: every server example starts on 1.0, and docs:check makes sure #499, docs: READMEs show 1.0 code, and docs:check type-checks them #511)Checked on these commits (details in #513):
Merging this also deploys the website from
production. The site keeps loading widget 0.7 from the CDN until a follow-up switches it to 1.0 once that's on npm.