feat(code): add channel share link interstitial for posthog code#68479
Conversation
Adds an unauthenticated bridge scene for /code/channel/<channelId> and /code/channel/<channelId>/tasks/<taskId> share links, mirroring the existing CodeCanvasLink interstitial: on mount it fires the posthog-code(-dev):// scheme into the desktop app, with a manual open button and download link as fallback. Extracts the shared DESKTOP_SCHEME constant used by both interstitials. Generated-By: PostHog Code Task-Id: b60d15a7-ac68-4869-bb42-55e66943823a
|
Hey @k11kirky! 👋 It looks like your git author email on this PR isn't your
You can fix it for this repo with: git config user.email "you@posthog.com"Or set it globally with |
|
Reviews (1): Last reviewed commit: "feat(code): add channel share link inter..." | Re-trigger Greptile |
🤖 CI report
|
| File | Size | Δ vs base |
|---|---|---|
posthog-app/src/scenes/code-canvas/CodeChannelLink.js |
2.0 KiB | 🔺 +2.0 KiB (new) |
Posted automatically by build-bundle-size-report · uncompressed bytes from dist-report
✅ Eager graph — within budget
How much code each root ships on the eager path — downloaded and parsed before the surface is interactive. Measured from the esbuild output chunks (post-tree-shake, static imports only); lazy import() / React.lazy chunks are not counted.
| Root | Eager (shipped) | Δ vs base | Budget |
|---|---|---|---|
entry (logged-out pages, app bootstrap)src/index.tsx |
1.20 MiB · 22 files | no change | ███░░░░░░░ 28.0% of 4.29 MiB |
authenticated shell (every logged-in page)src/scenes/AuthenticatedShell.tsx |
11.58 MiB · 2,950 files | 🔺 +284 B (+0.0%) | █████████░ 89.9% of 12.87 MiB |
🟢 node_modules/monaco-editor/ stays out of src/index.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/index.tsx
🟢 node_modules/monaco-editor/ stays out of src/scenes/AuthenticatedShell.tsx
🟢 src/lib/components/ActivityLog/describers stays out of src/scenes/AuthenticatedShell.tsx
Largest files eagerly shipped from src/index.tsx
| Size | File |
|---|---|
| 126.8 KiB | ../node_modules/.pnpm/react-dom@18.3.1_react@18.3.1/node_modules/react-dom/cjs/react-dom.production.min.js |
| 24.6 KiB | ../node_modules/.pnpm/buffer@6.0.3/node_modules/buffer/index.js |
| 6.3 KiB | ../node_modules/.pnpm/react@18.3.1/node_modules/react/cjs/react.production.min.js |
| 4.5 KiB | ../node_modules/.pnpm/@jspm+core@2.1.0/node_modules/@jspm/core/nodelibs/browser/process.js |
| 3.9 KiB | ../node_modules/.pnpm/scheduler@0.23.2/node_modules/scheduler/cjs/scheduler.production.min.js |
| 1.4 KiB | ../node_modules/.pnpm/base64-js@1.5.1/node_modules/base64-js/index.js |
| 1.3 KiB | src/RootErrorBoundary.tsx |
| 912 B | ../node_modules/.pnpm/ieee754@1.2.1/node_modules/ieee754/index.js |
| 789 B | src/scenes/ChunkLoadErrorBoundary.tsx |
| 668 B | src/index.tsx |
Largest files eagerly shipped from src/scenes/AuthenticatedShell.tsx
| Size | File |
|---|---|
| 458.3 KiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/driving-hogzilla.mjs |
| 302.9 KiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/coffee-run.mjs |
| 275.2 KiB | ../node_modules/.pnpm/posthog-js@1.398.0/node_modules/posthog-js/dist/rrweb.js |
| 266.9 KiB | ../node_modules/.pnpm/@posthog+icons@0.37.4_react-dom@18.3.1_react@18.3.1__react@18.3.1/node_modules/@posthog/icons/dist/posthog-icons.es.js |
| 253.2 KiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/chart-hog.mjs |
| 239.2 KiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/x-ray.mjs |
| 224.6 KiB | src/taxonomy/core-filter-definitions-by-group.json |
| 213.1 KiB | ../node_modules/.pnpm/posthog-js@1.398.0/node_modules/posthog-js/dist/module.js |
| 211.6 KiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/money.mjs |
| 185.9 KiB | ../node_modules/.pnpm/@posthog+brand@0.3.0_react@18.3.1/node_modules/@posthog/brand/dist/generated/hoggies/svg/hogpatch.mjs |
Posted automatically by check-eager-graph · sizes are eager output bytes (shipped, post-tree-shake) from the esbuild metafile · part of #32479
✅ Dist folder size — 🟢 -352.84 MiB (-19.4%)
Total size of the built frontend/dist folder (all assets), compared against the base branch.
Total: 1469.08 MiB · 🟢 -352.84 MiB (-19.4%)
Problem
PostHog Code is adding "Copy link" sharing for Channels-space channels and the threads inside them (PostHog/code#3157). Like canvas share links, these are https links so they work for recipients without the desktop app — but that requires a web interstitial on Cloud to bridge into the
posthog-code://scheme, and only/code/canvas/...had one.Changes
CodeChannelLinkscene (unauthenticated,app-raw, same folder asCodeCanvasLink) serving/code/channel/:channelIdand/code/channel/:channelId/tasks/:taskId. On mount it firesposthog-code(-dev)://channel/<channelId>[/tasks/<taskId>]into the desktop app, with a manual "Open in PostHog Code" button and a download link as fallback.DESKTOP_SCHEMEconstant intodesktopScheme.ts, now shared by both interstitials instead of duplicated.How did you test this code?
CodeCanvasLinkscene with the same registry wiring (sceneTypes, sceneConfigurations, routes, appScenes, urls).typescript:check,format, andci:preflightwere not run locally — please rely on CI for those. No automated tests added: the sibling canvas interstitial has none, and the scene is a static redirect page with no logic beyond URL construction.Automatic notifications
Docs update
N/A — the deep-link format is documented in the PostHog/code repo (
docs/DEEP-LINKS.md) alongside the handler.🤖 Agent context
Autonomy: Human-driven (agent-assisted)
Authored with PostHog Code (Claude) from a project-bluebird channel task requesting shareable channel/thread links. The agent followed the established canvas share-link precedent: desktop-side scheme handler and copy affordances live in PostHog/code#3157; this PR is the Cloud bridge. A generic path-forwarding interstitial was considered and rejected in favor of mirroring the existing per-surface scene, which keeps route params validated per link type. A /simplify review pass extracted the previously duplicated
DESKTOP_SCHEMEconstant.Created with PostHog Code