Skip to content

chore(dev): isolate dev binary from installed app via bundle-ID override#62

Merged
matthewod11-stack merged 1 commit intomainfrom
chore/dev-bundle-id
Apr 27, 2026
Merged

chore(dev): isolate dev binary from installed app via bundle-ID override#62
matthewod11-stack merged 1 commit intomainfrom
chore/dev-bundle-id

Conversation

@matthewod11-stack
Copy link
Copy Markdown
Owner

Background

While smoke-testing #61 (surface update errors), I hit a frustrating debug loop: every screenshot showed the wrong binary's window. Root cause was that the dev build (target/debug/people-partner) and the signed installed /Applications/People Partner.app share "identifier": "com.peoplepartner.app". macOS Launch Services routes open_application and open -b calls by bundle ID — so any "bring this app forward" command always lands on the installed app, leaving the dev binary's window hidden behind it.

This is a recurring papercut for any future Tauri dev workflow: smoke tests, screenshot validation, manually inspecting state — all confused by the wrong window coming to front.

What this PR does

  • src-tauri/tauri.conf.dev.json (new, 5 lines) — minimal override applied on top of the base tauri.conf.json via Tauri 2's --config flag. Sets:
    • identifier: com.peoplepartner.app.dev
    • productName: People Partner (Dev)
  • package.json — new tauri:dev script invoking tauri dev --config src-tauri/tauri.conf.dev.json. Plus a parallel tauri:build for symmetry (production builds still use the base config — no change to signed release artifacts).

Verified empirically

Ran npm run tauri:dev from this branch and confirmed:

  • ✅ macOS menu bar shows "People Partner (Dev)" when the dev binary is frontmost (overrides productName propagated through Cocoa NSApplication identity).
  • ✅ A separate Application Support directory was auto-created: ~/Library/Application Support/com.peoplepartner.app.dev/ (with its own fresh SQLite DB). Dev experiments don't pollute production data — intentional side effect.
  • npm run type-check clean.
  • cargo tauri build (production) still resolves to the base tauri.conf.json with the original com.peoplepartner.app identifier — confirmed by reading the merged config; no change to signing/notarization/updater pipelines.

Side effect: data isolation

Because each bundle ID gets its own Application Support dir, the dev binary now starts with a fresh, empty SQLite DB. To populate it for an interactive smoke session:

npm run generate-test-data
npm run import-test-data

This is documented in CLAUDE.md (gitignored, local) under the dev command rationale.

Out of scope

  • No changes to tauri.conf.json (base/production config) — release pipeline unaffected.
  • No changes to signing, notarization, updater plugin, or release.yml — orthogonal to this fix.
  • Did not wrap the dev binary in a .app bundle. That would also solve the collision but is a much larger change (and dev binaries traditionally stay raw); the override approach is sufficient.

Test plan

  • npm run type-check clean
  • npm run tauri:dev launches with "People Partner (Dev)" in the menu bar
  • Separate Application Support dir created at runtime
  • No tauri.conf.json changes; production build path unaffected
  • Reviewer: confirm npm run tauri:dev works on a clean checkout (i.e. doesn't depend on local cache state)

🤖 Generated with Claude Code

The dev binary (target/debug/people-partner) and the signed installed
/Applications/People Partner.app share bundle identifier
"com.peoplepartner.app". Without intervention, every macOS Launch
Services call routes by bundle ID, so `open_application("People
Partner")` always lands on the installed app — which makes screenshots,
smoke tests, and debug sessions confusing because the wrong binary's
window comes to front. Discovered while smoke-testing #54.

This PR adds:

- `src-tauri/tauri.conf.dev.json` — minimal config with `identifier =
  "com.peoplepartner.app.dev"` and `productName = "People Partner
  (Dev)"`. Tauri's `--config` flag deep-merges this on top of the base
  `tauri.conf.json`.
- `package.json` — new `tauri:dev` script (`tauri dev --config ...`)
  and a parallel `tauri:build` for symmetry.

Verified empirically:
- `npm run tauri:dev` launches a binary whose macOS menu bar reads
  "People Partner (Dev)" instead of "People Partner".
- A separate Application Support directory is created at
  ~/Library/Application Support/com.peoplepartner.app.dev/ — dev runs
  use a fresh isolated SQLite DB and don't pollute production data
  (intentional side effect; documented in CLAUDE.md).
- `cargo tauri build` still uses the base `tauri.conf.json` with the
  production `com.peoplepartner.app` identifier — no impact on signed
  release artifacts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings April 27, 2026 18:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR improves the Tauri development workflow on macOS by preventing the dev-run binary from colliding with the installed/signed app in Launch Services, via a dev-only bundle identifier and product name override.

Changes:

  • Add a minimal src-tauri/tauri.conf.dev.json override config that sets a distinct identifier and productName for dev runs.
  • Add tauri:dev and tauri:build npm scripts to standardize dev/build commands (dev uses the override config).

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src-tauri/tauri.conf.dev.json Introduces a dev-only config override to isolate the dev app identity (bundle ID/product name).
package.json Adds scripts to run Tauri dev with the override config and a symmetric build script.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@matthewod11-stack matthewod11-stack merged commit 5c71188 into main Apr 27, 2026
7 checks passed
@matthewod11-stack matthewod11-stack deleted the chore/dev-bundle-id branch April 27, 2026 18:50
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.

2 participants