Skip to content

Confirm new expenses with a “View” toast instead of scrolling to and highlighting the row - #96496

Merged
mountiny merged 55 commits into
Expensify:mainfrom
software-mansion-labs:declarative-expense-added-growl
Aug 21, 2026
Merged

mountiny merged 55 commits into
Expensify:mainfrom
software-mansion-labs:declarative-expense-added-growl

Conversation

@mhawryluk

@mhawryluk mhawryluk commented Jul 20, 2026 •

Copy link
Copy Markdown
Member

Explanation of Change

Shows an "Expense added" growl (with a "View" action) after an expense is created from FAB outside of its report‚ as well as when duplicating and splitting expenses on Spend. Removes the highlighting of new expenses in the Spend tab tables completely.

It's driven declaratively by a single ExpenseAddedGrowl component, which watches an Onyx signal that the creation flows write to (same as they did for highlighting). In the previous approach each creation flow triggered the growl and its navigation imperatively, passing values that could go stale before the user tapped "View". Centralizing it in one Onyx-driven component removes that duplication and the stale-data problem.

Fixed Issues

$ #91408
PROPOSAL: N/A

Tests

  1. Growl + "View" from global create (Inbox tab)

    • Go to the Inbox tab.
    • Tap the green + (FAB) button → Create expense.
    • Enter an amount → tap Next → select a workspace/participant → tap Next.
    • On the confirmation page, tap Create expense.
    • Verify a green "Expense added" growl with a "View" button appears.
    • Repeat the steps above for each expense type in the Create expense flow - Manual, Scan (upload a receipt), Distance (add waypoints), and Per diem (on a workspace with per-diem rates enabled).
  2. Growl in the Spend tab

    • Go to a different tab than Inbox.
    • Tap the + (FAB) → Create expense → enter an amount → Next → select a workspace/participant → Next → Create expense.
    • Verify the app lands on the Spend tab, and the same growl + working View appears there. The rows in the table should not be highlighted anymore.
  3. "View" opens the correct destination for the current surface

    • Spend (or any non-Inbox) tab: the new expense's details open in a right-hand panel over the Spend view.
    • Inbox, narrow layout: opens the thread as a full-screen report.
    • Inbox, wide, report with a single expense: the new expense's details open directly in the right-hand panel.
    • Inbox, wide, report with multiple expenses: opens the expense report super-wide with the new expense's thread RHP stacked on top.
    • Inbox, wide, tracked/self-DM expense (no expense report): opens the thread as a full-screen report.
    • With an expense/report already open in the RHP: View replaces it (does not stack a second RHP).
    • After the growl appears, switch to a different tab, then tap View: it navigates per the tab you're on now.
  4. Single growl/single navigation on a batch (skip-confirm multi-scan)

    • First, create one Scan expense for a recipient (FAB → Create expense → Scan → upload a receipt → Next → pick the recipient → Create expense) so the FAB shows a "Scan receipt" quick action for them.
    • Tap the FAB → Scan receipt quick action → add/upload 2 receipts and submit (this path has no confirmation page).
    • Verify navigation happens once (no flicker/double transition) and exactly one "Expense added" growl appears, for the last receipt of the batch.
    • Tap View and verify it opens the last created expense.
  5. Invoice

    • Tap the FAB → Send invoice (requires a workspace with Invoices enabled under More features).
    • Enter an amount → Next → pick a recipient → Next → Send invoice.
    • Verify the growl reads "Invoice sent" and its View button works.
  6. Split an existing expense into multiple

    • Open an existing expense → tap the ⋮ (more) menu → Split expense.
    • Split it into 2+ expenses and confirm.
    • Verify one "Expense added" growl appears (for the last split transaction); View opens that expense.
  7. Bulk duplicate expenses

    • From the Spend table: select 2+ transactions (checkboxes) → "n selected" dropdown → Duplicate expenses.
    • Verify one growl appears; View opens the (last) duplicated expense.
  8. Self-DM expense

    • Tap the FAB → Create expense → enter an amount → Next → select your own account (self-DM) as the recipient → Create expense.
    • Verify the growl appears; View opens the transaction thread as a full-screen report (not an RHP).
    • Afterward, open your self-DM chat, tap the same expense preview, and verify it opens correctly.
  9. Share flow (native only)

    • From another app, Share an image into Expensify → choose submit expense → fill details → submit.
    • Verify a single "Expense added" growl appears after submission with a working View, and navigation happens once.

Offline tests

  • Go offline, then create an expense from the FAB on the Inbox tab (Create expense → amount → Next → participant → Next → Create expense).
  • Verify the "Expense added" growl still appears and View opens the optimistic transaction thread.
  • While offline on the Spend tab, create another expense; verify the list refetches once after you go back online.

QA Steps

Same as tests.

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
  • 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 followed proper code patterns (see Reviewing the code)
    • 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 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)
  • 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.
  • 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
Nagranie.z.ekranu.2026-07-23.o.18.05.47.mov
Nagranie.z.ekranu.2026-07-23.o.18.29.15.mov
Android: mWeb Chrome
iOS: Native
Simulator.Screen.Recording.-.iPhone.17.Pro.-.2026-07-21.at.17.04.37.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Nagranie.z.ekranu.2026-07-20.o.16.46.23.mov
Nagranie.z.ekranu.2026-07-20.o.16.51.38.mov

@melvin-bot

melvin-bot Bot commented Jul 20, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx ts-node ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx ts-node ./scripts/generateTranslations.ts --compare-ref main

