fix(emotion): only warn about a missing theme when the fallback is actually used - #2675
Open
matyasf wants to merge 1 commit into
Open
fix(emotion): only warn about a missing theme when the fallback is actually used#2675matyasf wants to merge 1 commit into
matyasf wants to merge 1 commit into
Conversation
…tually used getTheme warned "No theme provided for [InstUISettingsProvider], using default `canvas` theme." whenever there was no ancestor theme, even when the caller passed a perfectly valid theme via the `theme` prop. That path returns early from the isBaseTheme branch and never touches the canvas fallback, so the warning was a false positive on the most common usage. Move the warning below the isBaseTheme early return so it only fires when we really do fall back to canvas. Also collapse the currentTheme if/else into a hasAncestorTheme flag and make the InstUIProviderProps import type-only. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
Contributor
|
Contributor
Visual regression report
Diff images (33)alert.png — baseline no longer producedavatar.png — baseline no longer producedbadge.png — baseline no longer producedbillboard.png — baseline no longer producedbreadcrumb.png — baseline no longer producedbutton-and-derivatives.png — baseline no longer producedbyline.png — baseline no longer producedcalendar.png — baseline no longer producedcheckbox.png — baseline no longer producedcheckboxgroup.png — baseline no longer producedcolorpicker.png — baseline no longer producedcontextview.png — baseline no longer producedcustom-and-lucide-icons.png — baseline no longer produceddateinput-dateinput2.png — baseline no longer produceddatetimeinput.png — baseline no longer produceddiff-demo.png — 6324 pixels differdrilldown.png — baseline no longer producedfiledrop.png — baseline no longer producedform-errors.png — baseline no longer producedheading.png — baseline no longer producedimg.png — baseline no longer producedlink.png — baseline no longer producedmenu.png — baseline no longer producedmetric-pill-tag-timeselect-text.png — baseline no longer producedoptions.png — baseline no longer producedpagination.png — baseline no longer producedprogressbar.png — baseline no longer producedselect-simpleselect.png — baseline no longer producedtable.png — baseline no longer producedtabs.png — baseline no longer producedtooltip.png — baseline no longer producedtreebrowser.png — baseline no longer producedview.png — baseline no longer producedBaselines come from the |
HerrTopi
approved these changes
Aug 4, 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.

Summary
canvastheme." warning below theisBaseThemeearly return so it only fires when thecanvasfallback is actually used — previously it was a false positive whenever a valid theme was passed via thethemeprop with no ancestor theme.currentThemeif/else into ahasAncestorThemeflag; make theInstUIProviderPropsimport type-only.Test Plan
<InstUISettingsProvider theme={canvas}>(no ancestor provider) and confirm no console warning appears.<InstUISettingsProvider themeOverride={{...}}>with nothemeand confirm the warning still appears.Fixes INSTUI-5142
🤖 Generated with Claude Code