π€― LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
Desktop Menu Configuration Guide
Menu Types
- App Menu: Top of window (macOS) or title bar (Windows/Linux)
- Context Menu: Right-click menus
- Tray Menu: System tray icon menus
File Structure
apps/desktop/src/main/
βββ menus/
β βββ appMenu.ts # App menu config
β βββ contextMenu.ts # Context menu config
β βββ factory.ts # Menu factory functions
βββ controllers/
β βββ MenuCtr.ts # Menu controller
β βββ TrayMenuCtr.ts # Tray menu controller
App Menu Configuration
// apps/desktop/src/main/menus/appMenu.ts
import { BrowserWindow, Menu, MenuItemConstructorOptions } from 'electron';
export const createAppMenu = (win: BrowserWindow) => {
const template: MenuItemConstructorOptions[] = [
{
label: 'File',
submenu: [
{
label: 'New',
accelerator: 'CmdOrCtrl+N',
click: () => {
/* ... */
},
},
{ type: 'separator' },
{ role: 'quit' },
],
},
// ...
];
return Menu.buildFromTemplate(template);
};
// Register in MenuCtr.ts
Menu.setApplicationMenu(menu);
Context Menu
export const createContextMenu = () => {
const template = [
{ label: 'Copy', role: 'copy' },
{ label: 'Paste', role: 'paste' },
];
return Menu.buildFromTemplate(template);
};
// Show on right-click
const menu = createContextMenu();
menu.popup();
Tray Menu
// TrayMenuCtr.ts
this.tray = new Tray(trayIconPath);
const contextMenu = Menu.buildFromTemplate([
{ label: 'Show Window', click: this.showMainWindow },
{ type: 'separator' },
{ label: 'Quit', click: () => app.quit() },
]);
this.tray.setContextMenu(contextMenu);
i18n Support
import { i18n } from '../locales';
const template = [
{
label: i18n.t('menu.file'),
submenu: [{ label: i18n.t('menu.new'), click: createNew }],
},
];
Best Practices
- Use standard roles (
role: 'copy') for native behavior - Use
CmdOrCtrlfor cross-platform shortcuts - Use
{ type: 'separator' }to group related items - Handle platform differences with
process.platform
if (process.platform === 'darwin') {
template.unshift({ role: 'appMenu' });
}