Skip to content

feat(inbox): surface resolved reports in the Archive tab#2810

Open
andrewm4894 wants to merge 3 commits into
mainfrom
feat/inbox-archive-resolved-reports
Open

feat(inbox): surface resolved reports in the Archive tab#2810
andrewm4894 wants to merge 3 commits into
mainfrom
feat/inbox-archive-resolved-reports

Conversation

@andrewm4894

Copy link
Copy Markdown
Member

Problem

When a signal report is completed — its implementation PR merged — it transitions to the terminal resolved status and vanishes from the inbox entirely. There's no tab or filter that surfaces resolved reports, so there's no way to see or track completed work from the app.

This mirrors the same gap in the PostHog Cloud web inbox, fixed in PostHog/posthog#65040.

Changes

Resolved reports now appear in the existing Archive tab (route /code/inbox/dismissed) alongside dismissed (suppressed) ones — reusing the tab built for terminal reports rather than adding a new surface.

  • Added resolved to the SignalReportStatus type (it didn't exist yet in this repo).
  • Archive tab filter now fetches both terminal states (status=suppressed,resolved) instead of just suppressed; resolved is added to INBOX_EXCLUDED_STATUSES so it's treated as out-of-inbox everywhere else (counts, scope), and isDismissedReport now matches it.
  • Resolved cards are reference-only: no Restore action (resolving is terminal — nothing to restore), and they show a green Resolved badge with a "Resolved {date}" label instead of the dismissal-reason chip.
  • Detail view renders no actions for a resolved report, instead of the inapplicable Discuss / Create PR buttons.
  • Added Resolved labels, accent color, and badge variant/tooltip for the new status; updated the Archive empty-state copy and the inbox CLAUDE.md.

This is desktop-only — the mobile inbox is intentionally out of scope.

No backend changes — the list API already accepts status=suppressed,resolved and serves these reports on the read paths the Archive tab uses.

How did you test this?

I'm an agent (Claude Code). I did not manually exercise the running desktop app. Verification was automated + by inspection:

  • pnpm --filter @posthog/core test — all 1617 tests pass, including updated isDismissedReport / isExcludedFromInbox cases covering resolved.
  • pnpm --filter @posthog/core typecheck and @posthog/ui typecheck — no errors in any touched file. (The repo's pnpm typecheck has pre-existing failures on main in unrelated files — canvas/WebsiteLayout.tsx, code-review/InteractiveFileDiff.tsx — confirmed present on a clean tree with these changes stashed; the pre-commit hook was bypassed for that reason.)
  • biome check --write run on all changed files.

Manual smoke-testing of the Archive tab and a resolved report's detail view by a reviewer would be worthwhile.

Automatic notifications

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

@andrewm4894 andrewm4894 self-assigned this Jun 20, 2026
@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit c099519.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5aae536d8c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/features/inbox/components/ReportCard.tsx
Comment thread packages/core/src/inbox/reportFiltering.ts
Comment thread packages/core/src/inbox/reportFiltering.ts
@greptile-apps

greptile-apps Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Comments Outside Diff (2)

  1. packages/core/src/inbox/reportMembership.test.ts, line 163-177 (link)

    P2 Inline multi-assertion instead of parameterised test

    The three isExcludedFromInbox true-cases are asserted sequentially inside a single it block. The isDismissedReport block above was correctly updated to it.each in this PR, but this sibling test was left non-parameterised. Per the codebase convention, prefer it.each here too so each status gets an independent test result in the runner output.

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: packages/core/src/inbox/reportMembership.test.ts
    Line: 163-177
    
    Comment:
    **Inline multi-assertion instead of parameterised test**
    
    The three `isExcludedFromInbox` true-cases are asserted sequentially inside a single `it` block. The `isDismissedReport` block above was correctly updated to `it.each` in this PR, but this sibling test was left non-parameterised. Per the codebase convention, prefer `it.each` here too so each status gets an independent test result in the runner output.
    
    How can I resolve this? If you propose a fix, please make it concise.

    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!

  2. packages/core/src/inbox/statusLabels.ts, line 1-26 (link)

    P2 Duplicated inboxStatusLabel — OnceAndOnlyOnce

    packages/core/src/inbox/statusLabels.ts and packages/core/src/inbox/reportPresentation.ts both export an identical inboxStatusLabel switch. This PR adds resolved to both, which is the second time the same new case has had to be applied to two files. Each future status addition will need to be kept in sync across both files. Consider consolidating into one source of truth (either remove statusLabels.ts and re-export from reportPresentation.ts, or move the function there and delete the duplicate).

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: packages/core/src/inbox/statusLabels.ts
    Line: 1-26
    
    Comment:
    **Duplicated `inboxStatusLabel` — OnceAndOnlyOnce**
    
    `packages/core/src/inbox/statusLabels.ts` and `packages/core/src/inbox/reportPresentation.ts` both export an identical `inboxStatusLabel` switch. This PR adds `resolved` to both, which is the second time the same new case has had to be applied to two files. Each future status addition will need to be kept in sync across both files. Consider consolidating into one source of truth (either remove `statusLabels.ts` and re-export from `reportPresentation.ts`, or move the function there and delete the duplicate).
    
    How can I resolve this? If you propose a fix, please make it concise.
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
packages/core/src/inbox/reportMembership.test.ts:163-177
**Inline multi-assertion instead of parameterised test**

The three `isExcludedFromInbox` true-cases are asserted sequentially inside a single `it` block. The `isDismissedReport` block above was correctly updated to `it.each` in this PR, but this sibling test was left non-parameterised. Per the codebase convention, prefer `it.each` here too so each status gets an independent test result in the runner output.

### Issue 2 of 2
packages/core/src/inbox/statusLabels.ts:1-26
**Duplicated `inboxStatusLabel` — OnceAndOnlyOnce**

`packages/core/src/inbox/statusLabels.ts` and `packages/core/src/inbox/reportPresentation.ts` both export an identical `inboxStatusLabel` switch. This PR adds `resolved` to both, which is the second time the same new case has had to be applied to two files. Each future status addition will need to be kept in sync across both files. Consider consolidating into one source of truth (either remove `statusLabels.ts` and re-export from `reportPresentation.ts`, or move the function there and delete the duplicate).

Reviews (1): Last reviewed commit: "feat(inbox): surface resolved reports in..." | Re-trigger Greptile

…dered

Addresses three Codex review comments on #2810:

- InboxReportDetailGate gated the archive detail route on
  status === "suppressed", so resolved cards opened from Archive were
  redirected to Runs and the reference-only detail view was unreachable.
  Gate on isDismissedReport (suppressed or resolved) instead.
- useInboxDismissedReports had no refetch interval; resolved is a
  server-side transition (PR merge) with no local invalidation, so an open
  Archive tab stayed stale. Poll while focused via INBOX_REFETCH_INTERVAL_MS.
- buildSignalReportListOrdering prefixes status, grouping suppressed ahead
  of resolved before the time sort. Add buildArchiveListOrdering (no status
  prefix) so the Archive list is globally newest-first across both states.
@andrewm4894 andrewm4894 added the Stamphog This will request an autostamp by stamphog on small changes label Jun 20, 2026
@andrewm4894 andrewm4894 enabled auto-merge (squash) June 20, 2026 22:41
github-actions[bot]
github-actions Bot previously approved these changes Jun 20, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All three substantive review bugs (routing bounce for resolved reports, stale archive data, status-prefixed ordering across two terminal statuses) are addressed in the current diff. The change is well-structured, architecturally correct, and the hook signature already supports the added refetch option.

auto-merge was automatically disabled June 20, 2026 22:42

Repository rule violations found

@github-actions github-actions Bot dismissed their stale review June 20, 2026 22:44

New commits pushed (delta classified label_absent) — stamphog approval dismissed; re-review running automatically.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c099519338

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/ui/src/features/inbox/components/InboxReportDetailGate.tsx
@andrewm4894 andrewm4894 added Stamphog This will request an autostamp by stamphog on small changes and removed Stamphog This will request an autostamp by stamphog on small changes labels Jun 21, 2026
@andrewm4894 andrewm4894 enabled auto-merge (squash) June 21, 2026 18:24

@stamphog stamphog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The Codex bot raised a valid concern at the current head about DismissedReportDetail.tsx unconditionally rendering RestoreReportButton for resolved reports. The PR attempted to fix this in ReportDetailActions.tsx (returns null for resolved), but DismissedReportDetail.tsx renders its own inline RestoreReportButton directly — it never calls ReportDetailActions. The fix was applied to the wrong component, so a resolved report opened in the archive detail view still shows a "Restore" button; clicking it hits the status !== "suppressed" guard in useInboxRestoreReport and surfaces the misleading toast "This report is no longer archived."

@stamphog stamphog Bot removed the Stamphog This will request an autostamp by stamphog on small changes label Jun 21, 2026
DismissedReportDetail renders its own inline RestoreReportButton and never
goes through ReportDetailActions, so the earlier resolved-report guard there
didn't reach this view. A resolved report opened in the archive detail still
showed a Restore button, which hits the `status !== "suppressed"` guard in
useInboxRestoreReport and surfaces the misleading "This report is no longer
archived" toast. Gate the Restore button on `status === "suppressed"` so
resolved reports stay reference-only.

Generated-By: PostHog Code
Task-Id: d1c635cf-c727-4f0c-80f4-f9f6f0d0918c
@andrewm4894 andrewm4894 added the Stamphog This will request an autostamp by stamphog on small changes label Jun 21, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

All prior review concerns are resolved in the current diff: routing uses isDismissedReport for both terminal statuses, DismissedReportDetail gates RestoreReportButton on canRestore, archive ordering drops the status prefix, and a refetch interval is added for server-side transitions. No showstoppers.

auto-merge was automatically disabled June 21, 2026 18:50

Repository rule violations found

@andrewm4894 andrewm4894 enabled auto-merge (squash) June 21, 2026 18:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Stamphog This will request an autostamp by stamphog on small changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant