Skip to content

fix(workspace): adapt SQL toolbar background to active theme and invalidate pane cache (#1577) - #1658

Merged
ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1577-light-theme-sql-toolbar
Oct 17, 2026
Merged

ZhuchkaTriplesix merged 1 commit into
devfrom
issue/1577-light-theme-sql-toolbar

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

Fixes an issue where the SQL workspace toolbar retained a dark background in light themes (#1577).

Root Causes & Fixes

  1. Dynamic Toolbar Header Widget: In GenericSqlWorkspaceState._buildSessionPane, the toolbar container decoration was evaluated once at pane construction time and cached in _paneCache, preventing it from rebuilding when theme tokens changed while child controls dynamically adapted to light theme. Introduced _SqlWorkspaceToolbarContainer which dynamically obtains SqlEditorChrome.sqlToolbarDecoration(context) during build.
  2. Pane Cache Invalidation on Theme Dependency Changes: Added didChangeDependencies to GenericSqlWorkspaceState to invalidate _paneCache whenever the ambient QueryaThemeScope updates.
  3. Solid Surface Token: Updated SqlEditorChrome.sqlToolbarDecoration to use solid workbench.surface instead of semi-transparent workbench.surface.withValues(alpha: 0.85) so background layers cannot bleed through or darken light theme surfaces.
  4. Theme Mode Alignment: In ThemeController.setThemeMode, clear conflicting registry themes when switching brightness so light mode cleanly aligns active preset and tokens.

Verification

  • flutter test test/features/workspace/sql_workspace_toolbar_test.dart test/features/workspace/sql_editor_chrome_test.dart test/features/workspace/generic_sql_workspace_sessions_test.dart test/core/theme/theme_controller_test.dart (all passed)
  • flutter test test/core/theme/ (218 tests passed)
  • flutter analyze (0 issues found)

Closes #1577

@github-actions github-actions Bot added the bug Something isn't working label Oct 17, 2026
@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit 33ed54e into dev Oct 17, 2026
13 checks passed
@ZhuchkaTriplesix
ZhuchkaTriplesix deleted the issue/1577-light-theme-sql-toolbar branch October 17, 2026 03:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant