Repository navigation
Closed
Description
English
Context
Child of #2084.
#399 intentionally removed the Electron application menu while consolidating shell chrome. Since then, #669 added Cmd/Ctrl+N in the renderer, alongside the existing Cmd/Ctrl+, Settings shortcut. The application actions work, but the native menu surface and standard platform commands remain absent.
Restore the native application menu and route menu items and keyboard shortcuts through the existing renderer actions without creating duplicate command implementations or double dispatch.
Current behavior
apps/desktop/src/main/main-window.tscallsMenu.setApplicationMenu(null).apps/desktop/src/renderer/app-shell-effects.tsownsCmd/Ctrl+NandCmd/Ctrl+,through a global rendererkeydownlistener.window.maka.appWindow.subscribeOpenSettings()and thewindow:openSettingspreload channel already provide a main-to-renderer Settings route, but main does not currently dispatch it.- Standard App, Edit, Window, and Help menu behavior is unavailable. On macOS this also removes discoverable system entry points such as Dictation and Emoji & Symbols.
Scope
- Build a platform-appropriate Electron application menu using native roles where available.
- Restore standard App, Edit, View, Window, and Help behavior. Add a File menu when needed for application commands such as New Task and Close Window.
- Expose New Task (
Cmd/Ctrl+N) and Settings (Cmd/Ctrl+,) through the native menu. - Route both commands to the existing
createSession()andopenSettings()behavior in the renderer. - Keep exactly one active accelerator owner per platform so a keypress dispatches each command once.
- Keep Reload and DevTools development-only.
- Preserve standard text-editing behavior when an editable control is focused.
- Use platform-specific menu structure and labels rather than forcing the macOS hierarchy onto Windows or Linux.
Acceptance criteria
- A supported packaged macOS build exposes a native application menu with standard App, Edit, View, Window, and Help behavior.
- New Task and Settings are discoverable from the menu and retain
Cmd/Ctrl+NandCmd/Ctrl+,. - Menu clicks and keyboard accelerators invoke the existing renderer actions exactly once.
- Standard Close, Minimize, Hide, and Quit behavior works in the platform states where each command applies.
- Undo, Redo, Cut, Copy, Paste, Select All, Dictation, and Emoji & Symbols remain available to focused editable controls where macOS provides them.
- Reload and DevTools are absent from production menus and remain available in development.
- No-window, pre-reveal, focused-editor, minimized, hidden, and closed-window states do not throw or leave duplicate listeners.
- Windows and Linux retain their existing shell chrome and working
Ctrl+N/Ctrl+,behavior unless a deliberate platform-native menu change is documented and verified.
Verification
- Add focused tests for menu-template composition and semantic command dispatch; avoid source-regex-only assertions.
- Run the desktop main and renderer builds plus the targeted command-routing tests.
- Verify the supported packaged macOS build with real menu clicks and accelerators, including a focused text editor and the window states listed above.
- Smoke-test Windows/Linux command behavior when the routing ownership changes.
Out of scope
- Moving Settings into a separate window.
- Redesigning shell chrome introduced by Refactor(ui): Refactor desktop shell chrome controls #399.
- Global shortcuts that work while Maka is inactive.
- Adding new application commands beyond those needed for the restored native menu.
- Fixing the keyboard-shortcuts Help surface tracked by bug: Help (keyboard shortcuts) modal content renders without layout/styling #1689.
References
- polish(desktop): track high-impact native-experience improvements #2084 — native-experience polish tracking issue.
- Refactor(ui): Refactor desktop shell chrome controls #399 — intentionally removed the Electron application menu.
- feat(desktop): ⌘N creates a new task — global shortcut, sidebar hint, help entry #669 — added renderer-owned
Cmd/Ctrl+N;Cmd/Ctrl+,already exists in the same command seam. - bug: Help (keyboard shortcuts) modal content renders without layout/styling #1689 — existing keyboard-shortcuts Help surface bug; coordinate rather than expanding this issue.
简体中文
背景
#2084 的子任务。
#399 在收敛 shell chrome 时有意删除了 Electron application menu。之后,#669 在 renderer 中加入了 Cmd/Ctrl+N,同一位置此前已经处理 Cmd/Ctrl+, Settings 快捷键。应用动作本身可用,但原生菜单入口和标准平台命令仍然缺失。
本 issue 恢复原生 application menu,并让菜单项和键盘快捷键复用现有 renderer 动作,不创建重复命令实现,也不产生双重触发。
当前行为
apps/desktop/src/main/main-window.ts调用Menu.setApplicationMenu(null)。apps/desktop/src/renderer/app-shell-effects.ts通过全局 rendererkeydownlistener 处理Cmd/Ctrl+N和Cmd/Ctrl+,。window.maka.appWindow.subscribeOpenSettings()和window:openSettingspreload channel 已经提供 main 到 renderer 的 Settings 路由,但 main 当前没有发送该事件。- 标准 App、Edit、Window 和 Help 菜单行为不可用;在 macOS 上,这也移除了 Dictation、Emoji & Symbols 等系统入口的可发现性。
范围
- 使用 Electron native role 构建符合各平台习惯的 application menu。
- 恢复标准 App、Edit、View、Window 和 Help 行为;需要承载 New Task、Close Window 等应用命令时加入 File 菜单。
- 在原生菜单中提供 New Task(
Cmd/Ctrl+N)和 Settings(Cmd/Ctrl+,)。 - 两个命令都路由到 renderer 中现有的
createSession()和openSettings()行为。 - 每个平台只保留一个生效的 accelerator owner,确保一次按键只触发一次命令。
- Reload 和 DevTools 仅在开发环境出现。
- 编辑控件聚焦时保留标准文本编辑行为。
- 使用平台特定的菜单结构和文案,不把 macOS 菜单层级强加到 Windows 或 Linux。
验收条件
- 受支持的 packaged macOS 构建提供原生 application menu,包含标准 App、Edit、View、Window 和 Help 行为。
- New Task 和 Settings 可从菜单发现,并保留
Cmd/Ctrl+N和Cmd/Ctrl+,。 - 点击菜单和使用键盘 accelerator 都只调用一次现有 renderer 动作。
- Close、Minimize、Hide 和 Quit 在各自适用的平台状态下正常工作。
- 编辑控件聚焦时,Undo、Redo、Cut、Copy、Paste、Select All,以及 macOS 提供的 Dictation 和 Emoji & Symbols 均可用。
- Production 菜单不包含 Reload 和 DevTools;开发环境中仍可使用。
- 无窗口、首帧 reveal 前、编辑控件聚焦、最小化、隐藏和窗口关闭状态不会抛错或遗留重复 listener。
- Windows 和 Linux 保留现有 shell chrome 及可用的
Ctrl+N/Ctrl+,;如有明确的平台原生菜单变化,必须记录并验证。
验证
- 为 menu template 组合和语义命令派发增加聚焦测试,避免只检查源码文本的断言。
- 运行 desktop main、renderer build 和相关 command-routing 测试。
- 在受支持的 packaged macOS 构建中,用真实菜单点击和 accelerator 验证,并覆盖编辑控件聚焦及上述窗口状态。
- 命令路由 ownership 变化时,对 Windows/Linux 行为做 smoke test。
不在范围内
- 把 Settings 移到独立窗口。
- 重新设计 Refactor(ui): Refactor desktop shell chrome controls #399 引入的 shell chrome。
- Maka 未激活时仍生效的 global shortcut。
- 增加恢复原生菜单所不需要的新应用命令。
- 修复 bug: Help (keyboard shortcuts) modal content renders without layout/styling #1689 跟踪的 keyboard-shortcuts Help surface。
关联
- polish(desktop): track high-impact native-experience improvements #2084:native-experience polish tracking issue。
- Refactor(ui): Refactor desktop shell chrome controls #399:有意删除 Electron application menu 的来源。
- feat(desktop): ⌘N creates a new task — global shortcut, sidebar hint, help entry #669:加入 renderer 侧
Cmd/Ctrl+N;同一 command seam 已存在Cmd/Ctrl+,。 - bug: Help (keyboard shortcuts) modal content renders without layout/styling #1689:现有 keyboard-shortcuts Help surface bug;需要协调,但不扩大本 issue 范围。
Metadata
Metadata
Assignees
Labels
No labels
Activity
Astro-Han commentedon Aug 4, 2026
User-reported evidence (macOS, packaged 0.1.4, Electron 43.1.1):
Cmd+Qis completely dead, not merely undiscoverable: withsetApplicationMenu(null)there is no Quit menu item, so the accelerator has no handler (same mechanism as electron/electron#49807 — keyboard shortcuts are tied to menu items; removing the menu leaves nothing to handle them).Cmd+C/Cmd+V/Cmd+Aare equally dead in editable controls.Observed consequences on a real machine today:
window-all-closedis a no-op on darwin, so the process stays alive in the Dock with no windows and no way to quit) or force-quit from the Dock.AskUserQuestionwere leftwaiting_for_userwith no terminal fact, exactly the class of stuck run documented in bug(runtime): a stopped run parked on AskUserQuestion never lands a terminal fact, and prior-run context then silently drops the whole turn #2074. A subsequent launch's recovery marked themapp_restarted.Note that an AppleScript
quitevent (Cocoa terminate) still works because it bypasses the menu accelerator — the before-quit coordinator itself is fine; only the accelerator path is broken. This makes the Quit acceptance criterion in this issue a functional requirement, not polish.Is anyone already working on this? If not, I'd like to pick it up.
Colafornia commentedon Aug 4, 2026
@Astro-Han Confirmed — no one else is working on this. Please go ahead.
Thanks for validating the impact on a packaged macOS build.
fix(desktop): restore the native application menu and unify platform …