Repository navigation
fix(theme): token defaults without a theme scope no longer need a shadcn theme (dev red since #1666) - #1671
Merged
Conversation
…dcn theme #1666 (#1509) made the dialog backdrop use workbenchOrDefault.shadow. Without a QueryaThemeScope that getter fell back to colors.brightness, which is shadcn Theme.of and asserts when there is no shadcn theme, so every app_dialog test (a bare MaterialApp) failed and dev went red. The fallbacks of workbenchOrDefault, editorTheme and semanticPalette take the shadcn theme's brightness when there is one, else Material's. The app always has both scopes, so nothing changes there. The settled-tint test now expects the theme's shadow colour, which the backdrop has used since #1666, instead of plain black.
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.
devhas been red since #1666 (#1509): 10 tests intest/shared/app_dialog_test.dartfail, so every PR intodevshows a red Tests (core-theme).Cause
#1666 made the dialog backdrop's tint
context.workbenchOrDefault.shadow. Without aQueryaThemeScope,workbenchOrDefaultfalls back oncolors.brightness, andcolorsis shadcnTheme.of(context), which asserts when there is no shadcn theme. The dialog tests pump a bareMaterialApp, so every one of them failed withNo Theme found in context, the exact case those defaults exist for.Fix
QueryaThemeContext._ambientBrightness: the shadcn theme's brightness when there is one, else MaterialTheme.of(context).brightness(which never asserts).workbenchOrDefault,editorThemeandsemanticPaletteuse it for their fallback. The app always has aQueryaThemeScopeand a shadcn theme, so nothing changes at runtime.app_dialog_test"settles at full blur and tint" expected plain black. The backdrop has used the theme's shadow colour since refactor(ui): migrate hardcoded colors in onboarding and badges to QueryaTheme tokens (#1509) #1666 (slate0xFF0F172Ain the light defaults), so the test now expectsworkbenchOrDefault.shadowat the full alpha.The other dialog tests only compare alpha and blur and are unchanged.
Not run locally; CI decides.