Skip to content

[$250] Expense carousel doesn't show RBR-actionable expenses first #85553

@grgia

Description

@grgia

Expensify/Expensify Issue URL: https://github.com/Expensify/Expensify/issues/603735
Slack conversation: https://expensify.slack.com/archives/C03U7DCU4/p1771944902661119?thread_ts=1771944902.661119&cid=C03U7DCU4


Action Performed

  1. Open a report that has multiple expenses, where at least one expense has an RBR indicator (violation, hold, field error, receipt error, etc.)
  2. Look at the expense carousel in the report preview

Expected Result

The expense that requires action (has RBR) should appear first in the carousel so the user can immediately identify and act on it.

Actual Result

Expenses appear in backend insertion order. RBR-flagged expenses can be buried at position 5+ in the carousel, making them easy to miss entirely — especially since only the first 11 are shown.

Root Cause

There is no RBR-aware sorting anywhere in the transaction display path:

  1. CarouselMoneyRequestReportPreviewContent.tsx:~506 does transactions.slice(0, 11) with no sort beforehand.
  2. Report transaction listMoneyRequestReportTransactionList.tsx:~325 sorts by date/column only; visualOrderTransactionIDs (which drives RHP carousel navigation) inherits this non-RBR-aware order.

The data flows from Onyx derived store → Object.values() (insertion order) → carousel/list — no step prioritizes actionable items.

Proposed Fix

Sort RBR-flagged transactions to the front in both locations:

  • Carousel: Sort transactions by RBR status before the .slice(0, 11) in MoneyRequestReportPreviewContent.
  • Transaction list: Use RBR status as a primary sort key in MoneyRequestReportTransactionList, with the existing date/column sort as secondary.

Existing infrastructure to reuse

  • shouldShowRBR from TransactionPreviewUtils.createTransactionPreviewConditionals()
  • filteredViolations already computed per-transaction in MoneyRequestReportTransactionList (~lines 216-237)
  • Report-level RBR prioritization pattern in SidebarUtils.ts:~533

Open Questions

  • Should RBR-first sorting override a user-selected column sort (date, merchant, etc.) in the report view, or only apply as the default?
  • Should sorting be centralized in useReportWithTransactionsAndViolations so all consumers benefit?

Platforms

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome / Safari
Issue OwnerCurrent Issue Owner: @abelhailefen
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~022033929183187241566
  • Upwork Job ID: 2033929183187241566
  • Last Price Increase: 2026-03-17

Metadata

Metadata

Labels

BugSomething is broken. Auto assigns a BugZero manager.ExternalAdded to denote the issue can be worked on by a contributorReviewingHas a PR in reviewWeeklyKSv2

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions