Skip to content

feat(menus): one tab context menu everywhere, one look for every menu - #109

Merged
sao-coding merged 3 commits into
mainfrom
sao-coding/unified-menus
Dec 4, 2026
Merged

sao-coding merged 3 commits into
mainfrom
sao-coding/unified-menus

Conversation

@sao-coding

@sao-coding sao-coding commented Dec 4, 2026 •

Copy link
Copy Markdown
Owner

What

  1. A tab has one right-click menu, built by one function (shell/tab_menu.rs), used by every place a tab can be right-clicked.
  2. Every context / dropdown menu builds its rows with one component (shell/menu.rs), so they share one look.

Before: which tab menu where

Place Before
Tab list row (expanded) Rename · Pin · Split ▸ · Remove from split · Move to Space ▸ · Close
Icon rail (collapsed sidebar) no menu
Pinned tile only Unpin
Split group sub-row no menu
Pane header no menu
Split group row its own group menu (Expand, Zoom, Dissolve, Close group) – unchanged, it is a group, not a tab

After: one tab menu

Close  Ctrl+W
Close others · Close to the right · Close all      (pinned tabs stay)
─────
Pin / Unpin · Rename
─────
Split ▸ (right Ctrl+\, down Ctrl+Shift+\, left, up) · Remove from split · Move to Space ▸
─────
Copy name

Rule (also in the code comment): an item that can never apply to the tab is hidden (Split / Rename on History / Settings pages, Move to Space with one Space, Remove from split outside a group, Split on a tab that is already a pane); an item that applies but has nothing to do now is disabled (Close others / right / all). Every tab is a query tab or a page, so there are no kind-specific extras yet. Rename now opens the same small dialog everywhere (the inline rename by double click stays). Duplicate and Reveal in tree are not offered: there is no generic duplicate for a tab, and tabs have no tree node.

One look for every menu

shell/menu.rs is the only row component. Rows use the kit's own icon column, row height, text size, padding, separator and submenu chevron, with the shortcut right-aligned in muted mono, destructive rows in the same red, disabled rows muted. Removed the private row builders of the grid cell menu, the column header menu, the all-results menu and the Space switcher; grid and diagram menus open through one popup_at helper (window-clamped with the same margin). Rows that were plain kit rows already matched and are unchanged.

Icons are 16 px in every menu: the kit draws a 12 px slot, but a minimum size on the icon's own style widens it, so no fork or custom submenu is needed. Every row has the icon column (an empty icon when it has none), so labels share one x; pick lists use a check in that column. The tab menu never changes shape: Rename, Split, Remove from split are disabled when they do not apply, Move to Space always lists the other Spaces plus "New Space…" (creates one and moves the tab). Only Close has an icon; the other close rows keep the empty column.

Tests

  • Unit tests for the builder: same common items in the same order for page / query, pinned / unpinned, in a pane / in a group; no stray separators; "nothing to close" disables instead of hides; close scopes keep pinned tabs.
  • fmt, clippy -D warnings, cargo test --release --workspace --lib --bins pass locally.
  • Driven live (Windows, throwaway data dir): the menu opens with identical items from the tab list, a page tab, a pinned tile, a split group sub-row and the icon rail; Pin from the menu works; Space switcher shows the dot / check. Zoomed crops: icons and labels share one left edge in every row of the new tab menu.
  • Not driven live: the schema tree, grid cell / header, Redis, ER diagram and Git panel menus (no database connection in the run); they only changed through the shared row helper.

Before / after screenshots are kept outside the repo.

@sao-coding
sao-coding merged commit 00231e9 into main Dec 4, 2026
9 checks passed
@sao-coding
sao-coding deleted the sao-coding/unified-menus branch December 4, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant