Repository navigation
fix: Reports - Highlight animation is visible on added expense after duplication - #94670
Conversation
…-Highlight-animation-is-visible-on-added-expense-after-duplication
|
@abzokhattab Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
This comment was marked as outdated.
This comment was marked as outdated.
@TaduJR please write more simply. This is AI-generated jargon. If we're abandoning this PR then lets have the discussion back in the GH issue about scope and whether the selected proposal is still relevant. |
I spent a lot of time yesterday evaluating the violations of the best practices since I have been interacting with with files that are even there on plan sight. For example https://github.com/Expensify/App/pull/94670/changes#diff-6a772bf64f11248437084ab1d0d1b137eb88ad6fb77ada3b5661bd31ae239534R47-R49 even the ugly workaround to manually memoize and the other three concerns. I just feed my research to AI to make it short as much as possible for everyone to understand from by broken expressive research. Not sure what made it jargon. Very sorry if it did. In-addition if you had seen my changes of the codebase you would have easily known that I spend much time trying to correct pre-existing react violation https://react.dev/learn/lifecycle-of-reactive-effects#each-effect-represents-a-separate-synchronization-process from pre-existing here https://github.com/Expensify/App/pull/94670/changes#diff-a0dfe32cb93943d8afd34db2dabe7540e9b819608a16f338cc68e450da89429c and separated the logic. Anyways it's super out of scope from our issue. The PR already does more that it was asked. Marked the my concern as outdate. Thanks! We can continue on the PR for review @abzokhattab TIA. |
|
@codex review the PR |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1e120c0c25
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
…-Highlight-animation-is-visible-on-added-expense-after-duplication
…ng the report mount
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 772ba274e3
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@MelvinBot Review the PR |
This comment was marked as resolved.
This comment was marked as resolved.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9aace7dc15
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Just to double check. Are we doing the correct behaviour here on Not Highlighting on Duplicate for Double RHP stacks? Currently we are highlighting after closing of the RHP. Mac-Chrome.mp4 |
|
It's ready for re-review. We settled with the product team. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppScreen.Recording.2026-06-22.at.03.31.14.moviOS: mWeb SafariScreen.Recording.2026-06-22.at.03.33.03.movMacOS: Chrome / SafariScreen.Recording.2026-07-12.at.14.56.43.mov |
|
looks like we have conflcits @TaduJR |
…-Highlight-animation-is-visible-on-added-expense-after-duplication # Conflicts: # src/components/MoneyRequestReportView/MoneyRequestReportTransactionsNavigation.tsx # src/pages/home/RecentlyAddedSection/index.tsx
|
🚧 blimpich has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/blimpich in version: 9.4.34-0 🚀
|
|
🤖 Help site review: no changes required. I reviewed the changes in this PR against the help articles under Why: This PR is a UI-behavior bug fix, not a feature or workflow change. It only affects transient rendering mechanics:
The user-facing behavior of the Duplicate expense action itself is unchanged — the steps to duplicate an expense are the same. Help articles document how to use features (settings, tabs, buttons, workflows); they don't cover ephemeral visual details like highlight animations or the pixel width of a side panel. The existing articles that reference "duplicate" (How to prevent duplicate expenses, Add an expense, Edit expenses) describe a different concept (avoiding duplicate submissions) and none of them reference the behaviors this PR touches. Because no article content is affected, I did not create a draft docs PR. If you'd like a docs PR anyway (e.g. to add coverage of the Duplicate expense flow that doesn't yet exist), let me know and I'll draft one. |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀
Bundle Size Analysis (Sentry): |
Splits saved from Search/Spend navigate back to Search and never mount the expense report list, so the pendingNewTransactionIDs flags written by buildOnyxDataForMoneyRequest were never consumed. They sat in REPORT_METADATA until the user later opened that report from the Inbox, highlighting rows that were no longer new. - Gate the highlight rail in MoneyRequestBuilder behind shouldSkipReportHighlightRail and restrict it to adds that make the report multi-transaction. - Thread the flag from SplitTransactionUpdate, set only for the branch that actually opens the expense report. - Drop the now-redundant addPendingNewTransactionIDs loop; the rail is written by the builder since Expensify#94670. - Add Onyx-level tests asserting REPORT_METADATA directly instead of the mock.
Splits saved from Search/Spend navigate back to Search and never mount the expense report list, so the pendingNewTransactionIDs flags written by buildOnyxDataForMoneyRequest were never consumed. They sat in REPORT_METADATA until the user later opened that report from the Inbox, highlighting rows that were no longer new. - Gate the highlight rail in MoneyRequestBuilder behind shouldSkipReportHighlightRail and restrict it to adds that make the report multi-transaction. - Thread the flag from SplitTransactionUpdate, set only for the branch that actually opens the expense report. - Drop the now-redundant addPendingNewTransactionIDs loop; the rail is written by the builder since Expensify#94670. - Add Onyx-level tests asserting REPORT_METADATA directly instead of the mock.
Explanation of Change
Per design clarification: when a user duplicates an expense, the duplicate is a new entity in the table, so it should be highlighted, and when a 1-tx report flips to the table view the RHP should widen to super-wide. Two root causes:
1. Highlight didn't fire on the duplicate.
useNewTransactionsdetects "new since last render" via a render-to-render diff, but on the chat→table flip the table view mounts with the optimistic tx already present, so the diff misses it. The hook already supports apendingNewTransactionIDsrail (read fromREPORT_METADATA) for exactly this pre-mount case, but no money-request flow populated it. Fix:buildOnyxDataForMoneyRequest(optimisticData), so every creation flow (manual/distance/track/split → all go throughgetMoneyRequestInformation) flags its new tx. Cleared in bothsuccessDataandfailureData(the key is persisted). Skipped for self-DM splits, whose tx routes toUNREPORTED_REPORT_ID.useNewTransactions: when the rail is active it's the single source of "new" (one branch — prevents a later add from re-flashing an earlier still-pending one); otherwise the render-diff runs regardless of focus (so a multi-tx report's table behind a transaction-thread overlay still highlights).2. The Inbox path never widened to super-wide. Collapsed the two width-toggle hooks into one
useRHPWidth(width)backed by a single per-report hintMap, and registeredsuper-wideon the Inbox receipt panel after the flip. The hint is consumed on width catch-up and cleared on unmount.Fixed Issues
$ #86354
PROPOSAL:
Tests
Scenario 1 — Duplicate on a single-tx report
Expected (wide & narrow):
Scenario 2 — Duplicate on a multi-tx report
Expected (wide & narrow):
Scenario 3 — Duplicate from Spend → Expenses (multi-tx underlying report)
Expected (wide & narrow):
Scenario 4 — Duplicate while a second RHP is stacked over the report
Expected - Wide (desktop):
Expected - Narrow (mobile):
The detail RHP fully covers the table; nothing is visible during the duplicate.
The new duplicate row shows the highlight animation when you close the detail RHP and the table becomes visible.
Verify that no errors appear in the JS console
Offline tests
Same as tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Screen.Recording.2026-05-26.at.4.00.29.PM.mov
Android: mWeb Chrome
iOS: Native
Screen.Recording.2026-05-26.at.3.54.13.PM.mov
iOS: mWeb Safari
Screen.Recording.2026-05-26.at.3.56.27.PM.mov
MacOS: Chrome / Safari
Screen.Recording.2026-05-26.at.3.49.40.PM.mov