diff --git a/.claude/skills/storybook-stories/SKILL.md b/.claude/skills/storybook-stories/SKILL.md index 70e2b2134f..9214c9db94 100644 --- a/.claude/skills/storybook-stories/SKILL.md +++ b/.claude/skills/storybook-stories/SKILL.md @@ -1,9 +1,9 @@ --- name: storybook-stories -description: Write Storybook stories for PostHog Code UI components. Covers the provider stack stories run inside, the key gotcha that tRPC/useHostTRPC queries never resolve in Storybook (so data-fetching components render empty), and the pure-presentational split that makes a component storyable. Use when adding or fixing a *.stories.tsx file under packages/ui. +description: Write Storybook stories for PostHog UI components. Covers the provider stack stories run inside, the key gotcha that tRPC/useHostTRPC queries never resolve in Storybook (so data-fetching components render empty), and the pure-presentational split that makes a component storyable. Use when adding or fixing a *.stories.tsx file under packages/ui. --- -# Storybook stories in PostHog Code +# Storybook stories in PostHog Stories live next to components as `*.stories.tsx` and are collected by `apps/code/.storybook/main.ts` (its glob includes diff --git a/.claude/skills/test-electron-app/SKILL.md b/.claude/skills/test-electron-app/SKILL.md index 3e3370d2ab..29f88e7e05 100644 --- a/.claude/skills/test-electron-app/SKILL.md +++ b/.claude/skills/test-electron-app/SKILL.md @@ -1,10 +1,10 @@ --- name: test-electron-app -description: Drive the real running PostHog Code Electron app (live tRPC, workspace-server, real data) over CDP with agent-browser. Connect to the running app on port 9222, snapshot the accessibility tree to verify changes, click/type/navigate, and screenshot the actual desktop app only when explicitly asked. Use when asked to test, verify, dogfood, screenshot or interact with the running app. For regression specs use the Playwright E2E suite. +description: Drive the real running PostHog Electron app (live tRPC, workspace-server, real data) over CDP with agent-browser. Connect to the running app on port 9222, snapshot the accessibility tree to verify changes, click/type/navigate, and screenshot the actual desktop app only when explicitly asked. Use when asked to test, verify, dogfood, screenshot or interact with the running app. For regression specs use the Playwright E2E suite. allowed-tools: Bash(agent-browser:*), Bash(npx agent-browser:*), Bash(pnpm app:cdp*) --- -# Test the real PostHog Code Electron app +# Test the real PostHog Electron app Drive the actual running app over the Chrome DevTools Protocol with [agent-browser](https://github.com/vercel-labs/agent-browser). The dev app @@ -186,7 +186,7 @@ When the user asked for a screenshot, they want to look at it, so close the loop default debugging port; if `connect` attaches to the wrong target, list and pick the PostHog window: `agent-browser tab` then `agent-browser tab --url "*"`. - **Multiple targets:** the app has a main renderer window (page title contains - "PostHog Code") plus possible webviews/devtools. `agent-browser tab` lists them; + "PostHog") plus possible webviews/devtools. `agent-browser tab` lists them; switch with `agent-browser tab `. - **Never pass `--color-scheme dark`:** that global flag makes agent-browser apply device emulation that forces a 1280x720 viewport and renders this Electron window @@ -201,7 +201,7 @@ When the user asked for a screenshot, they want to look at it, so close the loop ## Running alongside prod -PostHog Code orchestrates the agent, so the usual loop is: **prod** (the installed app) runs the agent, and the **dev** build (`pnpm dev`) is the system under test. They coexist by design (`apps/code/src/main/bootstrap.ts`): dev runs as `posthog-code-dev` with its own app name, userData and single-instance lock, so it never collides with prod. +PostHog orchestrates the agent, so the usual loop is: **prod** (the installed app) runs the agent, and the **dev** build (`pnpm dev`) is the system under test. They coexist by design (`apps/code/src/main/bootstrap.ts`): dev runs as `posthog-code-dev` with its own app name, userData and single-instance lock, so it never collides with prod. - **agent-browser always targets dev.** Only the dev build exposes CDP on `:9222`; prod has no debug port, so `connect 9222` can't accidentally drive prod. - **Separate auth/state.** The dev instance has its own `posthog-code-dev` profile; it is not signed in just because prod is. Sign into the dev window once; its state persists. @@ -220,6 +220,6 @@ PostHog Code orchestrates the agent, so the usual loop is: **prod** (the install check the `pnpm dev:code` output. Note `pnpm dev` cannot run headlessly at all — its `phrocs` TUI needs a TTY; use `pnpm dev:code`. - **Snapshot is empty / wrong window:** you're on the wrong target. Run - `agent-browser tab` and switch to the "PostHog Code" page. + `agent-browser tab` and switch to the "PostHog" page. - **Can't type into an input:** try `agent-browser keyboard type "text"` (types at current focus) or `agent-browser keyboard inserttext "text"` to bypass key events. diff --git a/.github/workflows/code-build-test.yml b/.github/workflows/code-build-test.yml index 65821126c3..a9b68e36f4 100644 --- a/.github/workflows/code-build-test.yml +++ b/.github/workflows/code-build-test.yml @@ -114,9 +114,9 @@ jobs: MATRIX_ARCH: ${{ matrix.arch }} run: | if [[ "$MATRIX_ARCH" == "arm64" ]]; then - APP_BUNDLE="apps/code/out/mac-arm64/PostHog Code.app" + APP_BUNDLE="apps/code/out/mac-arm64/PostHog.app" else - APP_BUNDLE="apps/code/out/mac/PostHog Code.app" + APP_BUNDLE="apps/code/out/mac/PostHog.app" fi RESOURCES="$APP_BUNDLE/Contents/Resources" UNPACKED="$RESOURCES/app.asar.unpacked/node_modules" diff --git a/.github/workflows/code-discord-release.yml b/.github/workflows/code-discord-release.yml index 7b078597ec..f39397134e 100644 --- a/.github/workflows/code-discord-release.yml +++ b/.github/workflows/code-discord-release.yml @@ -1,4 +1,4 @@ -name: Release PostHog Code to Discord +name: Release PostHog to Discord on: release: diff --git a/.github/workflows/code-release.yml b/.github/workflows/code-release.yml index 82aa0be5fb..26b2597b90 100644 --- a/.github/workflows/code-release.yml +++ b/.github/workflows/code-release.yml @@ -1,4 +1,4 @@ -name: Release PostHog Code +name: Release PostHog on: push: @@ -170,9 +170,9 @@ jobs: MATRIX_ARCH: ${{ matrix.arch }} run: | if [[ "$MATRIX_ARCH" == "arm64" ]]; then - APP_BUNDLE="apps/code/out/mac-arm64/PostHog Code.app" + APP_BUNDLE="apps/code/out/mac-arm64/PostHog.app" else - APP_BUNDLE="apps/code/out/mac/PostHog Code.app" + APP_BUNDLE="apps/code/out/mac/PostHog.app" fi RESOURCES="$APP_BUNDLE/Contents/Resources" UNPACKED="$RESOURCES/app.asar.unpacked/node_modules" diff --git a/.github/workflows/code-tag.yml b/.github/workflows/code-tag.yml index 2ddd0f7fc0..db0c02d4f1 100644 --- a/.github/workflows/code-tag.yml +++ b/.github/workflows/code-tag.yml @@ -1,4 +1,4 @@ -name: Tag PostHog Code Release +name: Tag PostHog Release on: schedule: @@ -58,7 +58,7 @@ jobs: echo "$1 Skipping auto-release; the next scheduled release will pick this up." echo "authorized=false" >> "$GITHUB_OUTPUT" GH_TOKEN="$COMMENT_TOKEN" gh pr comment "$PR_NUMBER" --repo "$REPOSITORY" \ - --body "$1 Auto-release is limited to Team PostHog Code members, so this will ship with the next scheduled release instead." || true + --body "$1 Auto-release is limited to members of the team-posthog-code GitHub team, so this will ship with the next scheduled release instead." || true } LABELER=$(gh api "repos/${REPOSITORY}/issues/${PR_NUMBER}/events" --paginate \ diff --git a/.github/workflows/pr-build-installer.yml b/.github/workflows/pr-build-installer.yml index 7d3cd8e3f1..152a00a2d1 100644 --- a/.github/workflows/pr-build-installer.yml +++ b/.github/workflows/pr-build-installer.yml @@ -149,15 +149,15 @@ jobs: echo "" echo "**[⬇️ Open this run and download the \`code-macos-arm64\` artifact](${RUN_URL}#artifacts)** (Apple Silicon / M-series)." echo "" - echo "Unzip it to get the \`.dmg\`, open it, and drag **PostHog Code** into **Applications**." + echo "Unzip it to get the \`.dmg\`, open it, and drag **PostHog** into **Applications**." echo "" - echo "This build is **signed but not notarized**, so macOS quarantines it on download and Gatekeeper reports *\"PostHog Code is damaged and can't be opened\"*. That is the missing notarization, not a corrupt file — clear the quarantine flag once and it launches:" + echo "This build is **signed but not notarized**, so macOS quarantines it on download and Gatekeeper reports *\"PostHog is damaged and can't be opened\"*. That is the missing notarization, not a corrupt file — clear the quarantine flag once and it launches:" echo "" echo "\`\`\`sh" - echo "xattr -dr com.apple.quarantine \"/Applications/PostHog Code.app\"" + echo "xattr -dr com.apple.quarantine \"/Applications/PostHog.app\"" echo "\`\`\`" echo "" - echo "Then open **PostHog Code** normally. (Fully notarized, double-click-to-run builds ship only from the tagged release pipeline.)" + echo "Then open **PostHog** normally. (Fully notarized, double-click-to-run builds ship only from the tagged release pipeline.)" echo "" echo "Built from ${GITHUB_SHA} · rebuilds on each push while the \`build-installer\` label is present. Downloading requires being signed in to GitHub with repo access." } > comment-body.md diff --git a/.vscode/launch.json b/.vscode/launch.json index 0fd189afa9..e6ed8da4bf 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -2,7 +2,7 @@ "version": "0.2.0", "configurations": [ { - "name": "Debug PostHog Code (Main Process)", + "name": "Debug PostHog (Main Process)", "type": "node", "request": "attach", "port": 5858, @@ -15,7 +15,7 @@ "remoteRoot": "${workspaceFolder}" }, { - "name": "Debug PostHog Code (Renderer Process)", + "name": "Debug PostHog (Renderer Process)", "type": "chrome", "request": "attach", "port": 9222, @@ -32,10 +32,10 @@ ], "compounds": [ { - "name": "Debug PostHog Code (Main + Renderer)", + "name": "Debug PostHog (Main + Renderer)", "configurations": [ - "Debug PostHog Code (Main Process)", - "Debug PostHog Code (Renderer Process)" + "Debug PostHog (Main Process)", + "Debug PostHog (Renderer Process)" ], "preLaunchTask": "start-dev-with-debug", "stopAll": true diff --git a/AGENTS.md b/AGENTS.md index b9e3e21ac7..b8a4f5a604 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -1,10 +1,10 @@ -# PostHog Code Development Guide +# PostHog Development Guide `AGENTS.md` is the source of truth for architecture and development rules. `CLAUDE.md` is a symlink to this file. Edit this file only. ## Architecture -PostHog Code uses a layered architecture. Business logic and UI live in shared `packages/*`. Each `apps/*` host boots those packages and binds host-specific implementations. `@posthog/core` and `@posthog/ui` must run unchanged on desktop, web, and mobile. +PostHog uses a layered architecture. Business logic and UI live in shared `packages/*`. Each `apps/*` host boots those packages and binds host-specific implementations. `@posthog/core` and `@posthog/ui` must run unchanged on desktop, web, and mobile. Principle: logic is portable; hosts are thin. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index eee2126755..67588450db 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,6 +1,6 @@ -# Contributing to PostHog Code +# Contributing to PostHog -We love contributions big and small. PostHog Code is the IDE for understanding how users interact with your product -- and we want the community involved in shaping it. +We love contributions big and small. The PostHog desktop app is the IDE for understanding how users interact with your product -- and we want the community involved in shaping it. ## Getting started diff --git a/README.md b/README.md index b45eda2584..742dd8a350 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,13 @@ > [!IMPORTANT] -> Interested in PostHog Code? [Join the waitlist](https://posthog.com/code) or hop into our [Discord](https://discord.gg/aSrHKVNVdR). +> Interested in the PostHog desktop app? [Join the waitlist](https://posthog.com/code) or hop into our [Discord](https://discord.gg/aSrHKVNVdR). **[Download the latest version](https://github.com/PostHog/code/releases/latest)** Found a bug or have feedback? [Open an issue](https://github.com/PostHog/code/issues/new) on GitHub. -# PostHog Code +# PostHog -This is the monorepo for PostHog Code apps and the agent framework that powers them. +This is the monorepo for the PostHog desktop and mobile apps and the agent framework that powers them. ## Development @@ -57,7 +57,7 @@ Scripts in `scripts/` for development and debugging: | Script | Description | |--------|-------------| -| `scripts/clean-posthog-code-macos.sh` | Remove all PostHog Code app data from macOS (caches, preferences, logs, saved state). Use `--app` flag to also delete PostHog Code.app from /Applications. | +| `scripts/clean-posthog-code-macos.sh` | Remove all PostHog app data from macOS (caches, preferences, logs, saved state). Use `--app` flag to also delete PostHog.app from /Applications. | | `scripts/test-access-token.js` | Validate a PostHog OAuth access token by testing API endpoints. Usage: `node scripts/test-access-token.js [region]` | ## Project Structure @@ -83,8 +83,8 @@ posthog-code/ | [apps/mobile/README.md](./apps/mobile/README.md) | Mobile app: Expo setup, EAS builds, and TestFlight deployment | | [apps/cli/README.md](./apps/cli/README.md) | CLI: stacked PR management with Jujutsu | | [AGENTS.md](./AGENTS.md) | Architecture rules, code style, patterns, and testing guidelines (read by Claude Code, Codex, Cursor, Aider, etc.) | -| [CONTRIBUTING.md](./CONTRIBUTING.md) | How to contribute to PostHog Code | -| [docs/LOCAL-DEVELOPMENT.md](./docs/LOCAL-DEVELOPMENT.md) | Connecting PostHog Code to a local PostHog instance | +| [CONTRIBUTING.md](./CONTRIBUTING.md) | How to contribute to PostHog | +| [docs/LOCAL-DEVELOPMENT.md](./docs/LOCAL-DEVELOPMENT.md) | Connecting the desktop app to a local PostHog instance | | [docs/UPDATES.md](./docs/UPDATES.md) | Release versioning and git tagging | | [docs/TROUBLESHOOTING.md](./docs/TROUBLESHOOTING.md) | Common issues and fixes | | [docs/DEEP-LINKS.md](./docs/DEEP-LINKS.md) | `posthog-code://` deep link schemes and parameters | diff --git a/apps/code/README.md b/apps/code/README.md index aa942d5aba..9310502e27 100644 --- a/apps/code/README.md +++ b/apps/code/README.md @@ -1,6 +1,6 @@ -# PostHog Code +# PostHog -The PostHog desktop task manager +The agentic workspace for product builders ## The Goal @@ -56,8 +56,8 @@ pnpm make Output will be in: -- `out/PostHog Code-darwin-arm64/PostHog Code.app` - Packaged app -- `out/make/PostHog Code-*.dmg` - macOS installer +- `out/mac-arm64/PostHog.app` - Packaged app +- `out/PostHog-Code-*.dmg` - macOS installer - `out/make/zip/` - ZIP archives **Note:** Native modules for the DMG maker are automatically compiled via the `prePackage` hook. If you need to manually rebuild them, run: @@ -68,13 +68,13 @@ pnpm build-native ### Auto Updates & Releases -PostHog Code auto-updates on macOS and Windows. Current builds use `electron-updater`, which reads the `latest-mac.yml` and `latest.yml` manifests published with each non-draft GitHub release and downloads the matching archive. Builds made by the old Electron Forge toolchain (`v0.55.x` and earlier) take a single bridge update through the public `update.electronjs.org` service, which serves the same GitHub releases to their built-in Squirrel client, and become `electron-updater` clients from the next launch. See [docs/UPDATES.md](../../docs/UPDATES.md) and [docs/AUTO-UPDATE-TESTING.md](../../docs/AUTO-UPDATE-TESTING.md). +PostHog auto-updates on macOS and Windows. Current builds use `electron-updater`, which reads the `latest-mac.yml` and `latest.yml` manifests published with each non-draft GitHub release and downloads the matching archive. Builds made by the old Electron Forge toolchain (`v0.55.x` and earlier) take a single bridge update through the public `update.electronjs.org` service, which serves the same GitHub releases to their built-in Squirrel client, and become `electron-updater` clients from the next launch. See [docs/UPDATES.md](../../docs/UPDATES.md) and [docs/AUTO-UPDATE-TESTING.md](../../docs/AUTO-UPDATE-TESTING.md). There are three ways a release can fire: 1. **Scheduled (default)** — automatic at 17:00 and 01:00 UTC. 2. **Hotfix** — add the `Create release` label to a PR before it merges. On merge, the tag workflow runs immediately and ships whatever is on `main`. -3. **Manual** — run `Tag PostHog Code Release` via `workflow_dispatch` from the Actions tab. +3. **Manual** — run `Tag PostHog Release` via `workflow_dispatch` from the Actions tab. Local prep (only needed for one-off manual builds): @@ -123,11 +123,11 @@ SKIP_NOTARIZE=1 pnpm run make ## Workspace Configuration (posthog-code.json) -PostHog Code supports per-repository configuration through a `posthog-code.json` file. This lets you define scripts that run automatically when workspaces are created or destroyed. +PostHog supports per-repository configuration through a `posthog-code.json` file. This lets you define scripts that run automatically when workspaces are created or destroyed. ### File Locations -PostHog Code searches for configuration in this order (first match wins): +PostHog searches for configuration in this order (first match wins): 1. `.posthog-code/{workspace-name}/posthog-code.json` - Workspace-specific config 2. `posthog-code.json` - Repository root config @@ -184,7 +184,7 @@ Clean up Docker containers: ## Workspace Environment Variables -PostHog Code automatically sets environment variables in all workspace terminals and scripts. These are available in `init`, `start`, and `destroy` scripts, as well as any terminal sessions opened within a workspace. +PostHog automatically sets environment variables in all workspace terminals and scripts. These are available in `init`, `start`, and `destroy` scripts, as well as any terminal sessions opened within a workspace. | Variable | Description | Example | |----------|-------------|---------| diff --git a/apps/code/electron-builder.ts b/apps/code/electron-builder.ts index d0fd293eb3..398a904b6d 100644 --- a/apps/code/electron-builder.ts +++ b/apps/code/electron-builder.ts @@ -11,8 +11,8 @@ const skipNotarize = const config: Configuration = { // Original release bundle id; changing it breaks existing installs' data dir and Keychain entries. appId: "com.posthog.array", - productName: "PostHog Code", - executableName: "PostHog Code", + productName: "PostHog", + executableName: "PostHog", directories: { output: "out", @@ -61,7 +61,7 @@ const config: Configuration = { protocols: [ { - name: "PostHog Code", + name: "PostHog", schemes: ["posthog-code"], }, ], @@ -81,7 +81,7 @@ const config: Configuration = { // Shown in the macOS microphone-permission prompt when a user records a // custom notification sound. NSMicrophoneUsageDescription: - "PostHog Code uses the microphone to record custom notification sounds.", + "PostHog uses the microphone to record custom notification sounds.", }, notarize: !skipNotarize, }, diff --git a/apps/code/index.html b/apps/code/index.html index 4da71f1607..4fdc0f8ca9 100644 --- a/apps/code/index.html +++ b/apps/code/index.html @@ -5,7 +5,7 @@ - PostHog Code + PostHog diff --git a/apps/code/package.json b/apps/code/package.json index 37961dcd6e..d44bfd2bd3 100644 --- a/apps/code/package.json +++ b/apps/code/package.json @@ -1,8 +1,8 @@ { "name": "@posthog/code", "version": "0.0.0-dev", - "description": "PostHog Code - desktop task manager", - "homepage": "https://posthog.com", + "description": "PostHog - the agentic workspace for product builders", + "homepage": "https://posthog.com/desktop", "main": ".vite/build/bootstrap.js", "versionHash": "dynamic", "engines": { diff --git a/apps/code/scripts/dev-update/build-pair.sh b/apps/code/scripts/dev-update/build-pair.sh index c4c934afda..029ed5a74f 100644 --- a/apps/code/scripts/dev-update/build-pair.sh +++ b/apps/code/scripts/dev-update/build-pair.sh @@ -30,4 +30,4 @@ pnpm exec electron-builder build --mac zip --arm64 --publish never \ -c.extraMetadata.version="$OLD_VERSION" --config electron-builder.ts echo "==> feed=$FEED_DIR" -echo "==> app=out/mac-arm64/PostHog Code.app ($OLD_VERSION)" +echo "==> app=out/mac-arm64/PostHog.app ($OLD_VERSION)" diff --git a/apps/code/scripts/dev-update/run-from-ci-forge.sh b/apps/code/scripts/dev-update/run-from-ci-forge.sh index e8c93cf56b..b397f32088 100755 --- a/apps/code/scripts/dev-update/run-from-ci-forge.sh +++ b/apps/code/scripts/dev-update/run-from-ci-forge.sh @@ -21,8 +21,8 @@ command -v gh >/dev/null || { exit 1 } -if pgrep -x "PostHog Code" >/dev/null; then - echo "PostHog Code is already running. Quit it first; the test build shares its single-instance lock and data dir." >&2 +if pgrep -x "PostHog Code|PostHog" >/dev/null; then + echo "PostHog is already running. Quit it first; the test build shares its single-instance lock and data dir." >&2 exit 1 fi diff --git a/apps/code/scripts/dev-update/run-from-ci.sh b/apps/code/scripts/dev-update/run-from-ci.sh index 2b4ed87445..11dd69bfed 100644 --- a/apps/code/scripts/dev-update/run-from-ci.sh +++ b/apps/code/scripts/dev-update/run-from-ci.sh @@ -20,8 +20,8 @@ command -v gh >/dev/null || { exit 1 } -if pgrep -x "PostHog Code" >/dev/null; then - echo "PostHog Code is already running. Quit it first; the test build shares its single-instance lock and data dir." >&2 +if pgrep -x "PostHog Code|PostHog" >/dev/null; then + echo "PostHog is already running. Quit it first; the test build shares its single-instance lock and data dir." >&2 exit 1 fi @@ -57,7 +57,7 @@ FEED_YML="$(find "$TMP/new" -name latest-mac.yml | head -1)" echo "==> old 1.0.0 app -> out/mac-arm64" rm -rf out/mac-arm64 && mkdir -p out/mac-arm64 ditto -x -k "$OLD_ZIP" out/mac-arm64 -xattr -dr com.apple.quarantine "out/mac-arm64/PostHog Code.app" 2>/dev/null || true +xattr -dr com.apple.quarantine "out/mac-arm64/PostHog.app" 2>/dev/null || true echo "==> new 2.0.0 feed -> out/dev-update-feed" rm -rf out/dev-update-feed && mkdir -p out/dev-update-feed @@ -75,12 +75,12 @@ SERVE_PID=$! APP_LOG="out/run-from-ci-app.log" echo -echo "==> launching PostHog Code 1.0.0 (feed http://127.0.0.1:$PORT)" +echo "==> launching PostHog 1.0.0 (feed http://127.0.0.1:$PORT)" echo " In the app: open the update banner, click Download, then Restart." echo " It swaps and relaunches into 2.0.0. Quit the app (or Ctrl+C) to finish." echo " App output: $APP_LOG update log: ~/.posthog-code/logs/main.log" echo POSTHOG_E2E_UPDATE_FEED="http://127.0.0.1:$PORT" \ - "out/mac-arm64/PostHog Code.app/Contents/MacOS/PostHog Code" >"$APP_LOG" 2>&1 || true + "out/mac-arm64/PostHog.app/Contents/MacOS/PostHog" >"$APP_LOG" 2>&1 || true echo "==> app exited; cleaning up" diff --git a/apps/code/scripts/patch-electron-name.sh b/apps/code/scripts/patch-electron-name.sh index 940dbad544..a14b1f3eea 100755 --- a/apps/code/scripts/patch-electron-name.sh +++ b/apps/code/scripts/patch-electron-name.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Patches the Electron binary's Info.plist to show "Array (Development)" in the macOS menu bar +# Patches the Electron binary's Info.plist to show "PostHog (Development)" in the macOS menu bar set -e @@ -10,10 +10,10 @@ if [ ! -f "$PLIST_FILE" ]; then exit 0 fi -if /usr/libexec/PlistBuddy -c "Print :CFBundleName" "$PLIST_FILE" | grep -q "PostHog Code (Development)"; then +if /usr/libexec/PlistBuddy -c "Print :CFBundleName" "$PLIST_FILE" | grep -q "PostHog (Development)"; then exit 0 fi -/usr/libexec/PlistBuddy -c "Set :CFBundleName 'PostHog Code (Development)'" "$PLIST_FILE" -/usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName 'PostHog Code (Development)'" "$PLIST_FILE" +/usr/libexec/PlistBuddy -c "Set :CFBundleName 'PostHog (Development)'" "$PLIST_FILE" +/usr/libexec/PlistBuddy -c "Set :CFBundleDisplayName 'PostHog (Development)'" "$PLIST_FILE" /usr/libexec/PlistBuddy -c "Set :CFBundleIdentifier 'com.posthog.array.dev'" "$PLIST_FILE" diff --git a/apps/code/src/main/bootstrap.ts b/apps/code/src/main/bootstrap.ts index e025a3c5e5..f7e0eaa8f9 100644 --- a/apps/code/src/main/bootstrap.ts +++ b/apps/code/src/main/bootstrap.ts @@ -38,7 +38,7 @@ const isDev = !app.isPackaged; // Set app name for single-instance lock, crashReporter, etc const appName = isDev ? "posthog-code-dev" : "posthog-code"; -app.setName(isDev ? "PostHog Code (Development)" : "PostHog Code"); +app.setName(isDev ? "PostHog (Development)" : "PostHog"); // Set userData path for @posthog/code const appDataPath = app.getPath("appData"); diff --git a/apps/code/src/main/index.ts b/apps/code/src/main/index.ts index 6249e93ed2..4ef7e467ce 100644 --- a/apps/code/src/main/index.ts +++ b/apps/code/src/main/index.ts @@ -332,10 +332,10 @@ app.whenReady().then(async () => { ); dialog.showMessageBoxSync({ type: "warning", - title: "Move PostHog Code to Applications", - message: `PostHog Code is running from a location with read-only access:\n\n${bundleRoot}`, + title: "Move PostHog to Applications", + message: `PostHog is running from a location with read-only access:\n\n${bundleRoot}`, detail: - "After quitting, move PostHog Code to your Applications folder, then open it from there.", + "After quitting, move PostHog to your Applications folder, then open it from there.", buttons: ["Quit"], defaultId: 0, }); @@ -347,7 +347,7 @@ app.whenReady().then(async () => { const buildDate = __BUILD_DATE__ ?? "dev"; log.info( [ - `PostHog Code electron v${app.getVersion()} booting up`, + `PostHog electron v${app.getVersion()} booting up`, `Commit: ${commit}`, `Date: ${buildDate}`, `Electron: ${process.versions.electron}`, diff --git a/apps/code/src/main/menu.ts b/apps/code/src/main/menu.ts index 99e85af21f..36cf172d52 100644 --- a/apps/code/src/main/menu.ts +++ b/apps/code/src/main/menu.ts @@ -84,18 +84,18 @@ export function buildApplicationMenu(): void { function buildAppMenu(): MenuItemConstructorOptions { return { - label: "PostHog Code", + label: "PostHog", submenu: [ { - label: "About PostHog Code", + label: "About PostHog", click: () => { const info = getSystemInfo(); dialog .showMessageBox({ type: "info", - title: "About PostHog Code", - message: "PostHog Code", + title: "About PostHog", + message: "PostHog", detail: info, buttons: ["Copy", "OK"], defaultId: 1, @@ -198,7 +198,7 @@ function buildFileMenu(): MenuItemConstructorOptions { const win = BrowserWindow.getFocusedWindow(); if (!win) return; void win.webContents.executeJavaScript( - "window.__posthogCodeTest.crash()", + "window.__posthogTest.crash()", ); }, }, @@ -208,7 +208,7 @@ function buildFileMenu(): MenuItemConstructorOptions { const win = BrowserWindow.getFocusedWindow(); if (!win) return; void win.webContents.executeJavaScript( - "window.__posthogCodeTest.abort()", + "window.__posthogTest.abort()", ); }, }, diff --git a/apps/code/src/main/preload.ts b/apps/code/src/main/preload.ts index b6185c1144..67bd5bbc7d 100644 --- a/apps/code/src/main/preload.ts +++ b/apps/code/src/main/preload.ts @@ -27,10 +27,10 @@ contextBridge.exposeInMainWorld("__posthogBootstrap", { sessionId: parseSessionIdArg(process.argv), }); -contextBridge.exposeInMainWorld("__posthogCodeDevFlags", devFlags); +contextBridge.exposeInMainWorld("__posthogDevFlags", devFlags); if (process.argv.includes("--posthog-code-dev")) { - contextBridge.exposeInMainWorld("__posthogCodeTest", { + contextBridge.exposeInMainWorld("__posthogTest", { crash: () => { process.crash(); }, diff --git a/apps/code/src/main/services/discord-presence/presence-format.ts b/apps/code/src/main/services/discord-presence/presence-format.ts index 8f13167719..3c3936ced8 100644 --- a/apps/code/src/main/services/discord-presence/presence-format.ts +++ b/apps/code/src/main/services/discord-presence/presence-format.ts @@ -54,7 +54,7 @@ export function buildActivity( timestamps: { start: startedAt }, assets: { large_image: LARGE_IMAGE_KEY, - large_text: "PostHog Code", + large_text: "PostHog", small_image: agentRunning ? SMALL_IMAGE_RUNNING : SMALL_IMAGE_IDLE, small_text: smallText, }, diff --git a/apps/code/src/main/utils/linux-appimage-protocol.test.ts b/apps/code/src/main/utils/linux-appimage-protocol.test.ts index 8e11f30a1c..75aed441a0 100644 --- a/apps/code/src/main/utils/linux-appimage-protocol.test.ts +++ b/apps/code/src/main/utils/linux-appimage-protocol.test.ts @@ -101,7 +101,7 @@ describe("buildAppImageDesktopEntry", () => { expect(entry).toContain( "MimeType=x-scheme-handler/posthog-code;x-scheme-handler/twig;x-scheme-handler/array;", ); - expect(entry).toContain("Name=PostHog Code"); + expect(entry).toContain("Name=PostHog"); expect(entry.startsWith("[Desktop Entry]")).toBe(true); }); diff --git a/apps/code/src/main/utils/linux-appimage-protocol.ts b/apps/code/src/main/utils/linux-appimage-protocol.ts index 7965946956..b61ad70ad0 100644 --- a/apps/code/src/main/utils/linux-appimage-protocol.ts +++ b/apps/code/src/main/utils/linux-appimage-protocol.ts @@ -9,7 +9,7 @@ const log = logger.scope("linux-appimage-protocol"); // Stable basename for the desktop entry we write. Used both as the file name in // the applications dir and as the handler id passed to `xdg-mime default`. const DESKTOP_FILE_BASENAME = "posthog-code"; -const PRODUCT_NAME = "PostHog Code"; +const PRODUCT_NAME = "PostHog"; /** * True when the current process is a Linux AppImage. AppImage runtimes export diff --git a/apps/code/src/main/utils/macos-packaged-install-guard.test.ts b/apps/code/src/main/utils/macos-packaged-install-guard.test.ts index 49af40d9fd..a9c362f6bd 100644 --- a/apps/code/src/main/utils/macos-packaged-install-guard.test.ts +++ b/apps/code/src/main/utils/macos-packaged-install-guard.test.ts @@ -13,27 +13,27 @@ describe("isMacosAppTranslocationPath", () => { { case: "appPath is translocated", appPath: - "/private/var/folders/yf/xx/AppTranslocation/C6283C3C-9D6E-4D81-A7D5-8BA2567ED486/d/PostHog Code.app/Contents/Resources/app.asar", - exePath: "/Applications/PostHog Code.app/Contents/MacOS/PostHog Code", + "/private/var/folders/yf/xx/AppTranslocation/C6283C3C-9D6E-4D81-A7D5-8BA2567ED486/d/PostHog.app/Contents/Resources/app.asar", + exePath: "/Applications/PostHog.app/Contents/MacOS/PostHog", expected: true, }, { case: "exePath is translocated", - appPath: "/Applications/PostHog Code.app/Contents/Resources/app.asar", + appPath: "/Applications/PostHog.app/Contents/Resources/app.asar", exePath: - "/private/var/folders/yf/xx/AppTranslocation/C6283C3C/d/PostHog Code.app/Contents/MacOS/PostHog Code", + "/private/var/folders/yf/xx/AppTranslocation/C6283C3C/d/PostHog.app/Contents/MacOS/PostHog", expected: true, }, { case: "neither path is translocated (/Applications)", - appPath: "/Applications/PostHog Code.app/Contents/Resources/app.asar", - exePath: "/Applications/PostHog Code.app/Contents/MacOS/PostHog Code", + appPath: "/Applications/PostHog.app/Contents/Resources/app.asar", + exePath: "/Applications/PostHog.app/Contents/MacOS/PostHog", expected: false, }, { case: "neither path is translocated (/Users)", - appPath: "/Users/dev/PostHog Code.app/Contents/Resources/app.asar", - exePath: "/Users/dev/PostHog Code.app/Contents/MacOS/PostHog Code", + appPath: "/Users/dev/PostHog.app/Contents/Resources/app.asar", + exePath: "/Users/dev/PostHog.app/Contents/MacOS/PostHog", expected: false, }, ])("$case → $expected", ({ appPath, exePath, expected }) => { @@ -107,13 +107,13 @@ describe("isMacosPathOnReadOnlyNonRootMountFromTable", () => { { case: "read-only non-root volume", table: baseTable, - path: "/Volumes/ReadOnlyVol/PostHog Code.app/Contents/MacOS/PostHog Code", + path: "/Volumes/ReadOnlyVol/PostHog.app/Contents/MacOS/PostHog", expected: true, }, { case: "writable non-root volume", table: baseTable, - path: "/Volumes/Writable/out/PostHog Code.app/Contents/MacOS/PostHog Code", + path: "/Volumes/Writable/out/PostHog.app/Contents/MacOS/PostHog", expected: false, }, { @@ -154,33 +154,29 @@ describe("isMacosPackagedUnsafeBundleLocation", () => { { case: "translocated bundle", appPath: - "/private/var/.../AppTranslocation/UUID/d/PostHog Code.app/Contents/Resources/app.asar", - exePath: "/Applications/PostHog Code.app/Contents/MacOS/PostHog Code", + "/private/var/.../AppTranslocation/UUID/d/PostHog.app/Contents/Resources/app.asar", + exePath: "/Applications/PostHog.app/Contents/MacOS/PostHog", readMountTable: () => writableMountTable, expected: true, }, { case: "ordinary non-translocated path on a writable mount", - appPath: - "/Volumes/build/out/PostHog Code.app/Contents/Resources/app.asar", - exePath: - "/Volumes/build/out/PostHog Code.app/Contents/MacOS/PostHog Code", + appPath: "/Volumes/build/out/PostHog.app/Contents/Resources/app.asar", + exePath: "/Volumes/build/out/PostHog.app/Contents/MacOS/PostHog", readMountTable: () => writableMountTable, expected: false, }, { case: "bundle on a read-only non-root volume", - appPath: - "/Volumes/ReadOnlyVol/PostHog Code.app/Contents/Resources/app.asar", - exePath: - "/Volumes/ReadOnlyVol/PostHog Code.app/Contents/MacOS/PostHog Code", + appPath: "/Volumes/ReadOnlyVol/PostHog.app/Contents/Resources/app.asar", + exePath: "/Volumes/ReadOnlyVol/PostHog.app/Contents/MacOS/PostHog", readMountTable: () => readOnlyMountTable, expected: true, }, { case: "mount table cannot be read (degrade to non-blocking)", - appPath: "/Applications/PostHog Code.app/Contents/Resources/app.asar", - exePath: "/Applications/PostHog Code.app/Contents/MacOS/PostHog Code", + appPath: "/Applications/PostHog.app/Contents/Resources/app.asar", + exePath: "/Applications/PostHog.app/Contents/MacOS/PostHog", readMountTable: () => null, expected: false, }, @@ -193,8 +189,8 @@ describe("isMacosPackagedUnsafeBundleLocation", () => { it("short-circuits on translocation without reading the mount table", () => { const readMountTable = vi.fn(() => writableMountTable); isMacosPackagedUnsafeBundleLocation( - "/private/var/.../AppTranslocation/UUID/d/PostHog Code.app/Contents/Resources/app.asar", - "/Applications/PostHog Code.app/Contents/MacOS/PostHog Code", + "/private/var/.../AppTranslocation/UUID/d/PostHog.app/Contents/Resources/app.asar", + "/Applications/PostHog.app/Contents/MacOS/PostHog", readMountTable, ); expect(readMountTable).not.toHaveBeenCalled(); diff --git a/apps/code/src/renderer/components/BootErrorBoundary.test.tsx b/apps/code/src/renderer/components/BootErrorBoundary.test.tsx index 6ba04b9332..f26b1ff190 100644 --- a/apps/code/src/renderer/components/BootErrorBoundary.test.tsx +++ b/apps/code/src/renderer/components/BootErrorBoundary.test.tsx @@ -33,9 +33,7 @@ describe("BootErrorScreen", () => { render(); expect(screen.getByRole("alert")).toBeInTheDocument(); - expect( - screen.getByText("PostHog Code failed to start"), - ).toBeInTheDocument(); + expect(screen.getByText("PostHog failed to start")).toBeInTheDocument(); expect(screen.getByText("kaboom")).toBeInTheDocument(); }); diff --git a/apps/code/src/renderer/components/BootErrorBoundary.tsx b/apps/code/src/renderer/components/BootErrorBoundary.tsx index fb20433b1d..3e95cce0ef 100644 --- a/apps/code/src/renderer/components/BootErrorBoundary.tsx +++ b/apps/code/src/renderer/components/BootErrorBoundary.tsx @@ -57,7 +57,7 @@ export function BootErrorScreen({ error }: { error: unknown }) { const message = error instanceof Error ? error.message : String(error); return (
-

PostHog Code failed to start

+

PostHog failed to start

{message}