Skip to content

fix: Reports - Highlight animation is visible on added expense after duplication - #94670

Merged
blimpich merged 16 commits into
Expensify:mainfrom
TaduJR:fix-Reports-Highlight-animation-is-visible-on-added-expense-after-duplication
Jul 13, 2026
Merged

blimpich merged 16 commits into
Expensify:mainfrom
TaduJR:fix-Reports-Highlight-animation-is-visible-on-added-expense-after-duplication

Conversation

@TaduJR

@TaduJR TaduJR commented Jun 26, 2026 •

Copy link
Copy Markdown
Contributor

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. useNewTransactions detects "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 a pendingNewTransactionIDs rail (read from REPORT_METADATA) for exactly this pre-mount case, but no money-request flow populated it. Fix:

  • Populate the rail from buildOnyxDataForMoneyRequest (optimisticData), so every creation flow (manual/distance/track/split → all go through getMoneyRequestInformation) flags its new tx. Cleared in both successData and failureData (the key is persisted). Skipped for self-DM splits, whose tx routes to UNREPORTED_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 hint Map, and registered super-wide on 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

  1. Open a workspace chat.
  2. Create a manual expense (e.g. $10).
  3. Open the just-created expense from the chat — the RHP shows the single-expense detail (single-width).
  4. Tap More → Duplicate expense.

Expected (wide & narrow):

  • The RHP switches from single-expense detail to the multi-tx table view.
  • The newly-added duplicate row shows the brief highlight animation (visible on both devices).
  • The RHP widens to super-wide.

Scenario 2 — Duplicate on a multi-tx report

  1. Open a workspace chat with a report that already has ≥ 2 expenses.
  2. Open one of the expenses from the table.
  3. Tap More → Duplicate expense.

Expected (wide & narrow):

  • No layout flip.
  • The new row shows the highlight animation.
  • The RHP stays at super-wide.

Scenario 3 — Duplicate from Spend → Expenses (multi-tx underlying report)

  1. Navigate to Spend → Expenses.
  2. Open a single expense whose underlying report has more than one transaction.
  3. Tap More → Duplicate expense.

Expected (wide & narrow):

  • The view switches to the report's table.
  • The duplicate row shows the highlight animation.
  • The RHP is super-wide.

Scenario 4 — Duplicate while a second RHP is stacked over the report

  1. Open a report table that already has an expense (e.g. the multi-tx report from Scenario 2, or the table from Scenario 1/3).
  2. Open one of its transactions — a second RHP (the expense/transaction detail) stacks on top of the report table.
  3. Tap More → Duplicate expense from that detail RHP.

Expected - Wide (desktop):

  • The report table stays visible in the background behind the detail RHP.
  • The new duplicate row shows the highlight animation in the background, immediately — while the detail RHP is still open.

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

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

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

@TaduJR
TaduJR requested review from a team as code owners June 26, 2026 08:00
@melvin-bot
melvin-bot Bot requested review from abzokhattab and flaviadefaria and removed request for a team June 26, 2026 08:00
@melvin-bot

melvin-bot Bot commented Jun 26, 2026

Copy link
Copy Markdown

@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]

@melvin-bot
melvin-bot Bot removed the request for review from a team June 26, 2026 08:00
@codecov

codecov Bot commented Jun 26, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
...equestReportView/MoneyRequestReportActionsList.tsx 64.02% <100.00%> (+0.12%) ⬆️
...portActionItem/MoneyRequestReportPreview/index.tsx 92.30% <100.00%> (+0.15%) ⬆️
...archList/ListItem/TransactionGroupListExpanded.tsx 65.62% <100.00%> (ø)
...WideRHPContextProvider/useRHPWidth/index.native.ts 100.00% <100.00%> (ø)
src/hooks/useNavigateToTransactionThread.ts 33.33% <100.00%> (ø)
src/hooks/useNewTransactions.ts 94.59% <100.00%> (+3.16%) ⬆️
src/pages/home/RecentlyAddedSection/index.tsx 100.00% <100.00%> (ø)
...tView/MoneyRequestReportTransactionsNavigation.tsx 1.08% <0.00%> (ø)
src/libs/actions/IOU/MoneyRequestBuilder.ts 90.26% <87.50%> (+0.16%) ⬆️
src/pages/Search/SearchMoneyRequestReportPage.tsx 0.00% <0.00%> (ø)
... and 6 more
... and 13 files with indirect coverage changes

@TaduJR

This comment was marked as outdated.

@blimpich

Copy link
Copy Markdown
Contributor

@blimpich

TL;DR. Deep review surfaced a few pre-existing perf/architecture items, all out of scope for this bugfix (clean, self-contained re-land). Proposing a dedicated issue + separate follow-up PRs

Top items:

  1. useNewTransactions opts out of React Compiler - a render-phase ref write + incomplete-deps useMemo make the compiler bail on the whole hook (zero auto-memo). Verified: CompileError, no cache emitted. → rewrite to "adjust state during render" (perf).
  2. Transient highlight state persisted to disk (REPORT_METADATA) - the sole reason for the successData/failureData/4s-timer cleanup + cross-session stale highlights. → move to ephemeral state.
  3. Two writers for the same rail - our builder write + the parallel addPendingNewTransactionIDs. → consolidate to one (needs rail-owner sign-off).
  4. WideRHP width - Map's last-write-wins lost super-wide precedence (latent stuck/oversized RHP); plus dead write-only API (setIs*RHPClosing, never read). → precedence-correct + delete dead code.
  • Open one dedicated refactor issue [Refactor] Reports duplicate-highlight: de-persist the new-transaction rail, consolidate writers, and clean up WideRHPContextProvider listing these.
  • Land as 3 independent follow-up PRs (provider cleanup / useNewTransactions rewrite / rail de-persistence) - different subsystems, different testing. Already planned more in depth on my side.

LMK your thoughts.

@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.

@TaduJR

TaduJR commented Jun 27, 2026

Copy link
Copy Markdown
Contributor Author

@TaduJR please write more simply. This is AI-generated jargon.

@blimpich

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.

@abzokhattab

Copy link
Copy Markdown
Contributor

@codex review the PR

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

@TaduJR

This comment was marked as resolved.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/hooks/useNewTransactions.ts Resolved
@abzokhattab

Copy link
Copy Markdown
Contributor

@MelvinBot Review the PR

@TaduJR

This comment was marked as resolved.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/hooks/useNewTransactions.ts Resolved
Comment thread src/hooks/useNewTransactions.ts Resolved
@TaduJR

TaduJR commented Jun 28, 2026

Copy link
Copy Markdown
Contributor Author

@abzokhattab

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

@TaduJR

TaduJR commented Jul 5, 2026

Copy link
Copy Markdown
Contributor Author

@abzokhattab

It's ready for re-review. We settled with the product team.

@abzokhattab

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
Screen.Recording.2026-06-22.at.03.31.14.mov
iOS: mWeb Safari
Screen.Recording.2026-06-22.at.03.33.03.mov
MacOS: Chrome / Safari
Screen.Recording.2026-07-12.at.14.56.43.mov

@melvin-bot
melvin-bot Bot requested a review from blimpich July 12, 2026 12:59
@abzokhattab

Copy link
Copy Markdown
Contributor

looks like we have conflcits @TaduJR

TaduJR added 2 commits July 12, 2026 22:24
…-Highlight-animation-is-visible-on-added-expense-after-duplication

# Conflicts:
#	src/components/MoneyRequestReportView/MoneyRequestReportTransactionsNavigation.tsx
#	src/pages/home/RecentlyAddedSection/index.tsx
@blimpich
blimpich merged commit 4e3006a into Expensify:main Jul 13, 2026
34 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 blimpich has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/blimpich in version: 9.4.34-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Help site review: no changes required.

I reviewed the changes in this PR against the help articles under App/docs/articles and no docs updates are needed.

Why: This PR is a UI-behavior bug fix, not a feature or workflow change. It only affects transient rendering mechanics:

  • Making the brief highlight animation fire on a newly-duplicated expense (via the pendingNewTransactionIDs rail in useNewTransactions).
  • Widening the RHP to super-wide when a single-transaction report flips to the table view (RHP width consolidation in WideRHPContextProvider).

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.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 failure ❌
🍎 iOS 🍎 failure ❌

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.34-14 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

aswin-s added a commit to aswin-s/App that referenced this pull request Jul 31, 2026
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.
aswin-s added a commit to aswin-s/App that referenced this pull request Jul 31, 2026
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.
@TaduJR
TaduJR deleted the fix-Reports-Highlight-animation-is-visible-on-added-expense-after-duplication branch September 23, 2026 06:16
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.

5 participants