Conversation
cx.set_menus only draws a native menu bar on macOS - on Windows/Linux GPUI stores the menus without displaying anything, leaving every menu command unreachable. Render an equivalent in-app File/View bar off macOS (deferred+anchored dropdowns, click-outside to dismiss), fold the app-menu Preferences/Quit entries into File, and switch bindings from cmd-* (Super key off mac) to secondary-* (Cmd on mac, Ctrl elsewhere).
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.
Problem
The File/View menus only worked on macOS.
cx.set_menus()draws a native menu bar on macOS, but on Windows/Linux GPUI just stores the menus without displaying anything — so every menu command (Open Database, Toggle Schema View, view switching, Preferences, …) was unreachable there.A second, related bug: keybindings used
cmd-*, which off macOS means the Windows/Super key, so the shortcuts didn't work with Ctrl either.Fix
src/ui.rs— new in-appFile/Viewmenu bar rendered on non-macOS (render_menu_bar, returnsNoneon macOS where the native bar exists). It mirrors the native menus item-for-item; the app-menu Preferences…/Quit entries are folded into File since Windows/Linux have no app-menu convention. Dropdowns usedeferred(anchored())so they paint above the header/canvas,on_mouse_down_outdismisses on outside click, and each row invokes the same view method as its native counterpart.src/main.rs— bindings switched fromcmd-*tosecondary-*(Cmd on macOS, Ctrl on Windows/Linux).README.md— documented Ctrl shortcuts and the cross-platform menu bar.Verification
cargo check+cargo clippycleancargo test)#[cfg]-gated APIs, so it type-checks on every target (a Linux-target link check wasn't possible here — no cross C++ toolchain for the vendored deps — would be good for CI to cover)