Repository navigation
fix: build the macOS menu from the action list - #897
Merged
Merged
Conversation
The native menu in menu.rs was a hand-kept copy of the in-app menu and had drifted: Backup, Restore, New Table, Agents, the View menu and the command palette were missing, Compare Schemas sent an id nothing handled, nothing could be greyed out, and saved profiles could not be listed at all. The frontend now describes the menu from MENUS and ACTIONS, with each action's enabled state and a Connection > Connect to submenu of saved profiles, and sends it through a new set_native_menu command whenever that changes. Rust validates the description on every platform and rebuilds the menu bar on macOS, with an application menu first (macOS takes the first menu as the app menu, which hid File) and the system's own clipboard items. A static default, checked against AppLayout's handlers by a test, covers the time before the window loads. Closes #863. Closes #892. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01WTypK4RjzzdjoFxd3qk14g
This was referenced Oct 29, 2026
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The macOS native menu was a hand-built copy of the in-app menu, and the two had drifted apart:
The native menu is now built from the same
ACTIONSandMENUSthe in-app menu uses. Written by theimplementer-rustsubagent.Design
set_native_menu(menus). Each menu has a label and entries; an entry is an item (id, label, accelerator, enabled), a separator, or a submenu.menu.rshas a platform-independentplan()step, with 14 unit tests.__tauriids, and limits nesting depth.realize()turns the plan into Tauri menu objects. Only theapp.set_menucalls are macOS-only.default_menus()stands in until the window sends its own menu. Actions that need a connection start disabled.useNativeMenu(). It only runs on macOS.MENUS/ACTIONSandisEnabled.menu-actionevent, which already handledconnect:<profileId>after feat: UX review fixes for connections and app shell #891.Closes #863. Closes #892.
Not verifiable here
None of the macOS-only code has run, because CI and this container are Linux. Only compiling and the platform-independent tests ran. Before release, check on a Mac:
Test plan
cargo fmt --all --checkandcargo clippy --workspace --all-targets --all-features -- -D warningsare clean.cargo test -p sqlpilot --lib: 82 passed, including 14plan()tests.src/hooks/__tests__/useNativeMenu.test.ts:MENUSin order, and its disabled states matchACTIONS.default_menus()id has acaseinAppLayout, and that the list matchesMENUS.tscand dprint are clean, andcheck-documented-commands.shpasses with §5.8 updated.Generated by Claude Code