Skip to content

feat(inbox): Add slug suffix to inbox report deep links#2298

Open
Twixes wants to merge 1 commit into
mainfrom
feat/inbox-deeplink-slug
Open

feat(inbox): Add slug suffix to inbox report deep links#2298
Twixes wants to merge 1 commit into
mainfrom
feat/inbox-deeplink-slug

Conversation

@Twixes
Copy link
Copy Markdown
Member

@Twixes Twixes commented May 22, 2026

Problem

People are sharing PostHog Code inbox links like posthog-code://inbox/01928f7a-… - problem is the link tells you nothing about what's on the other side. When pasted into Slack, a PR, or a doc, the recipient has no signal whether the link is worth clicking.

Changes

Deep links now include a human-readable slug of the report title after the UUID, like Graphite PRs:

posthog-code://inbox/<uuid>/fix-inbox--Add-foo

The slug is cosmetic-only, and slug-less are links are supported as always. (Did not test if slugful links work on older PH Code, likely not).

Slugification rules:

  • Accented Latin folded to ASCII (cafécafe) via NFD normalization
  • Letters, digits, and URL-unreserved punctuation (_ . ~) kept verbatim, case preserved
  • Runs of other characters collapse to a single -, except runs that mix a colon with other unsafe chars collapse to -- (so the title-like break in fix(inbox): Add foo reads as fix-inbox--Add-foo)

Updated the "Copy link" button to use this.

How did you test this?

Very pleasant to unit-test the slugification, it's now in apps/code/src/shared/deeplink.test.ts. Also updated buildDiscussReportPrompt.test.ts. Finally, clicked around manually.

Publish to changelog?

Yes - PostHog Inbox sharing links now include human-readable titles for easy sharing.

Sharable deep links now include a human-readable slug of the report
title after the UUID — e.g. `posthog-code://inbox/<uuid>/fix-inbox--Add-foo`.
The slug is purely cosmetic; the receiver only reads the UUID, so the
suffix is ignored at runtime.
@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 22, 2026

Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
apps/code/src/shared/deeplink.test.ts:7-71
**Prefer parameterised tests**

Several blocks in this file bundle multiple distinct input→output cases into a single `it` (e.g. `null`/`undefined`/`""` in "returns just the UUID when no title is given" at lines 7–15, and `":::"` / `"   "` in "omits the slug when the title slugifies to empty" at lines 32–40). The whole suite is essentially a table of `(title, expectedSlug)` pairs, which is exactly what `it.each` is designed for. A single parameterised block would make adding further cases trivial and give each case its own labelled failure message.

Reviews (1): Last reviewed commit: "feat(inbox): add slug suffix to inbox re..." | Re-trigger Greptile

Comment thread apps/code/src/shared/deeplink.test.ts
@Twixes Twixes changed the title feat(inbox): add slug suffix to inbox report deep links feat(inbox): Add slug suffix to inbox report deep links May 22, 2026
@adboio
Copy link
Copy Markdown
Contributor

adboio commented May 22, 2026

if the goal is better human-readable, i have two thoughts:

  1. can we just remove the UUID entirely? like posthog-code://inbox/fix-inbox--Add-foo - maybe scope it with a short ID for project/user/etc if needed
  2. are there plans to have web links for sharing these? e.g. we just added https://posthog.com/code/open yesterday which deeplinks to the app, and falls back to a download msg. maybe we could link to us.posthog.com/inbox/task-slug or something and that'd deeplink to phc, or show the task in web as a fallback, idk ?

@Twixes
Copy link
Copy Markdown
Member Author

Twixes commented May 22, 2026

Hmm, I don't think we can drop the UUID. Well, perhaps the thing is a UUID is too verbose here, and a serial ID would in fact be better (words I never thought I'd say). Then, posthog.com/code/open makes perfect sense. I'll actually move the logic there.

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.

3 participants