@codecov

codecov Bot commented Jul 20, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/GlobalModals.tsx 100.00% <100.00%> (ø)
src/ONYXKEYS.ts 100.00% <ø> (ø)
src/components/Search/ChatSearchView.tsx 100.00% <ø> (ø)
src/components/Search/ExpenseFlatSearchView.tsx 100.00% <ø> (ø)
src/components/Search/ExpenseGroupedSearchView.tsx 64.19% <ø> (+4.85%) ⬆️
src/components/Search/ExpenseReportSearchView.tsx 100.00% <ø> (ø)
...ponents/Search/SearchList/ListItem/GroupHeader.tsx 76.66% <100.00%> (-0.20%) ⬇️
...h/SearchList/ListItem/TransactionGroupListItem.tsx 75.55% <100.00%> (-0.18%) ⬇️
src/components/Search/TaskSearchView.tsx 100.00% <ø> (ø)
src/components/Search/hooks/useSearchSnapshot.ts 88.75% <100.00%> (+1.10%) ⬆️
... and 23 more
... and 10 files with indirect coverage changes

@JakubKorytko JakubKorytko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Swapping the imperative per-flow growl calls for a single declarative ExpenseAddedGrowl component that subscribes to Onyx is a solid improvement over the old approach! the comments are mostly nits. The batch-ordering one and the signal-lifecycle one are the two I would actually confirm before merge

Comment thread src/components/Search/index.tsx Outdated
Comment thread src/components/ExpenseAddedGrowl.tsx Outdated
Comment thread src/components/ExpenseAddedGrowl.tsx
Comment thread src/components/ExpenseAddedGrowl.tsx
Comment thread src/components/ExpenseAddedGrowl.tsx
Comment thread src/components/ExpenseAddedGrowl.tsx
Comment thread src/libs/Navigation/helpers/navigateAfterExpenseCreate.ts Outdated
Comment thread src/components/Search/SearchList/ListItem/ChatListItem.tsx
@mhawryluk
mhawryluk marked this pull request as ready for review July 21, 2026 15:07
@mhawryluk
mhawryluk requested review from a team as code owners July 21, 2026 15:07
@melvin-bot
melvin-bot Bot requested review from JmillsExpensify and situchan and removed request for a team July 21, 2026 15:07
@melvin-bot

melvin-bot Bot commented Jul 21, 2026

Copy link
Copy Markdown

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

@mountiny

Copy link
Copy Markdown
Contributor

@situchan can you review please?

@github-actions

Copy link
Copy Markdown
Contributor

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

@github-actions

This comment has been minimized.

@situchan

situchan commented Jul 23, 2026 •

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
iOS: mWeb Safari
MacOS: Chrome / Safari
web1.mov
web2.mov
web3.mov
web3-2.mov
web4.mov
web6.mov
web7.mov
web8.mov
case1.mov
case2.mov
case4.mobile3.mov
case5.mov
case6.mov
case7.mov
case8.mov
case9.mobile2.mov
mobile1.mov

@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 OSBotify mentioned this pull request Aug 22, 2026
61 tasks done
@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.59-0 🚀

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

@MelvinBot

Copy link
Copy Markdown
Contributor

Help site review — changes required ✅

This PR removes the row highlighting of newly created expenses on the Spend tab and replaces it with an Expense added confirmation (with a View button). One help article documented the old highlighting behavior, so it needed an update.

Stale content found: Getting-Started-with-the-Spend-Page.md — under How to add a new expense to the table, it read "Its row is briefly highlighted as new.", which no longer happens.

Draft PR: #99233 — updates that line to describe the Expense added confirmation and View button instead.

Verification & scope
  • Verified against the current web UI: after creating an expense, a green Expense added toast appears with a View action, and the new row is not highlighted. Copy confirmed in src/languages/en.ts (iou.expenseAdded: 'Expense added', iou.invoiceSent: 'Invoice sent').
  • Searched all docs/articles for "highlight", "growl", "toast", "expense added", "View" — the Spend page article was the only place that described the removed highlighting behavior. Create-an-Expense.md, How-to-Merge-Expenses.md, and the duplicate/split flows do not mention row highlighting or a post-create confirmation, so no changes were needed there.

@mhawryluk, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review


view run

@mitarachim

Copy link
Copy Markdown

Deploy Blocker #99248 was identified to be related to this PR.

@mitarachim

Copy link
Copy Markdown

Deploy Blocker #99249 was identified to be related to this PR.

@mitarachim

Copy link
Copy Markdown

Deploy Blocker #99252 was identified to be related to this PR.

@mitarachim

Copy link
Copy Markdown

Deploy Blocker #99253 was identified to be related to this PR.

@mitarachim

Copy link
Copy Markdown

Deploy Blocker #99255 was identified to be related to this PR.

@mitarachim

Copy link
Copy Markdown

Deploy Blocker #99257 was identified to be related to this PR.

@mitarachim

Copy link
Copy Markdown

Deploy Blocker #99258 was identified to be related to this PR.

@jponikarchuk

Copy link
Copy Markdown

Deploy Blocker #99261 was identified to be related to this PR.

@jponikarchuk

Copy link
Copy Markdown

Deploy Blocker #99262 was identified to be related to this PR.

@jponikarchuk

Copy link
Copy Markdown

Deploy Blocker #99264 was identified to be related to this PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/AndrewGable in version: 9.4.59-5 🚀

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

Bundle Size Analysis (Sentry):

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.

10 participants