Repository navigation
Refactor(ui): Refactor desktop shell chrome controls - #399
Merged
Merged
Conversation
MicroGery
force-pushed
the
ui-shell-chrome-surfaces
branch
from
July 1, 2026 09:12
aeedcf9 to
cef5cd7
Compare
This was referenced Aug 4, 2026
Astro-Han
added a commit
that referenced
this pull request
Aug 4, 2026
…command routing (#2098) * fix(desktop): restore the native macOS application menu PR #399 removed the Electron application menu (Menu.setApplicationMenu(null)), which on macOS leaves Cmd+Q and the Edit roles without any handler — quitting was impossible via keyboard and closing the window left the Dock tile lit. Rebuild a platform-appropriate menu from native roles and route its commands through the existing renderer actions over one typed channel: - New application-menu.ts builds a darwin-only template: App (About, Settings, Services, Hide, Quit), File (New Task, Close), role-based Edit/Window, an explicit View menu with Reload/DevTools gated on isPackaged, and Help with a Keyboard Shortcuts entry. Non-darwin keeps setApplicationMenu(null) so Windows/Linux shell chrome and Ctrl+N / Ctrl+, behavior are untouched. - Menu commands dispatch over window:command (newTask | openSettings | openHelp); the renderer already owns those implementations in app-shell-effects.ts, which subscribes in the existing mount effect. - Menu accelerators are the single active owner on macOS: AppKit resolves menu key equivalents before the web contents sees the keydown, so the renderer useHotkeys entry never also fires. - The menu installs once at whenReady (app-scoped, survives window close) instead of inside createWindow; dispatch re-creates the window when none exists. Verified: 1592 desktop main tests pass (6 new menu tests), typecheck clean, and on a real macOS dev run the menu bar shows App/File/Edit/View/Window/Help with Settings… under About, New Task under File, dev-only Reload/DevTools, and menu-click Quit exits through the quit coordinator. Closes #2088 * refactor(desktop): address menu PR review feedback - Derive ApplicationMenuCommand from the preload WindowCommand contract so the two sides of the window:command channel cannot silently drift. - Drop the unused labels injection point (dead abstraction; English labels are the documented decision). - Lock the renderer-side routing with a stability-contract case: the window-command subscription must not duplicate across rerenders and must dispatch newTask/openSettings/openHelp to the existing actions. - Note the deliberate command drop when no window exists next to the dispatch branch.
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.
Summary
Refs #390
This PR refactors the desktop shell chrome so top-level window/sidebar controls have a single owner and stable geometry across sidebar states.
Changes
Menu.setApplicationMenu(null).ShellChromeandWorkspaceSurfacecomponents.SessionListPanel.Verification
npm --workspace @maka/ui run buildnpm --workspace @maka/desktop run build:mainnpm --workspace @maka/desktop run build:renderernode --test apps/desktop/dist/main/__tests__/app-shell-chrome-contract.test.jsnode --test apps/desktop/dist/main/__tests__/sidebar-topbar-rail-contract.test.jsnode --test apps/desktop/dist/main/__tests__/search-modal-lifecycle-contract.test.jsnode --test apps/desktop/dist/main/__tests__/storybook-baseline-contract.test.js