feat(mobile): add inbox Archive tab with restore (port #2704)#2775
Open
Gilbert09 wants to merge 2 commits into
Open
feat(mobile): add inbox Archive tab with restore (port #2704)#2775Gilbert09 wants to merge 2 commits into
Gilbert09 wants to merge 2 commits into
Conversation
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
|
React Doctor found 4 issues in 1 file · 4 warnings. 4 warnings
Reviewed by React Doctor for commit |
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
InboxViewToggle), alongside the existing list/card modes. Matches the existing mobile inbox UX rather than copying the desktop tab bar.useArchivedReports) filtered tostatus = suppressed, ordered byupdated_atdesc (newest-dismissed first), reusing the existing mobile ordering helper. Suppressed reports stay excluded from the main pipeline query.useRestoreReport): re-fetches the report and no-ops if it's no longersuppressed, otherwise issues thepotentialstate 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 —TinderViewdoes the same).dismissalReasonLabel, falling back to the raw code for unknown values.Notes
@posthog/coreis not a mobile dependency and Metro only src-aliases the@posthog/sharedroot barrel, so thesuppressedfilter anddismissalReasonLabelare mirrored minimally in the mobile feature — consistent with how the app already mirrorsDISMISSAL_REASON_OPTIONSand the core filter/ordering helpers.Tests
apps/mobile/src/features/inbox/utils.test.tscovers 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 filesbiome check— clean