Skip to content

feat(inbox): choose where copied report links open - #94641

Merged
trunk-io[bot] merged 1 commit into
masterfrom
posthog/inbox-copy-link-destinations
Sep 4, 2026
Merged

feat(inbox): choose where copied report links open#94641
trunk-io[bot] merged 1 commit into
masterfrom
posthog/inbox-copy-link-destinations

Conversation

@dmarticus

Copy link
Copy Markdown
Contributor

Problem

Desktop Inbox users cannot choose whether a copied report link opens in the web app or Desktop.

Changes

  • Copy link now opens a menu with web and Desktop choices.
  • Web links remain safe to share. Desktop links use the existing app scheme.

Closed:

inbox-copy-link-closed

Open:

inbox-copy-link-open

How did you test this code?

Added coverage for both choices and confirmed that each writes the correct URL. Rendered the closed and open Storybook states and checked both labels.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Automatic notifications

  • Publish to changelog?

Docs update

Updated the Desktop deep-link guide.

🤖 Agent context

Autonomy: Human-driven (agent-assisted)

Codex used the desktop, UI component, user-facing copy, test, Storybook, and PR-description skills. The screenshots contain only invented Storybook data.


Created with PostHog Desktop

Generated-By: PostHog Desktop
Task-Id: b7983659-f165-4371-813c-e2b93acc5699
@dmarticus dmarticus self-assigned this Sep 3, 2026
@trunk-io

trunk-io Bot commented Sep 3, 2026

Copy link
Copy Markdown

😎 Merged successfully - details.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 46530d7.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🤖 CI report

Trunk lane — non-backend lane

This PR is assigned to the non-backend lane. It does not run backend Python tests and may merge in parallel with PRs in other lanes.

@hosthog

hosthog Bot commented Sep 3, 2026

Copy link
Copy Markdown

HostHog preview — posthog-desktop-web

The previews for this PR have been torn down and no longer serve.

@dmarticus
dmarticus marked this pull request as ready for review September 3, 2026 22:55
@pr-assigner-resolver-posthog
pr-assigner-resolver-posthog Bot requested a review from a team September 3, 2026 22:55
@greptile-apps

greptile-apps Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor
Prompt To Fix All With AI
### Issue 1
products/desktop/packages/ui/src/features/inbox/utils/copyInboxReportLink.ts:15
**Use the registered protocol**

In the supported `package:dev` build, `FORCE_DEV_MODE` makes `import.meta.env.DEV` true, but the packaged main process registers and accepts only `posthog-code://`. This line therefore copies a `posthog-code-dev://` URL that cannot reopen the report. Derive the scheme from the same packaged-build state used for protocol registration.

### Issue 2
products/desktop/packages/ui/src/features/inbox/components/InboxReportCopyLinkMenu.tsx:17-20
**Add the return type**

This new exported React component has no explicit return type. The repository requires explicit return types for frontend TypeScript, so this requirement must be satisfied before merging.

```suggestion
export function InboxReportCopyLinkMenu({
  report,
  trigger,
}: InboxReportCopyLinkMenuProps): ReactElement {
```

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Reviews (1): Last reviewed commit: "feat(inbox): let users choose report lin..." | Re-trigger Greptile

const url =
target === "desktop"
? buildInboxDeeplink(report.id, report.title, {
isDevBuild: import.meta.env.DEV,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P1 Use the registered protocol

In the supported package:dev build, FORCE_DEV_MODE makes import.meta.env.DEV true, but the packaged main process registers and accepts only posthog-code://. This line therefore copies a posthog-code-dev:// URL that cannot reopen the report. Derive the scheme from the same packaged-build state used for protocol registration.

Prompt To Fix With AI
This is a comment left during a code review.
Path: products/desktop/packages/ui/src/features/inbox/utils/copyInboxReportLink.ts
Line: 15

Comment:
**Use the registered protocol**

In the supported `package:dev` build, `FORCE_DEV_MODE` makes `import.meta.env.DEV` true, but the packaged main process registers and accepts only `posthog-code://`. This line therefore copies a `posthog-code-dev://` URL that cannot reopen the report. Derive the scheme from the same packaged-build state used for protocol registration.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Comment on lines +17 to +20
export function InboxReportCopyLinkMenu({
report,
trigger,
}: InboxReportCopyLinkMenuProps) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

P2 Add the return type

This new exported React component has no explicit return type. The repository requires explicit return types for frontend TypeScript, so this requirement must be satisfied before merging.

Suggested change
export function InboxReportCopyLinkMenu({
report,
trigger,
}: InboxReportCopyLinkMenuProps) {
export function InboxReportCopyLinkMenu({
report,
trigger,
}: InboxReportCopyLinkMenuProps): ReactElement {

Context Used: AGENTS.MD (source)

Prompt To Fix With AI
This is a comment left during a code review.
Path: products/desktop/packages/ui/src/features/inbox/components/InboxReportCopyLinkMenu.tsx
Line: 17-20

Comment:
**Add the return type**

This new exported React component has no explicit return type. The repository requires explicit return types for frontend TypeScript, so this requirement must be satisfied before merging.

```suggestion
export function InboxReportCopyLinkMenu({
  report,
  trigger,
}: InboxReportCopyLinkMenuProps): ReactElement {
```

**Context Used:** AGENTS.MD ([source](https://github.com/posthog/posthog/blob/master/AGENTS.MD))

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!

@dmarticus dmarticus added the feature/desktop Feature Tag: Desktop label Sep 3, 2026
@trunk-io
trunk-io Bot merged commit 8e05a64 into master Sep 4, 2026
320 checks passed
@trunk-io
trunk-io Bot deleted the posthog/inbox-copy-link-destinations branch September 4, 2026 17:09
@deployment-status-posthog

deployment-status-posthog Bot commented Sep 4, 2026

Copy link
Copy Markdown

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-09-04 17:29 UTC Run
prod-us ✅ Deployed 2026-09-04 17:43 UTC Run
prod-eu ✅ Deployed 2026-09-04 17:43 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature/desktop Feature Tag: Desktop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants