[SCAL-336732] Add an isDarkMode option to the embed config - #672
Merged
Merged
Conversation
Let an embed host choose the appearance of the embedded application without reaching for additionalFlags, the generic escape hatch whose own doc comment warns it is for advanced use only and that we do not publish the supported keys for. The value travels as a query param on the iframe URL, so the embedded application has it before first paint and renders dark with no flash of the light theme. - Add EmbedConfig.darkMode, the appearance for every embed on the page - Add BaseViewConfig.darkMode, so one embed can override that - Add Param.DarkMode and emit it from getBaseQueryParams, the single origin of the query params for every embed type - Resolve the two levels with ??, so that an explicit view-level false overrides an init-level true and only undefined falls through - Omit the param entirely when neither level sets it, keeping the URL short for the hosts that never ask for a dark embed - Cover both config levels, an explicit false and the omitted case Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Code Review
This pull request introduces support for a darkMode option, allowing the embedded application to be rendered in dark or light appearance. It adds darkMode configuration options to both EmbedConfig and BaseViewConfig, updates the query parameter generation in TsEmbed, and includes comprehensive unit tests. The review feedback highlights two style guide violations in the JSDoc code examples within src/types.ts: one example is missing a closing }); for an init() call, and another uses invalid placeholder syntax instead of valid JavaScript/TypeScript.
commit: |
Review feedback on the code examples in the darkMode doc comments, against the two style guide rules under Code Example Integrity. - Close the init() example with `});`, per the rule that init() calls in examples must include it - Name a concrete component in the view config example instead of `new <EmbedComponent>(...)`, which is not valid JavaScript - Line up the indentation inside the view config example Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
sastaachar
approved these changes
Oct 1, 2026
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.
Let an embed host choose the appearance of the embedded application without reaching for
additionalFlagsThe value travels as a query param on the iframe URL, so the embedded application has it from its first load.
EmbedConfig.isDarkMode, the default for every embed on the pageBaseViewConfig.isDarkMode, so one embed can override thatParam.IsDarkModeand emit it fromgetBaseQueryParams, the base query params every embed type builds on??, so that an explicit view-levelfalseoverrides an init-leveltruetrue, also sendradiantThemeEnabled: true, because the application's dark mode lives in its radiant theme; a host can still override that throughadditionalFlagsBOOTSTRAP_URL_PARAMS, so they stay on the URL whenexcludeConfigFromURLis set; without that, the embed flickered on load until they arrived overUpdateEmbedParamsfalse, the omitted case, theadditionalFlagsoverride and theexcludeConfigFromURLcase