Skip to content

Commit 76f2018

Browse files
committed
Show "Ness" instead of "harness" in the macOS app menu
The app menu's About / Hide / Quit items read "harness" because they derive from app.name, which Electron takes from package.json's top-level "name" — still "harness". The menu bar title is already correct since macOS reads that from CFBundleName (build.productName). Renaming the package or calling app.setName() is not an option: app.name keys both the userData directory and the macOS Safe Storage keychain item, and the keychain is case-sensitive, so either would break secrets.enc decryption. Instead, set explicit labels from a new APP_DISPLAY_NAME constant, and set the About panel's applicationName so the dialog behind the About item matches too.
1 parent 2ec7e8c commit 76f2018

1 file changed

Lines changed: 16 additions & 4 deletions

File tree

src/main/desktop-shell.ts

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ export interface DesktopShellEarlyHandle {
6868
transport: ElectronServerTransport
6969
}
7070

71+
/** User-facing product name. Deliberately NOT `app.name` — package.json's
72+
* `name` stays "harness" because it keys the userData directory and the
73+
* macOS Safe Storage keychain item (see CLAUDE.md), so renaming it or
74+
* calling `app.setName()` would break secrets.enc decryption. */
75+
const APP_DISPLAY_NAME = 'Ness'
76+
7177
/** Where the web-client bundle lives at runtime. Differs between
7278
* packaged builds (asar-relative) and dev / unpacked (sibling of the
7379
* main bundle output). Lives here so index.ts doesn't need to call
@@ -378,17 +384,17 @@ export function startDesktopShell(deps: DesktopShellStartDeps): DesktopShellStar
378384
function buildMenu(): void {
379385
const template: Electron.MenuItemConstructorOptions[] = [
380386
{
381-
label: app.name,
387+
label: APP_DISPLAY_NAME,
382388
submenu: [
383-
{ role: 'about' },
389+
{ role: 'about', label: `About ${APP_DISPLAY_NAME}` },
384390
{ type: 'separator' },
385391
{
386392
label: 'Settings…',
387393
accelerator: 'CmdOrCtrl+,',
388394
click: () => transport.sendSignal('app:openSettings')
389395
},
390396
{ type: 'separator' },
391-
{ role: 'hide' },
397+
{ role: 'hide', label: `Hide ${APP_DISPLAY_NAME}` },
392398
{ role: 'hideOthers' },
393399
{ role: 'unhide' },
394400
{ type: 'separator' },
@@ -411,7 +417,7 @@ export function startDesktopShell(deps: DesktopShellStartDeps): DesktopShellStar
411417
// AND keyup) flows to our handlers, where the hold gesture lives.
412418
// Menu click still quits immediately.
413419
{
414-
label: `Quit ${app.name}`,
420+
label: `Quit ${APP_DISPLAY_NAME}`,
415421
click: () => app.quit()
416422
}
417423
]
@@ -769,6 +775,12 @@ export function startDesktopShell(deps: DesktopShellStartDeps): DesktopShellStar
769775
log('app', 'failed to set dock icon', err instanceof Error ? err.message : err)
770776
}
771777
}
778+
if (process.platform === 'darwin') {
779+
app.setAboutPanelOptions({
780+
applicationName: APP_DISPLAY_NAME,
781+
applicationVersion: app.getVersion()
782+
})
783+
}
772784
buildMenu()
773785
void runBoot()
774786
createWindow()

0 commit comments

Comments
 (0)