Skip to content

refactor(theme): QueryaUiColors and context.colors, the app's own colour type (#1730) - #1738

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
refactor/querya-colors
Oct 18, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
refactor/querya-colors

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

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 fields lib/ 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 it QueryaColors; that name is the existing palette of constants, so the type is QueryaUiColors.)
  • The bridge lives in querya_color_scheme.dart, a file already on the shadcn list: ColorScheme.uiColors (cached per scheme instance) and QueryaUiColors.toShadcn(). Fields shadcn has and the app does not read follow their neighbours, as every Querya theme sets them (cardForeground and accentForeground = foreground, input = border). It goes with refactor(app): replace ShadcnApp with MaterialApp and our theme scope (#1465) #1735.
  • QueryaTheme.colors gives the theme's colours as QueryaUiColors.
  • context.colors existed and returned shadcn's scheme (29 callers); it now returns QueryaUiColors. It reads the shell theme when there is one, so a caller sees exactly what Theme.of(context).colorScheme gives, mid theme animation included; without a shell (a bare app in a test) it falls back to the nearest QueryaThemeScope, then the default theme of the ambient brightness, instead of asserting.
  • Callers that named the type: 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, and toShadcn() gives the same scheme back (including the three derived fields); one scheme gives one cached instance; lerp ends and middle; context.colors under the shell, under a bare app, and under a scope without a shell. dart analyze is clean; theme, shared, guards, features, app and e2e suites pass locally.

@github-actions github-actions Bot added theme Theming, colors, VS Code themes frontend Theme parser epic label: frontend ui User interface components and widgets P2 Medium priority / Parity & Refactoring labels Oct 18, 2026
@github-actions github-actions Bot added this to the Theme system milestone Oct 18, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit f336e24 into dev Oct 18, 2026
14 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 P2 Medium priority / Parity & Refactoring 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