Skip to content

feat(inbox): make report detail sections collapsible - #4027

Open
posthog[bot] wants to merge 4 commits into
mainfrom
posthog-code/collapsible-inbox-report-sections
Open

feat(inbox): make report detail sections collapsible#4027
posthog[bot] wants to merge 4 commits into
mainfrom
posthog-code/collapsible-inbox-report-sections

Conversation

@posthog

@posthog posthog Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Problem

Web Inbox lets you collapse the report detail sections (Summary, Evidence, Runs, Reviewers) so a long report stays scannable. PostHog Desktop rendered every one of those sections permanently open, and mobile only collapsed Signals — so the same report reads very differently depending on where you open it.

Reported by the signals-inbox-parity scout, which spotted the upstream collapsible behaviour landing in PostHog/posthog and the matching downstream gap.

Why: parity — a report should be scannable the same way on desktop, web, and mobile.

Changes

Desktop. DetailSection and RightColumnSection take collapsible (plus defaultCollapsed), turning the header into an aria-expanded disclosure button with a shared caret. rightSlot stays outside that button, so the Evidence count and the Reviewers "Add" popover keep their own click targets. Summary, Evidence, Runs, and Reviewers opt in — the data hooks are untouched, so collapsing only hides rendered content.

pr-review's PrSectionHeader was a near-copy of the same collapsible chrome, so PrCommentsSection now uses the shared primitive and the duplicate is deleted.

Mobile. New ReportSection disclosure carries the accessible expanded state; Summary and Suggested reviewers join the existing Signals toggle. Signals keeps its expand analytics.

No screenshots — this is a disclosure toggle on existing chrome, verified through the tests below rather than a live app run.

How did you test this?

  • New DetailSection.test.tsx runs both primitives through one table (8 tests): body renders with no toggle when not collapsible, header click hides/restores the body while reporting aria-expanded, defaultCollapsed starts closed, and a rightSlot button fires its own handler without toggling the section.
  • pnpm --filter @posthog/ui test — 2413 passed.
  • apps/mobile Vitest suite — 571 passed.
  • turbo typecheck --filter=@posthog/ui clean; tsc over apps/mobile reports no new errors in the touched files (the app has pre-existing failures elsewhere and no typecheck task).
  • Biome clean.

Automatic notifications

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

Created with PostHog Code from an inbox report

Web Inbox lets users collapse the report Summary, Evidence, Runs, and
Reviewers sections. Desktop rendered all of them permanently open, and
mobile only collapsed Signals.

Desktop: `DetailSection` and `RightColumnSection` take `collapsible`
(plus `defaultCollapsed`), turning the header into an `aria-expanded`
disclosure button that shares a caret with the other. `rightSlot` stays
outside the button so the Evidence count and the Reviewers "Add" popover
keep their own click targets. Summary, Evidence, Runs, and Reviewers opt
in; the data hooks are untouched, so collapsing only hides rendered
content.

`pr-review`'s `PrSectionHeader` was a near-copy of that chrome, so
`PrCommentsSection` now uses the shared primitive and the duplicate is
gone.

Mobile: new `ReportSection` disclosure carries the accessible expanded
state, and Summary and Suggested reviewers join the existing Signals
toggle. Signals keeps its expand analytics.

Generated-By: PostHog Code
Task-Id: 6694c9d5-a520-4499-9af3-b46a15ab27dd
@trunk-io

trunk-io Bot commented Jul 30, 2026

Copy link
Copy Markdown

✨ Submitted to Merge by @andrewm4894. It will be added to the merge queue once all branch protection rules pass and there are no merge conflicts with the target branch. See more details here.

@github-actions

github-actions Bot commented Jul 30, 2026

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 0bcb801.

@andrewm4894
andrewm4894 marked this pull request as ready for review July 31, 2026 20:15
@andrewm4894
andrewm4894 enabled auto-merge (squash) July 31, 2026 20:15

@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: faebf8958d

ℹ️ 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".

{rightSlot && <div className="shrink-0">{rightSlot}</div>}
</Flex>
<div>{children}</div>
{open && <div>{children}</div>}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve nested disclosure state when collapsing sections

When a user expands a long Evidence card with “Show more”, “Relevant code”, or “Data queried”, collapsing and reopening Evidence removes and remounts the entire SignalsList subtree, resetting those SignalCard disclosure states. Keep the body mounted while hiding it so collapsing the outer section does not discard the user's position within its cards.

Useful? React with 👍 / 👎.

@andrewm4894

Copy link
Copy Markdown
Member

/trunk merge

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.

1 participant