Commit e2fa95d
authored
Show "Ness" instead of "harness" in the macOS app menu (#300)
## Problem
The macOS app menu's items read **"About harness"**, **"Hide harness"**,
and **"Quit harness"**.
The menu bar *title* is already correct ("Ness") because macOS takes
that from `CFBundleName`, which electron-builder sets from
`build.productName`. But the submenu items come from `app.name`, which
Electron derives from `package.json`'s top-level `"name"` — still
`"harness"`.
## Why not just rename the package
`package.json`'s `"name": "harness"` is load-bearing, and CLAUDE.md
documents it. `app.getName()` keys **both**:
- the userData directory (`~/Library/Application Support/harness`), and
- the macOS Safe Storage keychain item (service `harness Safe Storage`,
account `harness Key`).
The filesystem is case-insensitive but **the keychain is not**, so
renaming the package — or calling `app.setName('Ness')` at boot — would
break `safeStorage` decryption of `secrets.enc` (GitHub PAT, backend
tokens) with *"A keychain can not be found to store …"*. Same reasoning
that keeps `build.appId` at `org.mikelyons.harness`.
So the fix is explicit labels, not a rename.
## The change
All in `src/main/desktop-shell.ts`:
- New module-level `APP_DISPLAY_NAME = 'Ness'` constant, with a "why"
comment noting it is deliberately **not** `app.name`.
- `buildMenu()`: explicit labels on `about`, `hide`, and `Quit` (and the
app-menu `label`, which macOS ignores in favor of `CFBundleName` but is
kept consistent). `hideOthers` / `unhide` need no change — they render
"Hide Others" / "Show All" with no app name.
- `app.setAboutPanelOptions({ applicationName, applicationVersion })` on
darwin at ready, so the About *dialog* behind the menu item stops
showing "harness" too.
No behavior outside the menu changes; `app.name` is untouched everywhere
it matters (paths, keychain).
## Verification
- `npm run typecheck` — clean
- `npx electron-vite build` — clean
- `npx vitest run` — 2987 tests / 227 files pass
- Menu confirmed visually by @blindpirate in a dev build
One note for reviewers: this machine's C++ toolchain can't build
`node-pty` (a bare `#include <functional>` fails system-wide), so the
dev app runs but PTY spawns fail with `posix_spawnp failed`. That's a
pre-existing local environment issue, unrelated to this change, and it
doesn't affect the menu.
_PR opened on behalf of @blindpirate by Claude via
[Ness](https://github.com/ness-dev/ness)._1 parent ebc3079 commit e2fa95d
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
71 | 77 | | |
72 | 78 | | |
73 | 79 | | |
| |||
411 | 417 | | |
412 | 418 | | |
413 | 419 | | |
414 | | - | |
| 420 | + | |
415 | 421 | | |
416 | | - | |
| 422 | + | |
417 | 423 | | |
418 | 424 | | |
419 | 425 | | |
420 | 426 | | |
421 | 427 | | |
422 | 428 | | |
423 | 429 | | |
424 | | - | |
| 430 | + | |
425 | 431 | | |
426 | 432 | | |
427 | 433 | | |
| |||
444 | 450 | | |
445 | 451 | | |
446 | 452 | | |
447 | | - | |
| 453 | + | |
448 | 454 | | |
449 | 455 | | |
450 | 456 | | |
| |||
802 | 808 | | |
803 | 809 | | |
804 | 810 | | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
805 | 817 | | |
806 | 818 | | |
807 | 819 | | |
| |||
0 commit comments