Skip to content

Theme NEMAR's widget in NEMAR teal, with its own bubble color - #462

Merged
neuromechanist merged 2 commits into
developfrom
feature/nemar-widget-brand
Sep 23, 2026
Merged

neuromechanist merged 2 commits into
developfrom
feature/nemar-widget-brand

Conversation

@neuromechanist

Copy link
Copy Markdown
Member

Summary

Gives NEMAR's widget nemar.org's look, and adds the one widget setting that needed: the reader's own message bubbles can now take a community color. No other community's widget changes.

What changed

  • user_bubble_color, a new optional widget setting (WidgetConfig, the /{community} and /communities responses, and the widget). The bubbles were fixed at the platform blue whatever theme_color said. It is its own key, never derived from theme_color, so a community that sets only a theme (FieldTrip, MNE) renders exactly as before. It is validated as #RRGGBB on the server and again in the widget.
  • NEMAR's colors: theme_color and user_bubble_color #257a92. That is nemar.org's --brand-teal (#5bbad5) darkened in lightness only: the widget draws white text on both, and the brand teal itself is 2.2:1 against white, below the 4.5:1 body text needs. #257a92 is 4.9:1.
  • NEMAR's logo: the same brain mark, with its electrodes moved from orange to nemar.org's pale gold (#f4d06b), which is how the site draws the mark on a dark ground. The brain stays white so it reads on the teal header.

Checked in real Chrome with widget_e2e.py --nemar: the header, the chat and send buttons, the permission gate's Run button and the reader's bubbles all resolve to #257a92, and the logo loads.

For the release

The widget file changed, so its integrity hash did; the website's staging embed is re-pinned to this commit once it merges. The color and logo come from the server, so they apply to any embed as soon as this deploys.

Test plan

  • Model: user_bubble_color accepts a hex color and rejects others; theme_color alone adds no bubble color to resolve().
  • Endpoint: /communities returns a bubble color for NEMAR only, and none for every other community.
  • NEMAR: both colors keep white text at 4.5:1 or better, and the check fails for the undarkened brand teal.
  • Widget (happy-dom): the bubble color applies when set, is left at the default for a theme-only config, and is refused when malformed. Mutation-checked: never applying it, dropping the hex check, and making the bubbles follow the theme each fail a test; removing NEMAR's bubble color, or setting it to the brand teal, fails the endpoint and contrast tests.
  • uv run pytest -m "not network": 2726 passed; the one failure is the known test_version_shows_version fails locally and passes in CI, because rich colorizes on a TTY #434. ruff check and ruff format --check clean. test-widget-tools.js 226 of 226; build-runtime-bundle.js --check current (the bundle is unchanged).

The reader's bubbles were fixed at the platform blue. A community can now name their color on its own, never derived from theme_color, so a community that sets only a theme renders exactly as before. Validated as #RRGGBB like theme_color, on the server and again in the widget.
theme_color and user_bubble_color #257a92: nemar.org's brand teal (#5bbad5) darkened in lightness only, from 2.2:1 to 4.9:1 against the widget's white text. The logo's electrodes move from orange to nemar.org's pale gold (#f4d06b), the site's treatment of the mark on a dark ground. Tests keep both colors at 4.5:1 and every other community without a bubble color.
@github-actions

Copy link
Copy Markdown
Contributor

Preview Deployment

Name Link
Preview URL https://feature-nemar-widget-brand-demo.osc.earth
Branch feature/nemar-widget-brand
Commit 4d703d5

This preview will be updated automatically when you push new commits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant