Skip to content

fix(mobile): tiebreak priority sort by newest first (port #2787) - #2854

Merged
talyn-app[bot] merged 1 commit into
mainfrom
posthog-code/mobile-priority-sort-tiebreak
Jun 23, 2026
Merged

fix(mobile): tiebreak priority sort by newest first (port #2787)#2854
talyn-app[bot] merged 1 commit into
mainfrom
posthog-code/mobile-priority-sort-tiebreak

Conversation

@Gilbert09

Copy link
Copy Markdown
Member

Summary

Ports desktop PR #2787 (fix(inbox): tiebreak priority sort by newest first) to the React Native / Expo mobile app.

Priority is a coarse 5-bucket rank (P0–P4); without a secondary sort, reports within the same priority tier came back in arbitrary order on mobile. This appends a -created_at (newest first) tiebreak to the signal report list ordering param when sorting by priority, so the ordering string becomes e.g. status,-is_suggested_reviewer,-priority,-created_at. The existing status and -is_suggested_reviewer prefixes are unchanged, and non-priority sort fields are unaffected.

Changes

  • apps/mobile/src/features/inbox/utils.ts — add the -created_at tiebreak in buildSignalReportListOrdering for the priority field only.
  • apps/mobile/src/features/inbox/utils.test.ts — parameterized tests across all ordering fields and both directions, asserting the tiebreak is present for priority and absent for other fields.

Testing

  • vitest run src/features/inbox/utils.test.ts — 37 passing.
  • Lint clean on changed files; no new typecheck errors introduced.

Scope is limited to apps/mobile; no changes to apps/code or packages/*.

Priority is a coarse 5-bucket rank (P0-P4); without a secondary sort, reports
in the same tier come back in arbitrary order. Append a `-created_at` (newest
first) tiebreak to the signal report list ordering when sorting by priority,
e.g. `status,-is_suggested_reviewer,-priority,-created_at`.

Ports desktop PR #2787 to the React Native / Expo mobile app.

Generated-By: PostHog Code
Task-Id: af36a8a9-00c9-4b67-a23d-35898325b7d5
@Gilbert09
Gilbert09 requested a review from a team June 23, 2026 10:43
@github-actions

Copy link
Copy Markdown

React Doctor found no issues in the changed files. 🎉

Reviewed by React Doctor for commit 81fd716.

@greptile-apps

greptile-apps Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Reviews (1): Last reviewed commit: "fix(mobile): tiebreak priority sort by n..." | Re-trigger Greptile

@talyn-app
talyn-app Bot merged commit c924d94 into main Jun 23, 2026
20 checks passed
@talyn-app
talyn-app Bot deleted the posthog-code/mobile-priority-sort-tiebreak branch June 23, 2026 20:33
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.

2 participants