Add dark mode and mobile support to inbox component - #159
Merged
Conversation
Hook up the inbox to the SDK's colorScheme config so both the Jist template content and the inbox chrome (button, panel, badge, dividers) respect the configured color scheme. - Set jist-template `mode` property based on the resolved color scheme so Jist applies its dark theme overrides correctly - Deep-merge `patterns.modes.dark.inbox` branding overrides into the base inbox pattern when dark mode is active - Dispatch `colorSchemeChanged` event from the message component manager so the inbox re-renders on scheme changes (auto mode / explicit calls) - Add matchMedia listener for OS preference changes (system mode) - Override SVG fill attributes with currentColor so the floating icon color follows the branding config in both modes - Destroy inbox on clearUserToken to clean up on logout - Add responsive panel layout for narrow viewports (< 424px) - Extend Branding type to capture patterns.modes.dark.inbox overrides Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
karngyan
approved these changes
Jun 10, 2026
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 561dd98. Configure here.
The OS preference listener was unconditionally calling updateInbox on every change. In default mode this produced identical re-renders, and in auto mode it could double-fire alongside the colorSchemeChanged event from the MutationObserver. Now it only triggers when colorScheme is 'system' — the one mode where OS preference is the source of truth. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
colorSchemeconfig so both Jist template content and the inbox chrome (button, panel, badge, dividers) respect dark modepatterns.modes.dark.inboxbranding overrides into the base inbox pattern when dark mode is activeclearUserToken()so it's cleaned up on logoutDark mode details
Jist templates: Sets the
modeproperty onjist-templateelements based on the resolved color scheme (default→light,system→auto,auto→ resolved from parent CSS). This tells Jist when to apply itstheme.modes.darkoverrides.Inbox chrome: Reads
patterns.modes.dark.inboxfrom the branding payload and deep-merges partial overrides into the baseInboxPattern. Only overridden properties change — everything else is preserved from the base pattern.Reactivity: Dispatches a
colorSchemeChangedevent when the scheme changes (explicitsetColorSchemecalls or parent CSS changes inautomode). AmatchMedialistener handles OS preference changes forsystemmode. Both trigger a full inbox re-render with the correct pattern.SVG icon: Adds a CSS rule (
fill: currentColor) so SVG paths with hardcodedfillattributes inherit from the button'scolorstyle, which is set by the branding config.Test plan
colorSchemeisdefaultcolorSchemeisautoand the parent site is in dark modecolorSchemeissystemand OS is in dark modecolorScheme: 'system'— inbox button, panel, badge, and Jist content should updatecolorScheme: 'auto'— same behaviorGist.setColorScheme('dark')/'light'at runtime — inbox updates immediatelybackgroundandborderColor) don't clobber unoverridden propertiesGist.clearUserToken()— inbox button and panel should be removed from DOMNote
Medium Risk
Touches shared color-scheme resolution and live DOM re-renders on theme changes; logout now removes inbox UI, which is intentional but user-visible.
Overview
Wires the inbox UI to the SDK
colorSchemeso Jist message rows and inbox chrome (button, panel, badge) follow light/dark branding.Dark mode: Exports
resolveRendererColorSchemeand uses it in the inbox manager to setjist-templatemode(light/dark/auto). Addspatterns.modes.dark.inboxonBrandingwithDeepPartialdeep-merge into the baseInboxPatternwhen dark is active (explicit dark, orsystemviamatchMedia).message-component-managernow dispatchescolorSchemeChangedon scheme updates; the inbox listens and re-renders; OS preference changes also trigger updates forsystem.Other: Narrow viewports get a responsive panel (≤424px, 12px side margins). Inbox SVG fills use
currentColor.clearUserToken()callsdestroyInbox()so the widget is removed on logout. Tests cover color-scheme behavior and dark override merging.Reviewed by Cursor Bugbot for commit 54152bc. Bugbot is set up for automated code reviews on this repo. Configure here.