You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2026-05-29] [$250] Report - Carousel is autoscrolled but new expense not highlighted if created via FAB. #83760
Version Number: 9.3.27.0 Reproducible in staging?: Yes Reproducible in production?: N/A - new feature, doesn't exist in prod If this was caught during regression testing, add the test name, ID and link from BrowserStack:#81446 Email or phone of affected tester (no customers):ibellicotest+2250@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Motorola MotoG60 / Android 12 (Hybrid app) App Component: Money Requests
Action Performed:
Prerequisite: Account has at least one workspace.
Open the Expensify app.
Open any workspace chat.
Create two manual expenses.
Note that when second expense is created, carousel on preview is autoscrolled to the new expense and it is highlighted.
Navigate to "Inbox"
Create a new manual expense via "FAB" and submit it to the same report and workspace.
Note that carousel is autoscrolled, but expense is not highlighted.
Expected Result:
When new expenses are created, report preview carousel should be autoscrolled to the last expense and new one should be highlighted.
Actual Result:
When a new expense is created via "FAB", report carousel is autoscrolled, but new expense is not displayed highlighted.
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #81446 - "Fix - Make it more apparent in the expense chat carousel view when expenses are added to a report" by @FitseTLT (High confidence) Related Issues: Original feature request #71390, #78526
Recommendation: ROLL FORWARD
The PR introduces new functionality to highlight newly created expenses in the report preview carousel. The bug appears to be related to screen focus detection when creating expenses via FAB and returning to the report. A roll forward fix would be simpler than reverting, as reverting would remove the entire highlighting feature that works correctly in other scenarios (e.g., when creating expenses directly in the chat).
Labels: No label changes. This is a frontend bug in staging, so DeployBlockerCash should remain.
📋 Detailed Analysis
Evidence
PR #81446 introduced logic to highlight newly created expenses and auto-scroll to them in the carousel. The implementation uses:
useNewTransactions hook to detect new transactions
All changes are in App repository, confirming this is a frontend issue.
Root Cause
The bug likely occurs because of a timing/race condition between:
When the expense is created via FAB
When the user navigates back to the report
When isFocused becomes true
When useNewTransactions calculates the new transactions
The auto-scroll works (line 507 in MoneyRequestReportPreviewContent.tsx), but the highlight does not appear because isFocused might not be true at the right moment, causing newTransactionIDs to be undefined when passed to the TransactionPreview component (line 148 in index.tsx).
Alternatively, there may be a difference in how useNewTransactions tracks transactions when navigating away from and back to the report (from Inbox -> FAB -> back to report) versus creating directly in the report.
Please re-state the problem that we are trying to solve in this issue.
When a new expense is created via the FAB (Floating Action Button) from the Inbox and submitted to an existing report, the report preview carousel auto-scrolls to the new expense but does not highlight it. However, when creating an expense directly from within the workspace chat, both scrolling and highlighting work correctly.
What is the root cause of that problem?
The root cause is a timing/focus race condition in how the useNewTransactions hook interacts with the isFocused gate in MoneyRequestReportPreview.
The useNewTransactions hook (src/hooks/useNewTransactions.ts:17-26) detects new transactions by computing a diff between the current transactions array and the previous one (via usePrevious). This diff is ephemeral — it only exists for the single render cycle where transactions contains something prevTransactions does not. After that render, usePrevious updates its ref via useEffect, making prevTransactions equal to transactions, and the diff is permanently lost.
User is on the workspace chat (component is mounted, isFocused = true)
User navigates to Inbox, then taps FAB → creation modal opens → chat screen loses focus (isFocused = false)
Expense is created optimistically → Onyx updates → component re-renders while unfocused
useNewTransactions correctly detects the new transaction (diff is non-empty)
But isFocused is false, so newTransactionIDs = undefined — the diff result is unused
After render, usePrevious effect updates prevTransactions to include the new transaction — the diff is consumed/lost
User finishes and navigates back → screen regains focus (isFocused = true)
But now useNewTransactions returns empty (diff was consumed in step 6) → no highlighting
When creating from within the chat (working flow):
User is on the workspace chat (component is mounted, isFocused = true)
Expense is created → Onyx updates → component re-renders while focused
useNewTransactions detects the diff AND isFocused is true → newTransactionIDs is populated → highlighting works
What changes do you think we should make in order to solve the problem?
In src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx, persist detected new transaction IDs in a useRef so they survive the unfocused period. When the screen regains focus, use the stored ref for highlighting instead of relying on the ephemeral useMemo value.
The approach:
Add a useRef<Set<string>> to accumulate new transaction IDs as they are detected by useNewTransactions (regardless of focus state)
When newTransactions from the hook is non-empty, add those IDs to the ref
Derive newTransactionIDs from the ref when isFocused is true
Clear the ref after the highlight animation has had time to play (using a timeout matching the animation duration constants)
This keeps the change scoped to one file and doesn't require modifying the useNewTransactions hook or the Onyx data layer.
What alternative solutions did you explore? (Optional)
Modify useNewTransactions to use useState instead of useMemo: This would make the detected new transactions persist across renders. However, it changes the hook's core behavior and could have unintended side effects in other consumers (e.g., ReportScreen.tsx:338).
Store newly created transaction IDs in Onyx during the IOU action: This would be the most robust solution (works even for fresh component mounts after expense creation), but it adds more complexity by introducing a new Onyx key and requiring cleanup logic across multiple files.
Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, or @MelvinBot <your feedback> to refine this analysis.
Contributor: @FitseTLT paid $250 via Upwork
Contributor+: @situchan due $250 via NewDot
@FitseTLT can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, and an Upwork job exists, please submit a proposal. https://www.upwork.com/jobs/~022060473472713988895
Activity
melvin-bot commentedon Feb 27, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #81446
melvin-bot commentedon Feb 27, 2026
💬 A slack conversation has been started in #expensify-open-source
melvin-bot commentedon Feb 27, 2026
Triggered auto assignment to @johncschuster (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.github-actions commentedon Feb 27, 2026
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
OSBotify commentedon Feb 27, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #81446 - "Fix - Make it more apparent in the expense chat carousel view when expenses are added to a report" by @FitseTLT (High confidence)
Related Issues: Original feature request #71390, #78526
Recommendation: ROLL FORWARD
The PR introduces new functionality to highlight newly created expenses in the report preview carousel. The bug appears to be related to screen focus detection when creating expenses via FAB and returning to the report. A roll forward fix would be simpler than reverting, as reverting would remove the entire highlighting feature that works correctly in other scenarios (e.g., when creating expenses directly in the chat).
Labels: No label changes. This is a frontend bug in staging, so
DeployBlockerCashshould remain.📋 Detailed Analysis
Evidence
PR #81446 introduced logic to highlight newly created expenses and auto-scroll to them in the carousel. The implementation uses:
useNewTransactionshook to detect new transactionsuseIsFocused()to check if the screen is focusedconst newTransactionIDs = isFocused ? new Set(newTransactions.map(...)) : undefinedThe bug manifests when:
Verification
The PR modifies these key files:
src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx- Added focus detection and newTransactionIDs logicsrc/components/ReportActionItem/MoneyRequestReportPreview/MoneyRequestReportPreviewContent.tsx- Added useFocusEffect for auto-scrollingsrc/components/ReportActionItem/TransactionPreview/TransactionPreviewContent.tsx- Added highlight animationsrc/hooks/useNewTransactions.ts- Modified dependency arrayAll changes are in App repository, confirming this is a frontend issue.
Root Cause
The bug likely occurs because of a timing/race condition between:
isFocusedbecomes trueuseNewTransactionscalculates the new transactionsThe auto-scroll works (line 507 in MoneyRequestReportPreviewContent.tsx), but the highlight does not appear because
isFocusedmight not be true at the right moment, causingnewTransactionIDsto beundefinedwhen passed to the TransactionPreview component (line 148 in index.tsx).Alternatively, there may be a difference in how
useNewTransactionstracks transactions when navigating away from and back to the report (from Inbox -> FAB -> back to report) versus creating directly in the report.MelvinBot commentedon Feb 27, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When a new expense is created via the FAB (Floating Action Button) from the Inbox and submitted to an existing report, the report preview carousel auto-scrolls to the new expense but does not highlight it. However, when creating an expense directly from within the workspace chat, both scrolling and highlighting work correctly.
What is the root cause of that problem?
The root cause is a timing/focus race condition in how the
useNewTransactionshook interacts with theisFocusedgate inMoneyRequestReportPreview.The
useNewTransactionshook (src/hooks/useNewTransactions.ts:17-26) detects new transactions by computing a diff between the currenttransactionsarray and the previous one (viausePrevious). This diff is ephemeral — it only exists for the single render cycle wheretransactionscontains somethingprevTransactionsdoes not. After that render,usePreviousupdates its ref viauseEffect, makingprevTransactionsequal totransactions, and the diff is permanently lost.In
MoneyRequestReportPreview(src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx:124-127), the new transaction IDs are only passed through when the screen is focused:When creating from FAB (broken flow):
isFocused = true)isFocused = false)useNewTransactionscorrectly detects the new transaction (diff is non-empty)isFocusedisfalse, sonewTransactionIDs = undefined— the diff result is unusedusePreviouseffect updatesprevTransactionsto include the new transaction — the diff is consumed/lostisFocused = true)useNewTransactionsreturns empty (diff was consumed in step 6) → no highlightingWhen creating from within the chat (working flow):
isFocused = true)useNewTransactionsdetects the diff ANDisFocusedistrue→newTransactionIDsis populated → highlighting worksWhat changes do you think we should make in order to solve the problem?
In
src/components/ReportActionItem/MoneyRequestReportPreview/index.tsx, persist detected new transaction IDs in auseRefso they survive the unfocused period. When the screen regains focus, use the stored ref for highlighting instead of relying on the ephemeraluseMemovalue.The approach:
useRef<Set<string>>to accumulate new transaction IDs as they are detected byuseNewTransactions(regardless of focus state)newTransactionsfrom the hook is non-empty, add those IDs to the refnewTransactionIDsfrom the ref whenisFocusedistrueThis keeps the change scoped to one file and doesn't require modifying the
useNewTransactionshook or the Onyx data layer.What alternative solutions did you explore? (Optional)
Modify
useNewTransactionsto useuseStateinstead ofuseMemo: This would make the detected new transactions persist across renders. However, it changes the hook's core behavior and could have unintended side effects in other consumers (e.g.,ReportScreen.tsx:338).Store newly created transaction IDs in Onyx during the IOU action: This would be the most robust solution (works even for fresh component mounts after expense creation), but it adds more complexity by introducing a new Onyx key and requiring cleanup logic across multiple files.
Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR, or@MelvinBot <your feedback>to refine this analysis.36 remaining items
melvin-bot commentedon May 23, 2026
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸
melvin-bot commentedon May 26, 2026
@FitseTLT Huh... This is 4 days overdue. Who can take care of this?
melvin-bot commentedon May 28, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon May 28, 2026
Payment Summary
Upwork Job
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon May 29, 2026
Payment Summary
Contributor: @FitseTLT paid $250 via Upwork
Contributor+: @situchan due $250 via NewDot
@FitseTLT can you please accept the job below? Please reply here and tag me once you have.
If you're not sent an offer in Upwork when you're assigned to an issue, and an Upwork job exists, please submit a proposal.
https://www.upwork.com/jobs/~022060473472713988895
^ Test case created. Thx
FitseTLT commentedon May 29, 2026
@mallenexpensify accepted
mallenexpensify commentedon May 29, 2026
@FitseTLT paid, summary updated above. Thx.
laurenreidexpensify commentedon Jun 1, 2026
$250 approved for @situchan