feat: menu to check Goose Desktop's version on Linux (#2450)

This commit is contained in:
Best Codes
2025-05-06 14:38:56 -05:00
committed by GitHub
parent d4c5b30f58
commit 95c31250df
2 changed files with 43 additions and 1 deletions

View File

@@ -10,7 +10,7 @@
"license": {
"name": "Apache-2.0"
},
"version": "1.0.21"
"version": "1.0.22"
},
"paths": {
"/agent/tools": {

View File

@@ -928,6 +928,48 @@ app.whenReady().then(async () => {
);
}
// on macOS, the topbar is hidden
if (menu && process.platform !== 'darwin') {
let helpMenu = menu.items.find((item) => item.label === 'Help');
// If Help menu doesn't exist, create it and add it to the menu
if (!helpMenu) {
helpMenu = new MenuItem({
label: 'Help',
submenu: Menu.buildFromTemplate([]), // Start with an empty submenu
});
// Find a reasonable place to insert the Help menu, usually near the end
const insertIndex = menu.items.length > 0 ? menu.items.length - 1 : 0;
menu.items.splice(insertIndex, 0, helpMenu);
}
// Ensure the Help menu has a submenu before appending
if (helpMenu.submenu) {
// Add a separator before the About item if the submenu is not empty
if (helpMenu.submenu.items.length > 0) {
helpMenu.submenu.append(new MenuItem({ type: 'separator' }));
}
// Create the About Goose menu item with a submenu
const aboutGooseMenuItem = new MenuItem({
label: 'About Goose',
submenu: Menu.buildFromTemplate([]), // Start with an empty submenu for About
});
// Add the Version menu item (display only) to the About Goose submenu
if (aboutGooseMenuItem.submenu) {
aboutGooseMenuItem.submenu.append(
new MenuItem({
label: `Version ${gooseVersion || app.getVersion()}`,
enabled: false,
})
);
}
helpMenu.submenu.append(aboutGooseMenuItem);
}
}
if (menu) {
Menu.setApplicationMenu(menu);
}