Port Kaleido Desktop to macOS

macOS (Apple silicon) now plays, browses and updates like Windows:

- Video: libmpv's render API draws into a CAOpenGLLayer beneath the
  WKWebView, with the miniplayer rectangle, HDR passthrough through
  extended dynamic range (PQ/BT.2020) and display-sleep prevention.
- Window: native traffic lights on the top bar's centre line, hidden
  with the player's controls; the page's caption buttons are Windows-only.
- Interface: macOS shortcut labels (⌘K, ⌘[, ⌃⌘F), Plex identifies the
  player as a Mac, and header values are kept ASCII (Mac computer names
  usually contain a curly apostrophe).
- The window appears without waiting for an animation frame, which
  WKWebView doesn't run in a hidden window.
- Credentials: release builds use the Keychain and are signed with a
  lasting self-signed certificate so access survives updates; debug
  builds keep tokens in a private file to avoid prompts on every rebuild.
- Bundling: scripts/fetch-libmpv.sh makes Homebrew's libmpv and its
  libraries self-contained; scripts/build.sh builds the .app, .dmg and
  signed update archive.

Releases now carry both platforms: publish-release.mjs uploads each
machine's build into one release, and update-manifest.mjs writes the
feed from that release's assets, refusing while a platform is missing.

The updater uses a new signing key (public key in tauri.conf.json), so
existing installs must be reinstalled once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Elijah Kuntz 2026-11-02 15:14:40 -07:00
parent a3c05e9062
commit 7d0803481b
39 changed files with 1191 additions and 230 deletions

View file

@ -11,7 +11,7 @@
- Keep the interface restrained: no redundant buttons or navigation.
- `.env` (`PLEX_SERVER_URL`, `PLEX_TOKEN`) is for local testing only. Never print,
commit or embed credentials. `.tools/updater.key` signs updates; never commit or
replace it.
replace it. `.tools/macos-signing.*` backs up the macOS signing certificate; same rules.
- Shared code goes in `src/` and `src-tauri/src/`; anything OS-specific goes in
`src-tauri/src/platform/<os>.rs` or `tauri.<os>.conf.json`.
@ -19,19 +19,20 @@
- `npm run typecheck`, `npm test`, `cargo check --manifest-path src-tauri/Cargo.toml`.
- UI: `npm run dev` and a browser at http://localhost:1420 (signs in from `.env`).
- Native: `npm run tauri dev` with `WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--remote-debugging-port=9333`;
`window.__kaleido` exposes the stores in development.
- Native: `npm run tauri dev` (on Windows with `WEBVIEW2_ADDITIONAL_BROWSER_ARGUMENTS=--remote-debugging-port=9333`);
`window.__kaleido` exposes the stores in development. On macOS the Rust toolchain is
Homebrew's keg-only `rustup` (`export PATH=/opt/homebrew/opt/rustup/bin:$PATH`).
- Mute before playback tests (`__kaleido.useSettings.getState().set('volume', 0)`).
Playback changes real Plex progress and track selections; restore them.
## Releases
Built and published locally (CI only validates). In short: bump the version in
`package.json`, `src-tauri/Cargo.toml`, `src-tauri/tauri.conf.json` (+ lockfile), add a
`CHANGELOG.md` section, `.\scripts\build.ps1`, commit + tag `vX.Y.Z` + push,
`node scripts/publish-release.mjs X.Y.Z [--prerelease]`, then
`node scripts/update-manifest.mjs X.Y.Z <release download URL>` and commit/push
`updates/latest.json`. Full checklist: `docs/development.md` → Releases. Only push or
Built and published locally, Windows and macOS each on their own machine, into one
release (CI only validates). In short: bump the version in `package.json`,
`src-tauri/Cargo.toml`, `src-tauri/tauri.conf.json` (+ lockfile), add a `CHANGELOG.md`
section, commit + tag `vX.Y.Z` + push; on each OS build (`.\scripts\build.ps1` /
`sh scripts/build.sh`) and `node scripts/publish-release.mjs X.Y.Z [--prerelease]`; then
`node scripts/update-manifest.mjs X.Y.Z` and commit/push `updates/latest.json`. Full checklist: `docs/development.md` → Releases. Only push or
publish when the user asks. `FORGEJO_TOKEN` lives in the ignored `.env`.
See `docs/architecture.md` and `docs/development.md`.