feat(inbox): choose where copied report links open - #94641
Conversation
Generated-By: PostHog Desktop Task-Id: b7983659-f165-4371-813c-e2b93acc5699
|
😎 Merged successfully - details. |
|
React Doctor found no issues in the changed files. 🎉 Reviewed by React Doctor for commit |
🤖 CI report✅ Trunk lane — non-backend laneThis 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 preview —
|
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, |
There was a problem hiding this comment.
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.| export function InboxReportCopyLinkMenu({ | ||
| report, | ||
| trigger, | ||
| }: InboxReportCopyLinkMenuProps) { |
There was a problem hiding this comment.
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.
| 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!
Problem
Desktop Inbox users cannot choose whether a copied report link opens in the web app or Desktop.
Changes
Closed:
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
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