Skip to content

fix(theme): token defaults without a theme scope no longer need a shadcn theme (dev red since #1666) - #1671

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1509-dialog-theme-fallback
Oct 17, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1509-dialog-theme-fallback

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

dev has been red since #1666 (#1509): 10 tests in test/shared/app_dialog_test.dart fail, so every PR into dev shows a red Tests (core-theme).

Cause

#1666 made the dialog backdrop's tint context.workbenchOrDefault.shadow. Without a QueryaThemeScope, workbenchOrDefault falls back on colors.brightness, and colors is shadcn Theme.of(context), which asserts when there is no shadcn theme. The dialog tests pump a bare MaterialApp, so every one of them failed with No Theme found in context, the exact case those defaults exist for.

Fix

  • QueryaThemeContext._ambientBrightness: the shadcn theme's brightness when there is one, else Material Theme.of(context).brightness (which never asserts). workbenchOrDefault, editorTheme and semanticPalette use it for their fallback. The app always has a QueryaThemeScope and 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 (slate 0xFF0F172A in the light defaults), so the test now expects workbenchOrDefault.shadow at the full alpha.

The other dialog tests only compare alpha and blur and are unchanged.

Not run locally; CI decides.

…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.
@github-actions github-actions Bot added theme Theming, colors, VS Code themes frontend Theme parser epic label: frontend ui User interface components and widgets P3 Low priority / Polish & Enhancements labels Oct 17, 2026
@github-actions github-actions Bot added this to the 0.5.0 milestone Oct 17, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit efc0f25 into dev Oct 17, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Theme parser epic label: frontend P3 Low priority / Polish & Enhancements theme Theming, colors, VS Code themes ui User interface components and widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant