Skip to content

feat(mobile): add inbox Archive tab with restore (port #2704)#2775

Open
Gilbert09 wants to merge 2 commits into
mainfrom
posthog-code/mobile-inbox-archive-tab
Open

feat(mobile): add inbox Archive tab with restore (port #2704)#2775
Gilbert09 wants to merge 2 commits into
mainfrom
posthog-code/mobile-inbox-archive-tab

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Summary

Ports the desktop Archive (dismissed reports) inbox feature from #2704 to the React Native / Expo app (apps/mobile). Desktop code is untouched; this implements the equivalent natively, reusing existing mobile inbox patterns.

Previously the mobile inbox could dismiss reports but offered no way to view or restore them.

What's included

  • Archive segment added to the floating inbox view toggle (InboxViewToggle), alongside the existing list/card modes. Matches the existing mobile inbox UX rather than copying the desktop tab bar.
  • Dedicated query (useArchivedReports) filtered to status = suppressed, ordered by updated_at desc (newest-dismissed first), reusing the existing mobile ordering helper. Suppressed reports stay excluded from the main pipeline query.
  • Restore action per row (useRestoreReport): re-fetches the report and no-ops if it's no longer suppressed, otherwise issues the potential state transition, then invalidates the report caches so the report leaves Archive and re-enters the inbox. Success / no-op / failure are surfaced with an inline banner and haptics (the established mobile feedback pattern — TinderView does the same).
  • Dismissal reason shown on each archived row via dismissalReasonLabel, falling back to the raw code for unknown values.

Notes

  • @posthog/core is not a mobile dependency and Metro only src-aliases the @posthog/shared root barrel, so the suppressed filter and dismissalReasonLabel are mirrored minimally in the mobile feature — consistent with how the app already mirrors DISMISSAL_REASON_OPTIONS and the core filter/ordering helpers.

Tests

apps/mobile/src/features/inbox/utils.test.ts covers the suppressed-membership predicate (isArchivedReport) and the reason-label fallback (dismissalReasonLabel). The membership predicate also gates the restore no-op path.

  • pnpm --filter @posthog/mobile test — inbox suite green (50 passing)
  • tsc --noEmit — clean for touched files
  • biome check — clean

Ports the desktop "Archive" (dismissed reports) inbox feature to the mobile app.

- New Archive segment in the floating inbox view toggle, listing reports the
  user has dismissed (status `suppressed`), newest-dismissed first.
- Dedicated `useArchivedReports` query filtered to suppressed reports, ordered
  by `updated_at` desc.
- Per-row Restore action: revalidates the report against the server first and
  no-ops if it's no longer suppressed, otherwise issues the `potential`
  transition, then invalidates the report caches so it moves back into the
  inbox. Success/failure surfaced via an inline banner + haptics.
- Each archived row shows its dismissal reason via a local `dismissalReasonLabel`
  helper (mirrors the shared helper; Metro only resolves the `@posthog/shared`
  root barrel, which the mobile app already mirrors for dismissal reasons).
- Tests for the suppressed-membership predicate and reason-label fallback.

Generated-By: PostHog Code
Task-Id: 3819b98a-bc60-4793-bd00-2cbf14ddc84a
@Gilbert09 Gilbert09 requested a review from a team June 19, 2026 10:53
@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown

React Doctor found 4 issues in 1 file · 4 warnings.

4 warnings

src/features/inbox/components/ArchivedReportList.tsx

Reviewed by React Doctor for commit 6e1096d.

@greptile-apps

greptile-apps Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "feat(mobile): add inbox Archive tab with..." | Re-trigger Greptile

Hoist the inline onPress arrow into a useCallback so it no longer defeats the
memo() on ArchivedRow, completing the row memoization (onRestore was already
stabilized).

Generated-By: PostHog Code
Task-Id: 3819b98a-bc60-4793-bd00-2cbf14ddc84a
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