Skip to content

[P1][bug] MenuBar lacks a theme-cycle action; macOS native menu has no theme control at all #453

Description

@EVWorth

Context

Theme is cycleable from two surfaces (TitleBar/Toolbar) but not from the menu bar — and macOS uses the menu bar as the primary UI surface.

Problem

src/components/layout/MenuBar.tsx:11-89 defines 5 menus (File, Edit, Connection, Database, Help) plus a Tools menu with format-sql and conditional ai-assistant. There is no theme-cycle menu item. The Help menu has check-for-updates but not theme.

As a result, the only way to change theme from inside the menu bar (relevant for macOS where the OS menu bar is the primary surface) is to drop down to the Toolbar — but macOS uses Toolbar (not TitleBar), which sits inline at the top of the window. The user has no menu shortcut for theme.

Compared to other IDE conventions (VS Code: Preferences > Theme > Color Theme; DataGrip: View > Quick Switch Scheme; IntelliJ: View > Quick Switch Scheme), this is a missing affordance.

AppLayout.tsx's handleAction switch (lines 94-167) also has no cycle-theme / set-theme case — even if a menu item existed, the dispatcher wouldn't handle it.

The cross-cutting audit (docs/audits/cross-cutting.md F8) flagged this as P1.

Files

  • src/components/layout/MenuBar.tsx:11-89 — menu items, no theme
  • src/components/layout/AppLayout.tsx:94-167 — handleAction switch, no theme case
  • src-tauri/src/menu.rs — native macOS menu (no theme entry either)

Repro

On macOS, open SQLPilot → look at the top of the screen → no menu item changes theme.

Expected

A Theme (or View > Theme) submenu listing the 3 modes (Dark / Light / System), or a single Cycle Theme item. AppLayout.handleAction handles cycle-theme and set-theme actions. The native macOS menu (built in src-tauri/src/menu.rs) also gains the same entry for View > Theme.

Proposed fix

Scope S. Add a Theme submenu under the existing menus in MenuBar.tsx:

{ label: "Theme", submenu: [
  { type: "item", id: "set-theme-dark", label: "Dark" },
  { type: "item", id: "set-theme-light", label: "Light" },
  { type: "item", id: "set-theme-system", label: "System" },
  { type: "separator" },
  { type: "item", id: "cycle-theme", label: "Cycle Theme", shortcut: "Cmd+Shift+T" },
]}

Wire 4 new actions in AppLayout.handleAction (set-theme-dark, set-theme-light, set-theme-system, cycle-theme). Update src-tauri/src/menu.rs for the native macOS menu parity.

Acceptance

macOS users can change theme via the menu bar (View > Theme or wherever placed). MenuBar.tsx has 4 new theme actions wired through AppLayout.tsx's handleAction switch. src-tauri/src/menu.rs is updated for native parity.

Needs human verify

Yes (macOS-native menu rendering not testable on Linux).

Labels: audit, area/cross-cutting, severity/p1, kind/bug

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/cross-cuttingAudit areaauditTracks a feature-by-feature codebase audit findingkind/bugAudit finding categoryseverity/p1Audit finding severity

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions