Skip to content

macOS support: bring-up, native menu, ad-hoc packaging#3

Open
vozzhaevsn wants to merge 1 commit into
HelpFreedom:mainfrom
vozzhaevsn:mac-support
Open

macOS support: bring-up, native menu, ad-hoc packaging#3
vozzhaevsn wants to merge 1 commit into
HelpFreedom:mainfrom
vozzhaevsn:mac-support

Conversation

@vozzhaevsn

Copy link
Copy Markdown

Runs and packages Kadr on Apple Silicon, adds Mac-native UX, and produces a local ad-hoc-signed .app/.dmg.

Bring-up

  • node-pty rebuilds cleanly on Node 25 / Electron 31 — no version pin needed.

Mac-native (electron/)

  • fixUserPath() (main.ts): on packaged macOS launches, adopt the user's login-shell PATH before anything spawns. Finder gives GUI apps a minimal PATH, which made the embedded Claude PTY exit instantly ("session ended") and would also break node (MCP bridge), ffmpeg/ffprobe, and python3.
  • GPU: VAAPI hardware-codec switches are now Linux-only — macOS uses native VideoToolbox, and the flags only risked the GPU sandbox off-platform.
  • menu.ts: real macOS application menu. File / Undo / Redo forward to the renderer over menu:command with CmdOrCtrl accelerators (fixes the missing ⌘ shortcuts — the old keydown handler only checked ctrlKey); clipboard/selection keep native roles so text fields and the Claude terminal behave correctly.
  • preload.ts + shared/types.ts: onMenuCommand IPC bridge.
  • App.tsx: dispatch menu commands to the existing toolbar handlers (undo/redo defer to native text undo when an input is focused); drop the Save/Undo/Redo keydown branches the menu now owns.

Packaging

  • electron-builder.yml: asar:false (the app spawns mcp-bridge.cjs and transcribe.py by absolute path), arm64 dmg+zip, ad-hoc signing.
  • build/make-icon.mjs: generates a placeholder icon + .icns.
  • package.json: icon and package:mac scripts; electron-builder devDep.

Verification

  • npm run typecheck clean; dev run renders the editor.
  • Packaged .app launches from file://, renders, and the embedded Claude Code terminal starts inside the bundle (node-pty + PTY + claude spawn all work packaged).
  • fixUserPath verified under a scrubbed minimal PATH: claudeOpen → {ok:true}, session stays alive.
  • DMG mounts with the drag-to-Applications layout.

Note: on GitHub-throttled networks, installs need an Electron mirror (ELECTRON_MIRROR). Full design + evidence in docs/superpowers/specs/2026-06-17-kadr-mac-optimization-design.md.

🤖 Generated with Claude Code

Run and package Kadr on Apple Silicon, with Mac-native UX and a local
ad-hoc-signed .app/.dmg.

Bring-up
- node-pty rebuilds cleanly on Node 25 / Electron 31 (no version pin).

Mac-native (electron/)
- main.ts: fixUserPath() adopts the user's login-shell PATH on packaged
  macOS launches before anything spawns. Finder gives GUI apps a minimal
  PATH, which made the Claude PTY exit instantly ("session ended") and
  would also break node (MCP bridge), ffmpeg/ffprobe and python3.
- main.ts: VAAPI hardware-codec switches are now Linux-only (macOS uses
  native VideoToolbox; the flags only risked the GPU sandbox off-platform).
- menu.ts: real macOS application menu. File/Undo/Redo forward to the
  renderer over menu:command with CmdOrCtrl accelerators (fixes the
  missing Cmd shortcuts — the old keydown handler only checked ctrlKey);
  clipboard/selection keep native roles so text fields and the Claude
  terminal behave correctly.
- preload.ts + shared/types.ts: onMenuCommand IPC bridge.
- App.tsx: dispatch menu commands to the existing toolbar handlers
  (undo/redo defer to native text undo when an input is focused); drop the
  Save/Undo/Redo keydown branches the menu now owns.

Packaging
- electron-builder.yml: asar:false (the app spawns mcp-bridge.cjs and
  transcribe.py by absolute path), arm64 dmg+zip, ad-hoc signing.
- build/make-icon.mjs: generates the placeholder icon + .icns.
- package.json: icon and package:mac scripts; electron-builder devDep.

Note: installs need an Electron mirror on GitHub-throttled networks
(ELECTRON_MIRROR). See docs/superpowers/specs for full design + evidence.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant