| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [View Raw Code] [Original HTTPS Page] |
Querya Desktop uses a VS Code–inspired theme pipeline: workbench chrome colors, editor syntax tokens, and optional import of community .json / .jsonc themes.
Theme system epic (#37) — shipped in 0.4.0 (2026-05-28).
Delivered: models (#38), JSONC parser (#39), ThemeController (#40–41), Preferences + import (#43–45), tokenColors → syntax highlight (#46–47, #49–50), P0 workbench tokens (#42, #59–60), tests (#58), docs/theme.md (#55), Querya Light (#51), optional theme animation (#57), editor package spikes (#48, #52).
Follow-up (not blocking): P2 surfaces (Mongo/Redis explorer semantic hues), re_editor if large-buffer benchmarks fail — see archive/code-forge-evaluation.md.
flowchart TB
subgraph input [Input]
VSCode["VS Code theme file\n(colors + tokenColors)"]
Prefs["Preferences overrides"]
end
subgraph parse [Parser]
JSONC["stripJsonc"]
Manifest["VsCodeThemeManifest"]
Map["vscode_color_map"]
Tokens["TokenStyleResolver"]
end
subgraph models [Runtime models]
WB["QueryaWorkbenchTheme"]
ED["QueryaEditorTheme"]
QT["QueryaTheme"]
end
subgraph ui [UI]
Scope["QueryaThemeScope"]
Shadcn["ShadcnApp ColorScheme"]
Editor["QueryaCodeEditor\nsyntax_highlight"]
end
VSCode --> JSONC --> Manifest
Manifest --> Map --> WB
Manifest --> Map --> ED
Manifest --> Tokens --> ED
Prefs --> Map
WB --> QT
ED --> QT
QT --> Scope
QT --> Shadcn
QT --> Editor
| Layer | Purpose |
|---|---|
| Workbench | Sidebar, tabs, canvas, accents, git decoration |
| Editor | SQL/JSON editor surface, selection, line numbers, syntax token hues |
| ColorScheme | shadcn/Material widgets (buttons, inputs, dialogs) |
ThemeController merges layers, persists settings in AppSettings, and drives QueryaApp via ListenableBuilder.
Access tokens in widgets:
final workbench = context.workbench;
final editor = context.editorTheme;
final scheme = Theme.of(context).colorScheme;Requires QueryaThemeScope above the widget (provided by QueryaApp).
Supported keys are listed in theme-import.md and defined in lib/core/theme/parser/vscode_color_map.dart.
Merge order for the active theme:
effectiveColors = merge(importedTheme.colors, userOverrides)
Built-in preset values apply for keys not present in the merged map.
Stored in theme_overrides_json as VS Code key → hex:
{
"sideBar.background": "#1a1a2e",
"editor.background": "#16161e",
"focusBorder": "#89b4fa"
}API:
await ThemeController.instance.setWorkbenchColor('sideBar.background', color);
await ThemeController.instance.clearColorOverrides();tokenColors entries map TextMate scopes to foreground/background/fontStyle. TokenStyleResolver resolves scopes by longest prefix (keyword.control.sql → keyword.control → keyword).
Imported rules are:
Buffers ≥ 8KB are highlighted in a background isolate to keep typing responsive.
The file must include a colors object (required for import). tokenColors are optional but recommended for editor highlighting.
See also: theme-import.md.
| Area | Location |
|---|---|
| JSONC / manifest | test/core/theme/parser/ |
| Color merge | test/core/theme/parser/vscode_colors_merge_test.dart |
| Fixtures | test/fixtures/themes/ |
| ThemeController | test/core/theme/theme_controller_test.dart |
| Editor highlighting | test/core/editor/ |
Run: flutter test test/core/theme/
Off by default. Enable in Preferences → Appearance → Animate theme changes to turn on ShadcnApp.enableThemeAnimation.
Manual QA (with animation enabled):
| Topic | Status |
|---|---|
| Workbench colors import | Done |
| Preferences UI | Done |
| SQL/JSON syntax highlighting | Done |
| tokenColors → highlighter | Done |
| Theme transition animation | Preferences → Animate theme changes (default off) |
| code_forge / LSP editor | NO-GO for 0.3 — archive/code-forge-evaluation.md |
| Back | FazBrowse Home | New Git URL |