Skip to content

feat(inbox): Source product icons, PR badges, and rendering improvements#1755

Merged
Twixes merged 5 commits intomainfrom
twixes/report-pr-rendering
Apr 22, 2026
Merged

feat(inbox): Source product icons, PR badges, and rendering improvements#1755
Twixes merged 5 commits intomainfrom
twixes/report-pr-rendering

Conversation

@Twixes
Copy link
Copy Markdown
Member

@Twixes Twixes commented Apr 21, 2026

Problem

The report list in Code lacked indication for source products and PR status. Users couldn't quickly identify what type of signal initiated a report or whether a PR already exists. Some of the spacing was rough too, and we were losing a lot of info due to truncated headings or description.

Screenshot 2026-04-21 at 18 58 42@2x

Changes

Screenshot 2026-04-21 at 17 45 08@2x

A few things (as summarized by Claude):

  • Source product icon: Replace generic FileTextIcon with colored source product icon (from SOURCE_PRODUCT_META) in report list rows, with tooltip "Report initiated by a signal from X"
  • PR badge in list: Show a mini PR badge pill in ReportCardContent when implementation_pr_url is set, with merged/closed/open color states via usePrDetails
  • PR badge in task bar: Move the PR badge from the detail header into the implementation task bar, showing "Create PR" / "Working on a PR…" / PR link badge depending on state
  • Clean up detail header: Remove PR badge, implementationPrUrl state, and onPrUrlChange callback from ReportDetailPane
  • Layout polish: Tighter list row spacing, improved summary markdown rendering (single-line, 12px font normalization)

Backend companion: PostHog/posthog#55464

How did you test this code?

Recorded a demo.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 21, 2026

Prompt To Fix All With AI
This is a comment left during a code review.
Path: apps/code/src/renderer/features/inbox/components/utils/ReportCardContent.tsx
Line: 80-82

Comment:
**Per-row `usePrDetails` calls in the list**

`ReportImplementationPrLink` calls `usePrDetails` (a tRPC + GitHub fetch) for every list row that has an `implementation_pr_url`. Previously this hook was only triggered when a single detail pane was open. With a list of N reports that all have PRs, this fires N parallel queries on mount. React Query's 60 s `staleTime` prevents re-fetching for cached URLs, but the cold-load burst could saturate the GitHub API or the main-process queue. Consider lazy-loading PR status only when a row is visible (e.g. via an `IntersectionObserver` or a separate hover-to-load trigger).

How can I resolve this? If you propose a fix, please make it concise.

---

This is a comment left during a code review.
Path: apps/code/src/renderer/features/inbox/components/list/ReportListRow.tsx
Line: 9-28

Comment:
**Multi-product tooltip implies single source**

When `sourceProducts` has more than one entry, only the first is used, and the tooltip reads "Report initiated by a signal from X" — implying a single source. If a report legitimately aggregates signals from multiple products, the icon and tooltip silently drop the rest. Either show a generic icon with an aggregate tooltip (e.g. "…from Product Analytics, Session Replay") or document that only the primary product is surfaced here.

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "feat(inbox): source product icons, PR ba..." | Re-trigger Greptile

@Twixes Twixes force-pushed the twixes/report-pr-rendering branch from 5505938 to 0765488 Compare April 21, 2026 15:45
@Twixes Twixes changed the title feat(inbox): source product icons, PR badges, and rendering improvements feat(inbox): Source product icons, PR badges, and rendering improvements Apr 21, 2026
@Twixes Twixes force-pushed the twixes/report-pr-rendering branch 2 times, most recently from fcb4bdf to 20c2118 Compare April 21, 2026 16:36
…nts in report list

- Show source product icon (with tooltip) in report list rows
- Show mini PR badge in report list when implementation_pr_url is set
- Move PR badge from detail header to implementation task bar
- Show "Working on a PR…" when implementation task is in progress
- Extract ReportImplementationPrLink component with merged/closed states
- Add source_products and implementation_pr_url to SignalReport type
- Tighter list row layout, improved summary markdown rendering

Depends on PostHog/posthog#55464 for backend source_products and implementation_pr_url fields.
Copy link
Copy Markdown
Contributor

@joshsny joshsny left a comment

Choose a reason for hiding this comment

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

Nice! 🚢🚢

? "bg-red-4 text-red-11 hover:bg-red-5"
: "bg-green-4 text-green-11 hover:bg-green-5";

const tooltip = merged
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.

Should we give this some kinda styling or something nice to go see the link?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

We could make it a bit nicer. The button itself is already a link, so just visuals here. @cursoragent Make this tooltip show the PR in the format org/repo#pr_number, e.g. PostHog/posthog#2323

cursoragent and others added 4 commits April 22, 2026 09:40
Co-authored-by: Michael Matloka <dev@twixes.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
Co-authored-by: Michael Matloka <dev@twixes.com>
Twixes added a commit to PostHog/posthog that referenced this pull request Apr 22, 2026
…ability ordering to reports (#55464)

## Problem

The signal reports API lacks metadata needed by PostHog Code to show source product icons and PR badges in the inbox list, and the inbox ordering doesn't distinguish between actionable and not-actionable ready reports.

## Changes

As summarized by Claude:

- Added `source_products` field to `SignalReportSerializer` — batch-fetched from ClickHouse per page via `fetch_source_products_for_reports()`
- Added `implementation_pr_url` field — annotated via correlated subquery through `SignalReportTask` → `Task` → `TaskRun` → `output->'pr_url'`
- Split ready status ordering by actionability: rank 0 = actionable (or no judgment), rank 1 = not_actionable
- Suppressed `is_suggested_reviewer` for not_actionable reports
- Extracted `_Q_READY_NOT_ACTIONABLE` shared constant to avoid duplicate Q expressions
- Dropped legacy `choice` fallback in serializer (only `actionability` key is read now)
- Passed serializer context in the `signals` detail action

See what this looks like in the Code app in the companion PR: PostHog/code#1755


## How did you test this code?

Bunch of tests.

## Publish to changelog?

No
@Twixes Twixes merged commit 723c58c into main Apr 22, 2026
15 checks passed
@Twixes Twixes deleted the twixes/report-pr-rendering branch April 22, 2026 13:23
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.

4 participants