Skip to content

[Bug]: Save Query modal overrides the editor theme globally #247

@debba

Description

@debba

Describe the bug

Opening the Save Query modal switches the Monaco editor theme to the UI theme. Because Monaco's theme registry is global, the change leaks into every other Monaco instance (the main console editor, cell editors, etc.) and persists after the modal is closed.

This only shows up if you have picked an editor theme in Settings → Appearance that differs from the UI theme. In that case the colors in the main editor visibly change the moment the modal opens and stay wrong until the editor is remounted (tab switch, app reload, ...).

The modal passes theme={currentTheme.id} to Monaco instead of resolving settings.editorTheme like SqlEditorWrapper does, and it never calls loadMonacoTheme in beforeMount, so the global monaco.editor.setTheme() call overwrites the previously active theme.

To Reproduce

  1. Open Settings → Appearance and set an editor theme different from the UI theme (e.g. UI: Default Dark, Editor: Monokai).
  2. Open the SQL editor — syntax colors follow the editor theme.
  3. Right-click a query → Save Query.
  4. Look at the SQL preview inside the modal and at the main editor behind it: both now use the UI theme colors. Closing the modal does not restore the editor theme.

OS Version

Linux (Arch, KDE) — reproducible on any platform

Tabularis Version

v0.11.0

Relevant Log Output

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions