fix: Reports - Highlight animation is visible on added expense after duplication - #89585
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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6350f99a47
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: dca23bd080
ℹ️ 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".
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 956581943f
ℹ️ 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".
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
Thanks for the fix ... the mobile screenshots look to be missing .. can you please add them |
…-Highlight-animation-is-visible-on-added-expense-after-duplication
Added them. I was recording. Thanks! |
trjExpensify
left a comment
There was a problem hiding this comment.
Is this really a bug? When you create a new expense within the report, we highlight the newly added expense in the table. Duplicating an expense is essentially the same thing.
2026-05-07_03-08-25.mp4
CC: @Expensify/design @garrettmknight
Agree. I think this is by design. |
|
Agree! |
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 14e199a2b9
ℹ️ 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".
Yeaa now I got you. I was able to repo, and fixed the push on the latest commit. Indeed It was a production bug as you mentioned above. Thanks 🙏. |
|
@MelvinBot review the pr |
PR ReviewRe-reviewed at I focused on the newest change — dropping the 1.
|
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-06-22.at.03.09.58.movScreen.Recording.2026-06-22.at.03.10.20.mov |
|
cc @blimpich |
|
🚧 blimpich has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 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.18-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Help site review: no changes required. I reviewed the changes in this PR against the help articles in Why: This PR fixes two internal UI rendering bugs in the duplicate-expense flow — (1) the highlight animation on the newly-added row not firing, and (2) the right-hand panel not widening to super-wide after the chat→table flip. Both are purely visual/rendering behaviors driven by internal hooks ( The relevant article, How to Duplicate an Expense, documents how to duplicate (steps, eligibility, what gets copied, what happens after) — none of which this PR alters. Highlight animations and RHP panel width are not (and generally should not be) documented in help articles, so there is nothing to update. I did not open a draft docs PR since no content changes are warranted. @TaduJR, please review the above and confirm it reflects the current behavior. Since no help site changes were required, there is no linked help site PR to mark |
|
This PR failing because of the issue #94415 |
|
Expected there was a problem in the merge pipeline we reverted it and retrying with the new PR |
|
This PR failing because of the issue #94427 (Scenario 3) |
|
🚀 Deployed to production by https://github.com/blimpich in version: 9.4.18-2 🚀
|
Explanation of Change
Per design clarification on the PR thread: when a user duplicates the only expense in a single-tx report, the chat→table flip is intended, the new row should show the highlight animation, and the RHP should widen to super-wide. On
maintoday the highlight doesn't fire and the RHP stays at single-tx width.Two independent root causes, two focused fixes:
1. Highlight bug.
useNewTransactions's render-to-render diff misses adds that happen before the table view mounts — by the timeMoneyRequestReportActionsListmounts, the optimistic tx is already in thetransactionsarray. The hook already supports a side rail (pendingNewTransactionIDsfromREPORT_METADATA) for this exact case, but the rail was never populated. Fix: write the flag frombuildOnyxDataForMoneyRequestso every money-request creation flow hits it with one change.successData/failureDataboth clear the flag to prevent stale highlights across sessions (REPORT_METADATAis persisted).2. Wide-RHP bug. The Inbox path only had a
useShowWideRHPVersioncaller — nothing registered super-wide after the flip. Adding a second hook alongside the first races on effect order. Fix: collapseuseShowWideRHPVersionanduseShowSuperWideRHPVersioninto a singleuseRHPWidth(width)hook, and collapse the provider's twouseState<Set<string>>hint stores into oneuseState<Map<string, RHPWidthHint>>so contradictions are structurally impossible (React docs). Width prioritysuper-wide > wide > narrowensures pre-mark hints survive transient loading-state renders.Fixed Issues
$ #86354
PROPOSAL:
Tests
Scenario 1 — Duplicate on a single-tx report (the original bug)
Expected:
Scenario 2 — Duplicate on a multi-tx report
Expected: no layout flip; the new row shows the highlight animation; RHP stays at super-wide.
Scenario 3 — Duplicate from Spend → Expenses (multi-tx underlying report)
Expected: view switches to the report's table; the duplicate row shows the highlight; RHP is super-wide.
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