Skip to content

feat(code): add channel share link interstitial for posthog code#68479

Merged
k11kirky merged 2 commits into
masterfrom
posthog-code/code-channel-link-interstitial
Jul 7, 2026
Merged

feat(code): add channel share link interstitial for posthog code#68479
k11kirky merged 2 commits into
masterfrom
posthog-code/code-channel-link-interstitial

Conversation

@k11kirky

@k11kirky k11kirky commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

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

  • New CodeChannelLink scene (unauthenticated, app-raw, same folder as CodeCanvasLink) serving /code/channel/:channelId and /code/channel/:channelId/tasks/:taskId. On mount it fires posthog-code(-dev)://channel/<channelId>[/tasks/<taskId>] into the desktop app, with a manual "Open in PostHog Code" button and a download link as fallback.
  • Extracted the DESKTOP_SCHEME constant into desktopScheme.ts, now shared by both interstitials instead of duplicated.

How did you test this code?

  • Structural mirror of the existing CodeCanvasLink scene with the same registry wiring (sceneTypes, sceneConfigurations, routes, appScenes, urls).
  • Agent limitations: this session had a sparse checkout without node_modules, so typescript:check, format, and ci:preflight were 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

  • Publish to changelog?
  • Alert Sales and Marketing teams?

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_SCHEME constant.


Created with PostHog Code

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
@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Hey @k11kirky! 👋

It looks like your git author email on this PR isn't your @posthog.com address (k11kirky@gmail.com). Since you're on the PostHog team, it's worth pointing your local git author email at your @posthog.com address. Why it matters:

  • Consistent work identity in git history — internal tooling that attributes commits to team members keys off your @posthog.com address.
  • Keeps team contributions easy to tell apart from external community ones when scanning history.

You can fix it for this repo with:

git config user.email "you@posthog.com"

Or set it globally with git config --global user.email "you@posthog.com". No need to redo this PR — just a nudge for next time. 🙂

@greptile-apps

greptile-apps Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(code): add channel share link inter..." | Re-trigger Greptile

@github-actions

github-actions Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

🤖 CI report

⚠️ Bundle size — 🔺 +2.7 KiB (+0.0%)

Uncompressed size of every built .js bundle, compared against the base branch.

Total: 76.93 MiB · 🔺 +2.7 KiB (+0.0%)

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%)

Playwright — all passed

All tests passed.

View test results →

@k11kirky k11kirky marked this pull request as ready for review July 7, 2026 12:58
@trunk-io

trunk-io Bot commented Jul 7, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic BadgeStatic Badge

View Full Report ↗︎Docs

@k11kirky k11kirky merged commit f52f124 into master Jul 7, 2026
262 of 266 checks passed
@k11kirky k11kirky deleted the posthog-code/code-channel-link-interstitial branch July 7, 2026 13:40
@deployment-status-posthog

deployment-status-posthog Bot commented Jul 7, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-07-07 14:16 UTC Run
prod-us ✅ Deployed 2026-07-07 14:42 UTC Run
prod-eu ✅ Deployed 2026-07-07 14:54 UTC Run

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