Skip to content

Brand native Electron menu as Agent Orchestrator#2508

Open
areycruzer wants to merge 2 commits into
mainfrom
fix/issue-2507-native-menu
Open

Brand native Electron menu as Agent Orchestrator#2508
areycruzer wants to merge 2 commits into
mainfrom
fix/issue-2507-native-menu

Conversation

@areycruzer

Copy link
Copy Markdown
Collaborator

Summary

Closes #2507.

This replaces Electron's default native menu with an app-owned Agent Orchestrator menu template and preserves the standard native menu roles/shortcuts.

The macOS dev path needed one extra piece beyond the menu template: electron-forge start launches the stock Electron.app binary directly, so macOS still labels the first menu item from the executable path. This PR adds a tiny Forge start plugin that, on macOS dev runs only, creates/uses a branded executable alias inside the local Electron dev bundle so the system menu bar shows Agent Orchestrator during npm run dev too. Packaged builds continue to use the existing Forge packager config.

What changed

  • Added a testable main-process app menu helper:
    • macOS app menu label: Agent Orchestrator
    • About/Hide/Quit labels use Agent Orchestrator
    • File/Edit/View/Window/Help menus keep Electron native roles
    • Reload/Force Reload/Toggle DevTools stay dev-only
  • Installed the native menu inside app.whenReady() before createWindow().
  • Added a macOS dev-only Forge executable alias helper so electron-forge start no longer leaves the native app menu branded as Electron.
  • Added focused unit coverage for both the menu template and dev executable branding path.

Local verification

  • npm --prefix frontend test -- app-menu.test.ts dev-electron-branding.test.ts -> 2 files / 11 tests passed
  • npm --prefix frontend run typecheck -> passed
  • npm --prefix frontend test -> 50 files / 483 tests passed
  • npx --yes prettier@3 --check --ignore-unknown frontend/src/main/app-menu.ts frontend/src/main/app-menu.test.ts frontend/src/main/dev-electron-branding.ts frontend/src/main/dev-electron-branding.test.ts frontend/src/main.ts frontend/forge.config.ts -> passed

Manual macOS smoke with isolated daemon state:

  • Launched npm --prefix frontend run dev with /tmp/ao-menu-2507-third AO state.
  • Confirmed spawned process path: .../Electron.app/Contents/MacOS/Agent Orchestrator .
  • Confirmed native menu bar via accessibility: Agent Orchestrator :: AppleAgent OrchestratorFileEditViewWindowHelp
  • Confirmed native role items remain available:
    • Edit: Undo, Redo, Cut, Copy, Paste, Paste and Match Style, Delete, Select All
    • View: Reload, Force Reload, Toggle Developer Tools, Actual Size, Zoom In, Zoom Out, Toggle Full Screen
    • Window: Minimize, Zoom, Bring All to Front
  • Local screenshot evidence: /tmp/ao-menu-2507-third/evidence/menu-bar-agent-orchestrator.png

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR replaces Electron’s default native menu with an app-owned, branded “Agent Orchestrator” menu template (preserving standard native roles/shortcuts), and adds a macOS dev-only Electron Forge start plugin to ensure the macOS menu bar app label shows “Agent Orchestrator” (instead of “Electron”) during electron-forge start.

Changes:

  • Add a main-process helper to build/install a branded native application menu template (with dev-only View menu items like Reload/DevTools).
  • Install the native application menu during app.whenReady() before window creation.
  • Add a macOS dev-only Forge startLogic hook to prepare a branded Electron executable alias (plus unit tests for both menu and branding paths).

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
frontend/src/main/dev-electron-branding.ts Adds macOS dev-bundle branding helpers (Info.plist rewrite + branded executable alias).
frontend/src/main/dev-electron-branding.test.ts Unit tests for dev Electron branding + alias resolution behavior.
frontend/src/main/app-menu.ts Defines branded native menu template + install helper.
frontend/src/main/app-menu.test.ts Unit tests asserting branded macOS app menu and dev-only roles.
frontend/src/main.ts Installs the branded application menu during app startup.
frontend/forge.config.ts Adds a Forge start plugin to use the branded dev Electron executable on macOS.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread frontend/src/main/dev-electron-branding.ts Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated no new comments.

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.

macOS app menu shows Electron instead of AO / Agent Orchestrator

2 participants