Repository navigation
Draw the widget in the community's look at once - #476
Merged
Merged
Conversation
On every load the launcher appeared in the built-in defaults (the 56px bubble, #2563eb) and changed to the community's look when its config request returned, about 450 ms later on test.nemar.org, a reload included (#475). - The config's widget block is remembered in localStorage, per community and API endpoint, and applied before anything is drawn, through the same checks as a fresh one. The fresh config still wins and replaces it; setConfig still outranks both. - The colors are set before the widget joins the page, so the first style is already the community's, with nothing to fade from. - A first visit keeps the launcher hidden, with transitions off, until the config arrives (at most 1.5 s, or a failed request), then shows it. - Re-applying the same logo no longer rebuilds the avatar. Tested: bun frontend/test-widget-first-paint.js (56, new, in both CI workflows); test-widget-capsule.js's bubble test now checks the settled markup and what a first visit adds while it waits; 15 mutations, 13 killed, 2 equivalent; every other Bun suite unchanged and passing.
startServer and waitForServer move out of color-scheme-check.mjs into harness-server.js, for the first paint check to use too; the caller now reports a server that did not start. Tested: color-scheme-check.mjs --serve, 26 checks, 0 failures; a server that cannot start is reported with its output.
first-paint-check.mjs records the launcher on every animation frame from document start, with the config request held 600 ms, and requires every visible frame to show the community's look, on a first visit and on a reload. Runs in CI beside the light and dark check. Tested: 12/12 in Chrome 153; develop's widget fails it, as does each of four mutations (transitions on while waiting, colors set after the widget joins the page, nothing remembered, no first-visit wait).
community-widget.md gains a section on the remembered look: what is kept and where, how a fresh config and setConfig rank against it, the first-visit wait and its cap, and blocked storage. Tested: docs only.
Contributor
Preview Deployment
This preview will be updated automatically when you push new commits. |
Review of #476: the server leaves defaults out (a bubble launcher, the light scheme, an unset color), so a remembered value for a field the fresh config omits survived the whole load, and a remembered capsule could not turn back into a bubble at all. - After a remembered look, the display fields go back to their pre-init values before the fresh config is applied; setConfig keys, including ones set while the request was in flight, are kept. - revertLauncherMode undoes the capsule to the bubble's markup; unset colors remove their properties; a dropped logo restores the avatar. - The config is remembered under the community it was requested for. - The first-visit cap is scheduled before the widget is built, so an exception cannot leave the launcher hidden; the tooltip's timer starts when the launcher is shown. - One warning per invalid color and value, not one per application. - The feedback dialog's "shared with" line follows the config; a first visit named the default community's maintainers. Tested: bun frontend/test-widget-first-paint.js (81; a stale capsule reverts to the markup of a load remembering the new config, dropped fields, mid-flight setConfig and community change, an injected fault, the tooltip, one warning); 16 mutations, all killed; other suites pass.
first-paint-check.mjs records whether the widget is dark on every frame, and runs three times: NEMAR on a light and a dark device, and the harness's bubble community (color_scheme auto) on a dark device. Tested: 42/42 in Chrome 153; develop's widget fails 12 of them.
The first paint section now says what happens to a field the fresh config leaves out, including the launcher's shape, when a changed look reaches a reader, the tooltip's timing, and one warning per bad color. Tested: docs only.
Member
Author
Review responseThree reviews (code and docs, tests, error handling). Every finding is addressed in 9177747, d620ff1 and 13d15aa, except the two noted at the end.
Not changed, with reasons:
Gates: every Bun suite in CI, |
3 tasks
neuromechanist
added a commit
that referenced
this pull request
Sep 24, 2026
Release review: add the widget's Notebook tab (#471, #474), color_scheme auto (#472), the first-paint fix (#476) and the dark-page field colors; the capsule and notebook-site bullets described the notebook opening in a new tab, which #474 replaced. Tested: docs-only; each claim checked against origin/develop (config.yaml color_scheme, osa-widget-config- key, ADR 0012 path).
neuromechanist
added a commit
that referenced
this pull request
Sep 24, 2026
* Title the changelog's release as 0.8.14 Tested: docs only. * Complete the 0.8.14 changelog Release review: add the widget's Notebook tab (#471, #474), color_scheme auto (#472), the first-paint fix (#476) and the dark-page field colors; the capsule and notebook-site bullets described the notebook opening in a new tab, which #474 replaced. Tested: docs-only; each claim checked against origin/develop (config.yaml color_scheme, osa-widget-config- key, ADR 0012 path).
6 tasks
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.
On every page load the widget drew its launcher in the built-in defaults, the 56px bubble in
#2563eb, and changed to the community's look when the community config request returned: about 450 ms later on test.nemar.org, on a reload as much as a first visit, then a 250 ms color fade (#475). For NEMAR the button also visibly shrank into the 46px capsule. This draws it in the community's look from the first frame.What changes
widgetblock is kept in the page's ownlocalStorage(osa-widget-config-<communityId>), with the API endpoint it came from. The next load applies it before anything is drawn, through the same function and checks as a fresh config (applyWidgetDisplay, extracted fromfetchCommunityConfigunchanged). The fresh config still arrives and wins for every field: the display fields first go back to their pre-init values, because the server leaves defaults out (a bubble launcher, the light scheme, an unset color), and a remembered capsule reverts to the bubble's markup (revertLauncherMode). An embedder'ssetConfigkeys still outrank both, including one set while the request is in flight. The config is remembered under the community it was requested for. An entry for another endpoint, or one that cannot be read, is ignored.applyThemeProperties, split out ofapplyWidgetConfig), so its first computed style is already the community's. Setting them after it joined was measured: a reload then fades from blue.startServer/waitForServermove fromcolor-scheme-check.mjsintoharness-server.js, for the new Chrome check to share.This applies to every community, not only NEMAR. Every community had the same flash (HED's button, for one, drew in the platform blue before its own color), and nothing here can know a community's look before its config except what an earlier load remembered. A bubble community's settled markup and computed styles are unchanged;
test-widget-capsule.js's bubble test now checks them once the config has arrived, and checks that a first visit adds exactly one class,osa-launcher-waiting, until then.Tests
frontend/test-widget-first-paint.js(new, 81 checks, in both CI workflows): a stale remembered capsule, dark scheme, text color, label and logo all undone by a fresh config that leaves them out, down to the markup of a load that remembers the new config; a dropped theme color; asetConfigmade during the request; a community change during the request; an exception injected right after the widget joins the page; the tooltip waiting for its button; one warning per bad color; the pop-out keeping its host's scheme; a first visit hidden until the config, then shown and remembered with its endpoint; a reload drawn in the remembered look (capsule at 46px, colors, title, launcher label, placeholder, logo) with the config still in flight; the fresh config winning and replacing the memory as sent rather than merged;setConfigoutranking it; another endpoint's, unreadable, and oddly shaped entries ignored, quietly when they parse; storage that throws on every call; the 1.5 s cap, and a failed request showing the launcher at once; invalid remembered colors warned about and not applied; a bubble community; the pop-out; the logo not rebuilt.loadCommunityConfignever rejects, so itsfinallyis a backstop; a parsednullnow returns early either way).frontend/browser-harness/first-paint-check.mjs --serve(new, in CI beside the light and dark check), 42/42 in Chrome 153: a recorder installed before any page script samples the chat button, and whether the widget is dark, on every animation frame, with the config held 600 ms; NEMAR on a light and a dark device, and a bubble community withcolor_scheme: autoon a dark device. First visits first shown between 650 and 665 ms, reloads between 19 and 27 ms, and no visible frame in any run shows anything but the final look. Controls:develop's widget fails 12 checks, and each of these fails it too: transitions left on while waiting, colors set after the widget joins the page, nothing remembered, no first-visit wait.color-scheme-check.mjs --serve(26), andnotebook-tab-check.mjsagainst the live develop notebook (14/14), with the new startup.build-runtime-bundle.js --check.Closes #475.