Repository navigation
refactor(theme): QueryaUiColors and context.colors, the app's own colour type (#1730) - #1738
Merged
Merged
Conversation
…r type, bridged to the shadcn scheme (#1730)
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.
Closes #1730. Part of #1465 (step 3a); the per-folder migration is #1731.
QueryaUiColors(core/theme/querya_ui_colors.dart, no shadcn import): immutable,lerp,==, with the fieldslib/reads of shadcn's scheme under the same names:background,foreground,card,popover/popoverForeground,primary/primaryForeground,secondary/secondaryForeground,muted/mutedForeground,accent,destructive/destructiveForeground,border,ring,chart1–chart5,brightness. (The issue named itQueryaColors; that name is the existing palette of constants, so the type isQueryaUiColors.)querya_color_scheme.dart, a file already on the shadcn list:ColorScheme.uiColors(cached per scheme instance) andQueryaUiColors.toShadcn(). Fields shadcn has and the app does not read follow their neighbours, as every Querya theme sets them (cardForegroundandaccentForeground=foreground,input=border). It goes with refactor(app): replace ShadcnApp with MaterialApp and our theme scope (#1465) #1735.QueryaTheme.colorsgives the theme's colours asQueryaUiColors.context.colorsexisted and returned shadcn's scheme (29 callers); it now returnsQueryaUiColors. It reads the shell theme when there is one, so a caller sees exactly whatTheme.of(context).colorSchemegives, mid theme animation included; without a shell (a bare app in a test) it falls back to the nearestQueryaThemeScope, then the default theme of the ambient brightness, instead of asserting.QueryaDropdown(QueryaThemeColorScheme, the typedef is removed) and the two connection dialogs' card rows.No visual change: the values are the shadcn scheme's, field by field.
Tests (
querya_ui_colors_test.dart): for the dark, light and an imported VS Code theme every field equals the shadcn field, andtoShadcn()gives the same scheme back (including the three derived fields); one scheme gives one cached instance;lerpends and middle;context.colorsunder the shell, under a bare app, and under a scope without a shell.dart analyzeis clean; theme, shared, guards, features, app and e2e suites pass locally.