Skip to content

Guard invoice empty state on canSendInvoice and fix money request back nav#90760

Open
MelvinBot wants to merge 6 commits into
mainfrom
claude-fixInvoiceEmptyStateAndBackNav
Open

Guard invoice empty state on canSendInvoice and fix money request back nav#90760
MelvinBot wants to merge 6 commits into
mainfrom
claude-fixInvoiceEmptyStateAndBackNav

Conversation

@MelvinBot
Copy link
Copy Markdown
Contributor

@MelvinBot MelvinBot commented May 15, 2026

Explanation of Change

The invoice empty state in EmptySearchView always showed the "Send invoice" button, even for users without an invoice-enabled admin workspace. Tapping it navigated to a "Hmm not here" not-found page. Now the button is hidden when canSendInvoice returns false, and an informative subtitle is shown instead ("You need a workspace with invoicing enabled to send invoices."). This mirrors how the FAB's InvoiceMenuItem already gates itself.

Fixed Issues

$ #89259
PROPOSAL: #89259 (comment)

Tests

  1. Log in with a new account without creating a workspace.
  2. Use the search input and search for type:invoice.
  3. Verify the empty state does not show a "Send invoice" button, and the subtitle reads: You need a workspace with Invoices enabled to send invoices.
  • Verify that no errors appear in the JS console

Offline tests

  1. Log in with a new account without creating a workspace.
  2. Use the search input and search for type:invoice.
  3. Verify the empty state does not show a "Send invoice" button, and the subtitle reads: You need a workspace with Invoices enabled to send invoices.

QA Steps

  1. Log in with a new account without creating a workspace.
  2. Use the search input and search for type:invoice.
  3. Verify the empty state does not show a "Send invoice" button, and the subtitle reads: You need a workspace with Invoices enabled to send invoices.
  • 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
  • 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 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

… back navigation

When a user without an invoice-enabled admin workspace taps "Send invoice"
from the empty search view, they are sent to a "not found" page. This hides
the Send invoice button for users who cannot send invoices and shows an
informative subtitle instead.

Also fixes inconsistent back navigation on the not-found page for money
request flows — the header back button now calls Navigation.goBack() instead
of goBackFromWorkspaceSettingPages(), matching the hardware back behavior.

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@OSBotify

This comment has been minimized.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

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

Files with missing lines Coverage Δ
src/pages/Search/EmptySearchView.tsx 70.80% <100.00%> (+69.44%) ⬆️
... and 1453 files with indirect coverage changes

@ahmedGaber93
Copy link
Copy Markdown
Contributor

@MelvinBot Mark this PR as ready for review.

@MelvinBot
Copy link
Copy Markdown
Contributor Author

🤖 I attempted to mark this PR as ready for review, but I don't have permission to change the draft status in this environment. Please mark it as ready for review manually using the GitHub UI (click "Ready for review" at the bottom of the PR).

@ahmedGaber93
Copy link
Copy Markdown
Contributor

@MelvinBot Mark this PR as ready for review.

@MelvinBot MelvinBot marked this pull request as ready for review May 18, 2026 09:19
@MelvinBot MelvinBot requested a review from a team as a code owner May 18, 2026 09:19
@MelvinBot
Copy link
Copy Markdown
Contributor Author

🤖 Done! This PR has been marked as ready for review.

@melvin-bot melvin-bot Bot requested review from ahmedGaber93 and joekaufmanexpensify and removed request for a team May 18, 2026 09:19
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented May 18, 2026

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

const userCanSendInvoice = canSendInvoice(allPolicies, currentUserPersonalDetails.login);
if (!content && !hasResults) {
content = {
...defaultViewItemHeader.folder,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

❌ CONSISTENCY-5 (docs)

The eslint-disable-next-line no-nested-ternary directive lacks an accompanying comment explaining why the rule is disabled. ESLint disables without justification can mask underlying issues and reduce code quality.

Add a comment explaining why the nested ternary is acceptable here, or better yet, refactor to avoid the nested ternary entirely. For example, extract the subtitle selection into a helper function:

const getInvoiceSubtitleKey = () => {
    if (!userCanSendInvoice) {
        return 'search.searchResults.emptyInvoiceResults.subtitleCannotSend';
    }
    if (hasSeenTour) {
        return 'search.searchResults.emptyInvoiceResults.subtitleWithOnlyCreateButton';
    }
    return 'search.searchResults.emptyInvoiceResults.subtitle';
};

subtitle: translate(getInvoiceSubtitleKey()),

This eliminates the need for the eslint-disable entirely.


Reviewed at: de65f77 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MelvinBot fix this

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added a justification comment for the eslint-disable no-nested-ternary explaining it selects among three subtitle variants based on invoice permission and tour status (96937ff).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MelvinBot Let's remove the eslint disable comment and use this approach.

case CONST.SEARCH.DATA_TYPES.INVOICE: {
    const userCanSendInvoice = canSendInvoice(allPolicies, currentUserPersonalDetails.login);
    let subtitleKey: TranslationPaths = 'search.searchResults.emptyInvoiceResults.subtitle';
    if (!userCanSendInvoice) {
        subtitleKey = 'search.searchResults.emptyInvoiceResults.subtitleCannotSend';
    } else if (hasSeenTour) {
        subtitleKey = 'search.searchResults.emptyInvoiceResults.subtitleWithOnlyCreateButton';
    }
    if (!content && !hasResults) {
        content = {
            ...defaultViewItemHeader.folder,
            title: translate('search.searchResults.emptyInvoiceResults.title'),
            subtitle: translate(subtitleKey),

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Removed the eslint disable comment and refactored to use if/else with a let subtitleKey variable instead of the nested ternary (b999459).

@ahmedGaber93
Copy link
Copy Markdown
Contributor

@MelvinBot On staging we currently have different subtitle messages depending on whether the user has taken the test drive (hasSeenTour):

  • If the user has taken the test drive, the message is: Use the green button below to send an invoice.
  • If the user has not taken the test drive, the message is: Send an invoice or take a test drive of Expensify to learn more.

In this PR, you added a new case for users who do not have any workspace with invoices enabled, but the same subtitle message is shown regardless of whether the user has taken the test drive or not: Send an invoice or take a test drive of Expensify to learn more.

@MelvinBot Could you please suggest on a comment two different messages to handle both cases?

  • User has taken the test drive but does not have any workspace with invoices enabled.
  • User has not taken the test drive and also does not have any workspace with invoices enabled.

@MelvinBot
Copy link
Copy Markdown
Contributor Author

Good catch — the subtitleCannotSend message should vary based on hasSeenTour, just like the other subtitle cases do.

Here are two suggested messages:

Case Suggested message
Has taken test drive (hasSeenTour = true) "You need a workspace with invoicing enabled to send invoices."
Has NOT taken test drive (hasSeenTour = false) "You need a workspace with invoicing enabled to send invoices. Take a test drive of Expensify to learn more."

This mirrors the existing pattern: when the user has already taken the tour, we skip mentioning it; when they haven't, we surface it as a next step. The "cannot send" part stays consistent in both.

Would you like me to implement this, or do you have different wording in mind?

@ahmedGaber93
Copy link
Copy Markdown
Contributor

ahmedGaber93 commented May 18, 2026

"You need a workspace with invoicing enabled to send invoices. Take a test drive of Expensify to learn more."

Hmm! I’m not sure if this part “Take a test drive of Expensify to learn more” would be helpful here. The test drive doesn’t provide any steps for enabling invoices for the workspace.

@ahmedGaber93
Copy link
Copy Markdown
Contributor

Let’s get feedback from the product teams.

@joekaufmanexpensify We have a minor UX issue here: #89259 (comment)

I consider this a minor issue because users cannot normally access the invoice type filter in the RHP unless they already have a workspace with invoices enabled. They can only reach it directly via URL or search keywords.

The current plan is to hide the "Send Invoice" button on the empty state page when the user does not have any workspace with invoices enabled.

  • We’ll keep the current staging messages for users who already have a workspace with invoices enabled.
Current messages on staging: Screenshot 2026-05-18 at 12 25 45 PM Screenshot 2026-05-18 at 12 24 20 PM
  • If the user does not have a workspace with invoices enabled, we will hide the "Send Invoice" button and display the message as mentioned here.

What do you think about those messages? Also, what do you think here #90760 (comment)?


@neerajbachani
Copy link
Copy Markdown
Contributor

neerajbachani commented May 18, 2026

@ahmedGaber93 @joekaufmanexpensify to directly answer the UX question: the cleanest pattern here is to mirror what the workspaces empty state already does offer a New workspace CTA that routes to workspace creation (with invoicing pre-enabled) when policy creation isn't restricted, and fall back to subtitle-only copy when it is restricted.

For copy, something like:

  • hasSeenTour = true + !isRestrictedPolicyCreation → subtitle: "You need a workspace with invoicing enabled to send invoices." + New workspace button
  • hasSeenTour = false + !isRestrictedPolicyCreation → subtitle: "You need a workspace with invoicing enabled to send invoices." + Take a test drive + New workspace buttons
  • and if workspace created with invoice enabled then will show send invoice button

This avoids the dead-end after test drive (the main gap in the current PR) and gives users an actionable next step without referencing the test drive as a workaround for an invoicing setup problem.

I already have this flow working locally and sharing demo video again or coordinate if it helps move this forward.

lv_0_20260518142729.mp4

@ahmedGaber93
Copy link
Copy Markdown
Contributor

@neerajbachani, I responded to your proposal here: #89259 (comment)

I’m also open to moving forward with your proposal if the product team prefers it. However, I believe Melvin’s proposal is the better approach, as explained in the link above.

@joekaufmanexpensify
Copy link
Copy Markdown
Contributor

Hm, with the current Melvin proposal, if there's no workspace, do we show the option to create one from the empty state, or is it just a dead-end and the user's on their phone to go separately create one?

@ahmedGaber93
Copy link
Copy Markdown
Contributor

ahmedGaber93 commented May 19, 2026

@joekaufmanexpensify, with the current Melvin proposal, this is a dead end, and there is no option to create a workspace from the empty state. The user would need to:

  1. Go to Workspaces → Create Workspace
  2. Go to More Features → Enable Invoices

However, this dead end is not reachable through normal app navigation. Users cannot normally access the invoice type filter in the RHP unless they already have a workspace with invoices enabled. The only ways to reach it are via a direct URL or search keywords.

@joekaufmanexpensify
Copy link
Copy Markdown
Contributor

I see. I agree with you that this seems fine then. I doubt any actual customer is ever going to run into this.

Copy link
Copy Markdown
Contributor

@joekaufmanexpensify joekaufmanexpensify left a comment

Choose a reason for hiding this comment

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

Good for product

Comment thread src/languages/en.ts Outdated
`),
subtitle: 'Send an invoice or take a test drive of Expensify to learn more.',
subtitleWithOnlyCreateButton: 'Use the green button below to send an invoice.',
subtitleCannotSend: 'You need a workspace with invoicing enabled to send invoices.',
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MelvinBot the feature name is Invoices not invoicing, please update it. Also, update the translation files.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Updated the feature name from "invoicing" to "Invoices" in the subtitleCannotSend string across all 10 translation files (en, de, es, fr, it, ja, nl, pl, pt-BR, zh-hans) in 98ec545.

shouldShowOfflineIndicator={false}
onBackButtonPress={() => {
if (isPolicyNotAccessible) {
if (isPolicyNotAccessible && !isMoneyRequest) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MelvinBot This file is no longer reachable after we hid the "Send Invoice" button when there’s no workspace with Invoices enabled.

Please remove this change: && !isMoneyRequest, as it looks out of scope for this PR.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reverted the && !isMoneyRequest change in AccessOrNotFoundWrapper.tsx in b8ebb3d.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@MelvinBot also remove this part from PR Explanation of Change

Fix inconsistent back navigation on money request not-found pages: In PageNotFoundFallback, when isPolicyNotAccessible was true, the back button always called goBackFromWorkspaceSettingPages(), which redirects to the Workspaces list. For money request flows (where there's no owning workspace), this was incorrect — the header back button now falls through to Navigation.goBack() when isMoneyRequest is true, matching the hardware back button behavior.

…end across all translation files

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot MelvinBot requested a review from a team as a code owner May 26, 2026 16:44
@melvin-bot melvin-bot Bot requested review from ahmedGaber93 and removed request for a team May 26, 2026 16:44
@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented May 26, 2026

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

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot
Copy link
Copy Markdown
Contributor Author

No actionable check failures on this PR. The only failing checks are PR Author Checklist and PR Reviewer Checklist, which track manual checkbox completion in the PR description — not code issues.

All other checks (ESLint, TypeScript, tests, Prettier, etc.) are either passing or still running. If any of those fail once the current run completes, feel free to tag me again.

@OSBotify

This comment has been minimized.

@OSBotify

This comment has been minimized.

@ahmedGaber93
Copy link
Copy Markdown
Contributor

@MelvinBot update Tests, offline test, and QA steps to:

  1. Log in with a new account without creating a workspace.
  2. Use the search input and search for type:invoice.
  3. Verify the empty state does not show a “Send invoice” button, and the subtitle reads: You need a workspace with Invoices enabled to send invoices.

@ahmedGaber93
Copy link
Copy Markdown
Contributor

@MelvinBot mark all PR Author checklist as checked

@MelvinBot
Copy link
Copy Markdown
Contributor Author

Updated the Tests, Offline tests, and QA Steps sections with the requested steps per ahmedGaber93's request.

@MelvinBot
Copy link
Copy Markdown
Contributor Author

All PR Author Checklist items have been marked as checked per ahmedGaber93's request.

@ahmedGaber93
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 shown in the product is localized by adding it to src/languages/* files and using the translation method
    • 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 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)
  • 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
  • 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.
  • 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.
  • 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 Screenshot 2026-05-26 at 6 54 46 PM
Android: mWeb Chrome Screenshot 2026-05-26 at 7 08 55 PM
iOS: HybridApp Screenshot 2026-05-26 at 7 13 36 PM
iOS: mWeb Safari Screenshot 2026-05-26 at 7 14 41 PM
MacOS: Chrome / Safari
Screen.Recording.2026-05-26.at.6.42.34.PM.mov
Screen.Recording.2026-05-26.at.6.43.47.PM.mov

@MelvinBot
Copy link
Copy Markdown
Contributor Author

Removed the back navigation fix description from the Explanation of Change section per ahmedGaber93's request.

MelvinBot and others added 2 commits May 26, 2026 21:18
Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
…ternary

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@ahmedGaber93
Copy link
Copy Markdown
Contributor

@MelvinBot Let's also handle hasSeenTour as mentioned here: #90760 (comment)

Co-authored-by: ahmedGaber93 <ahmedGaber93@users.noreply.github.com>
@MelvinBot
Copy link
Copy Markdown
Contributor Author

Handled hasSeenTour for the subtitleCannotSend case in 7377475:

  • When !userCanSendInvoice && hasSeenTour → uses subtitleCannotSend (no test drive mention)
  • When !userCanSendInvoice && !hasSeenTour → uses new subtitleCannotSendWithTestDrive (includes "Take a test drive of Expensify to learn more.")

Added the new translation key across all 10 language files.

@OSBotify
Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index a72e4aa89fd..aa3fc3a1802 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -7711,9 +7711,9 @@ Fügen Sie weitere Ausgabelimits hinzu, um den Cashflow Ihres Unternehmens zu sc
                 `),
                 subtitle: 'Sende eine Rechnung oder mache eine Probefahrt mit Expensify, um mehr zu erfahren.',
                 subtitleWithOnlyCreateButton: 'Verwende die grüne Schaltfläche unten, um eine Rechnung zu senden.',
-                subtitleCannotSend: 'Du benötigst einen Arbeitsbereich mit aktiviertem Invoices, um Rechnungen zu senden.',
+                subtitleCannotSend: 'Sie benötigen einen Workspace mit aktivierten Rechnungen, um Rechnungen zu senden.',
                 subtitleCannotSendWithTestDrive:
-                    'Du benötigst einen Arbeitsbereich mit aktiviertem Invoices, um Rechnungen zu senden. Mache eine Probefahrt mit Expensify, um mehr zu erfahren.',
+                    'Sie benötigen einen Workspace mit aktivierten Rechnungen, um Rechnungen zu senden. Machen Sie eine Probefahrt mit Expensify, um mehr zu erfahren.',
             },
             emptyTripResults: {
                 title: 'Keine Reisen zum Anzeigen',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index ff05ef556d8..6256fafdf06 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -1690,10 +1690,8 @@ const translations: TranslationDeepObject<typeof en> = {
         backdropLabel: 'Fondo del Modal',
     },
     nextStep: {
-        /* eslint-disable @typescript-eslint/no-unused-vars */
         message: {
             [CONST.NEXT_STEP.MESSAGE_KEY.WAITING_TO_ADD_TRANSACTIONS]: (actor, actorType, _eta, _etaType) => {
-                // eslint-disable-next-line default-case
                 switch (actorType) {
                     case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
                         return `Esperando a que <strong>tú</strong> añadas gastos.`;
@@ -1704,7 +1702,6 @@ const translations: TranslationDeepObject<typeof en> = {
                 }
             },
             [CONST.NEXT_STEP.MESSAGE_KEY.WAITING_TO_SUBMIT]: (actor, actorType, _eta, _etaType) => {
-                // eslint-disable-next-line default-case
                 switch (actorType) {
                     case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
                         return `Esperando a que <strong>tú</strong> envíes los gastos.`;
@@ -1716,7 +1713,6 @@ const translations: TranslationDeepObject<typeof en> = {
             },
             [CONST.NEXT_STEP.MESSAGE_KEY.NO_FURTHER_ACTION]: (_actor, _actorType, _eta, _etaType) => `¡No se requiere ninguna acción adicional!`,
             [CONST.NEXT_STEP.MESSAGE_KEY.WAITING_FOR_SUBMITTER_ACCOUNT]: (actor, actorType, _eta, _etaType) => {
-                // eslint-disable-next-line default-case
                 switch (actorType) {
                     case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
                         return `Esperando a que <strong>tú</strong> añadas una cuenta bancaria.`;
@@ -1731,7 +1727,6 @@ const translations: TranslationDeepObject<typeof en> = {
                 if (eta) {
                     formattedETA = etaType === CONST.NEXT_STEP.ETA_TYPE.DATE_TIME ? ` el ${eta} de cada mes` : ` ${eta}`;
                 }
-                // eslint-disable-next-line default-case
                 switch (actorType) {
                     case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
                         return `Esperando a que tus gastos se envíen automáticamente${formattedETA}.`;
@@ -1742,7 +1737,6 @@ const translations: TranslationDeepObject<typeof en> = {
                 }
             },
             [CONST.NEXT_STEP.MESSAGE_KEY.WAITING_TO_FIX_ISSUES]: (actor, actorType, _eta, _etaType) => {
-                // eslint-disable-next-line default-case
                 switch (actorType) {
                     case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
                         return `Esperando a que <strong>tú</strong> soluciones ellos problemas.`;
@@ -1753,7 +1747,6 @@ const translations: TranslationDeepObject<typeof en> = {
                 }
             },
             [CONST.NEXT_STEP.MESSAGE_KEY.WAITING_TO_APPROVE]: (actor, actorType, _eta, _etaType) => {
-                // eslint-disable-next-line default-case
                 switch (actorType) {
                     case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
                         return `Esperando a que <strong>tú</strong> apruebes los gastos.`;
@@ -1764,7 +1757,6 @@ const translations: TranslationDeepObject<typeof en> = {
                 }
             },
             [CONST.NEXT_STEP.MESSAGE_KEY.WAITING_TO_EXPORT]: (actor, actorType, _eta, _etaType) => {
-                // eslint-disable-next-line default-case
                 switch (actorType) {
                     case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
                         return `Esperando a que <strong>tú</strong> exportes este informe.`;
@@ -1775,7 +1767,6 @@ const translations: TranslationDeepObject<typeof en> = {
                 }
             },
             [CONST.NEXT_STEP.MESSAGE_KEY.WAITING_TO_PAY]: (actor, actorType, _eta, _etaType) => {
-                // eslint-disable-next-line default-case
                 switch (actorType) {
                     case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
                         return `Esperando a que <strong>tú</strong> pagues los gastos.`;
@@ -1786,7 +1777,6 @@ const translations: TranslationDeepObject<typeof en> = {
                 }
             },
             [CONST.NEXT_STEP.MESSAGE_KEY.WAITING_FOR_POLICY_BANK_ACCOUNT]: (actor, actorType, _eta, _etaType) => {
-                // eslint-disable-next-line default-case
                 switch (actorType) {
                     case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
                         return `Esperando a que <strong>tú</strong> termines de configurar una cuenta bancaria de empresa.`;
@@ -1806,7 +1796,6 @@ const translations: TranslationDeepObject<typeof en> = {
             [CONST.NEXT_STEP.MESSAGE_KEY.SUBMITTING_TO_SELF]: (_actor, _actorType, _eta, _etaType) =>
                 `¡Ups! Parece que estás enviando el informe a <strong>ti mismo</strong>. Aprobar tus propios informes está <strong>prohibido</strong> por tu espacio de trabajo. Por favor, envía este informe a otra persona o contacta a tu administrador para cambiar la persona a la que lo envías.`,
             [CONST.NEXT_STEP.MESSAGE_KEY.REJECTED_REPORT]: (actor, actorType) => {
-                // eslint-disable-next-line default-case
                 switch (actorType) {
                     case CONST.NEXT_STEP.ACTOR_TYPE.CURRENT_USER:
                         return `Este informe fue rechazado. Esperando a que <strong>tú</strong> corrijas los problemas y lo vuelvas a enviar manualmente.`;
@@ -2462,7 +2451,6 @@ ${amount} para ${merchant} - ${date}`,
                 two: 'º',
                 few: 'º',
                 other: 'º',
-                /* eslint-disable @typescript-eslint/naming-convention */
                 '1': 'Primero',
                 '2': 'Segundo',
                 '3': 'Tercero',
@@ -2473,7 +2461,6 @@ ${amount} para ${merchant} - ${date}`,
                 '8': 'Octavo',
                 '9': 'Noveno',
                 '10': 'Décimo',
-                /* eslint-enable @typescript-eslint/naming-convention */
             },
         },
         approverInMultipleWorkflows: 'Este miembro ya pertenece a otro flujo de aprobación. Cualquier actualización aquí se reflejará allí también.',
@@ -6959,7 +6946,6 @@ ${amount} para ${merchant} - ${date}`,
         restrictedDescription: 'Sólo las personas en tu espacio de trabajo pueden encontrar esta sala',
         privateDescription: 'Sólo las personas que están invitadas a esta sala pueden encontrarla',
         publicDescription: 'Cualquier persona puede unirse a esta sala',
-        // eslint-disable-next-line @typescript-eslint/naming-convention
         public_announceDescription: 'Cualquier persona puede unirse a esta sala',
         createRoom: 'Crea una sala de chat',
         roomAlreadyExistsError: 'Ya existe una sala con este nombre',
@@ -6979,7 +6965,6 @@ ${amount} para ${merchant} - ${date}`,
             restricted: 'Espacio de trabajo',
             private: 'Privada',
             public: 'Público',
-            // eslint-disable-next-line @typescript-eslint/naming-convention
             public_announce: 'Anuncio Público',
         },
     },
@@ -7294,7 +7279,6 @@ ${amount} para ${merchant} - ${date}`,
         updatedDefaultTitle: (newDefaultTitle, oldDefaultTitle) => `cambió la fórmula personalizada del nombre del informe a "${newDefaultTitle}" (previamente "${oldDefaultTitle}")`,
         updatedOwnership: (oldOwnerEmail, oldOwnerName, policyName) => `asumió la propiedad del espacio de trabajo ${policyName} de ${oldOwnerName} (${oldOwnerEmail})`,
         updatedAutoHarvesting: (enabled) => `${enabled ? 'habilitó' : 'deshabilitó'} el envío programado`,
-        // eslint-disable-next-line @typescript-eslint/max-params
         updatedIndividualBudgetNotification: (
             budgetAmount,
             budgetFrequency,
@@ -7554,8 +7538,8 @@ ${amount} para ${merchant} - ${date}`,
                 title: 'Aún no has creado \nninguna factura',
                 subtitle: 'Envía una factura o haz una prueba por Expensify para aprender más.',
                 subtitleWithOnlyCreateButton: 'Usa el botón verde de abajo para enviar una factura.',
-                subtitleCannotSend: 'Necesitas un espacio de trabajo con Invoices habilitado para enviar facturas.',
-                subtitleCannotSendWithTestDrive: 'Necesitas un espacio de trabajo con Invoices habilitado para enviar facturas. Haz una prueba por Expensify para aprender más.',
+                subtitleCannotSend: 'Necesitas un espacio de trabajo con la función de facturas habilitada para enviar facturas.',
+                subtitleCannotSendWithTestDrive: 'Necesitas un espacio de trabajo con Facturas habilitadas para enviar facturas. Haz una prueba de Expensify para aprender más.',
             },
             emptyTripResults: {
                 title: 'No tienes viajes',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index 35951d4d5ae..68cfb87ec5e 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -7733,8 +7733,9 @@ Ajoutez davantage de règles de dépenses pour protéger la trésorerie de l’e
                 `),
                 subtitle: 'Envoyez une facture ou faites un essai d’Expensify pour en savoir plus.',
                 subtitleWithOnlyCreateButton: 'Utilisez le bouton vert ci-dessous pour envoyer une facture.',
-                subtitleCannotSend: "Vous avez besoin d'un espace de travail avec Invoices activé pour envoyer des factures.",
-                subtitleCannotSendWithTestDrive: "Vous avez besoin d'un espace de travail avec Invoices activé pour envoyer des factures. Faites un essai d'Expensify pour en savoir plus.",
+                subtitleCannotSend: 'Vous devez disposer d’un espace de travail avec les factures activées pour envoyer des factures.',
+                subtitleCannotSendWithTestDrive:
+                    'Vous avez besoin d’un espace de travail avec les factures activées pour envoyer des factures. Faites un essai d’Expensify pour en savoir plus.',
             },
             emptyTripResults: {
                 title: 'Aucun voyage à afficher',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index 7c310e0667b..89a50e2f4f3 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -7702,8 +7702,8 @@ Aggiungi altre regole di spesa per proteggere il flusso di cassa aziendale.`,
                 `),
                 subtitle: 'Invia una fattura o fai un giro di prova con Expensify per saperne di più.',
                 subtitleWithOnlyCreateButton: 'Usa il pulsante verde qui sotto per inviare una fattura.',
-                subtitleCannotSend: 'Hai bisogno di uno spazio di lavoro con Invoices abilitato per inviare fatture.',
-                subtitleCannotSendWithTestDrive: 'Hai bisogno di uno spazio di lavoro con Invoices abilitato per inviare fatture. Fai un giro di prova con Expensify per saperne di più.',
+                subtitleCannotSend: 'Ti serve uno spazio di lavoro con le Fatture abilitate per inviare fatture.',
+                subtitleCannotSendWithTestDrive: 'Ti serve uno spazio di lavoro con le Fatture abilitate per inviare fatture. Fai un test drive di Expensify per saperne di più.',
             },
             emptyTripResults: {
                 title: 'Nessun viaggio da visualizzare',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index c16fc933273..3c1693b2a06 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -7608,8 +7608,8 @@ ${reportName}
                 `),
                 subtitle: '請求書を送信するか、Expensify を試用してさらに詳しく知りましょう。',
                 subtitleWithOnlyCreateButton: '下の緑色のボタンを使って請求書を送信してください。',
-                subtitleCannotSend: '請求書を送信するには、Invoicesが有効なワークスペースが必要です。',
-                subtitleCannotSendWithTestDrive: '請求書を送信するには、Invoicesが有効なワークスペースが必要です。Expensify を試用してさらに詳しく知りましょう。',
+                subtitleCannotSend: '請求書を送信するには、請求書機能が有効になっているワークスペースが必要です。',
+                subtitleCannotSendWithTestDrive: '請求書を送信するには、請求書機能が有効になっているワークスペースが必要です。詳しく知るには、Expensify をお試しください。',
             },
             emptyTripResults: {
                 title: '表示する出張はありません',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 1ed656734cd..505c4c8c152 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -7673,8 +7673,9 @@ er bestedingsregels toe om de kasstroom van het bedrijf te beschermen.`,
                 `),
                 subtitle: 'Stuur een factuur of maak een testrit met Expensify om meer te weten te komen.',
                 subtitleWithOnlyCreateButton: 'Gebruik de groene knop hieronder om een factuur te versturen.',
-                subtitleCannotSend: 'Je hebt een werkruimte met Invoices ingeschakeld nodig om facturen te versturen.',
-                subtitleCannotSendWithTestDrive: 'Je hebt een werkruimte met Invoices ingeschakeld nodig om facturen te versturen. Maak een testrit met Expensify om meer te weten te komen.',
+                subtitleCannotSend: 'Je hebt een werkruimte met Facturen ingeschakeld nodig om facturen te versturen.',
+                subtitleCannotSendWithTestDrive:
+                    'Je hebt een werkruimte met Facturen ingeschakeld nodig om facturen te versturen. Maak een proefrit met Expensify om meer te weten te komen.',
             },
             emptyTripResults: {
                 title: 'Geen reizen om weer te geven',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 7062684d22d..9940d415833 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -7665,8 +7665,8 @@ Dodaj więcej zasad wydatków, żeby chronić płynność finansową firmy.`,
                 `),
                 subtitle: 'Wyślij fakturę lub wypróbuj Expensify, aby dowiedzieć się więcej.',
                 subtitleWithOnlyCreateButton: 'Użyj zielonego przycisku poniżej, aby wysłać fakturę.',
-                subtitleCannotSend: 'Potrzebujesz przestrzeni roboczej z włączonym Invoices, aby wysyłać faktury.',
-                subtitleCannotSendWithTestDrive: 'Potrzebujesz przestrzeni roboczej z włączonym Invoices, aby wysyłać faktury. Wypróbuj Expensify, aby dowiedzieć się więcej.',
+                subtitleCannotSend: 'Żeby wysyłać faktury, potrzebujesz przestrzeni roboczej z włączonymi fakturami.',
+                subtitleCannotSendWithTestDrive: 'Potrzebujesz przestrzeni roboczej z włączonymi fakturami, żeby wysyłać faktury. Wypróbuj Expensify, żeby dowiedzieć się więcej.',
             },
             emptyTripResults: {
                 title: 'Brak podróży do wyświetlenia',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 2bfb4c70886..7f42b9143cf 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -7667,8 +7667,8 @@ Adicione mais regras de gasto para proteger o fluxo de caixa da empresa.`,
                 `),
                 subtitle: 'Envie uma fatura ou faça um test drive do Expensify para saber mais.',
                 subtitleWithOnlyCreateButton: 'Use o botão verde abaixo para enviar uma fatura.',
-                subtitleCannotSend: 'Você precisa de um espaço de trabalho com Invoices habilitado para enviar faturas.',
-                subtitleCannotSendWithTestDrive: 'Você precisa de um espaço de trabalho com Invoices habilitado para enviar faturas. Faça um test drive do Expensify para saber mais.',
+                subtitleCannotSend: 'Você precisa de um workspace com Faturas ativadas para enviar faturas.',
+                subtitleCannotSendWithTestDrive: 'Você precisa de um workspace com Faturas ativadas para enviar faturas. Faça um test drive do Expensify para saber mais.',
             },
             emptyTripResults: {
                 title: 'Nenhuma viagem para exibir',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 2f66b26e38e..a92ae675fb0 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -7473,8 +7473,8 @@ ${reportName}
                 `),
                 subtitle: '发送发票或试用 Expensify,了解更多信息。',
                 subtitleWithOnlyCreateButton: '使用下方的绿色按钮发送发票。',
-                subtitleCannotSend: '您需要一个启用了Invoices的工作区才能发送发票。',
-                subtitleCannotSendWithTestDrive: '您需要一个启用了Invoices的工作区才能发送发票。试用 Expensify,了解更多信息。',
+                subtitleCannotSend: '您需要一个启用了发票功能的工作区才能发送发票。',
+                subtitleCannotSendWithTestDrive: '你需要一个启用了发票功能的工作区才能发送发票。试用 Expensify,了解更多信息。',
             },
             emptyTripResults: {
                 title: '没有行程可显示',

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

Copy link
Copy Markdown
Contributor

@ahmedGaber93 ahmedGaber93 left a comment

Choose a reason for hiding this comment

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

LGTM!

@melvin-bot
Copy link
Copy Markdown

melvin-bot Bot commented May 27, 2026

We did not find an internal engineer to review this PR, trying to assign a random engineer to #89259 as well as to this PR... Please reach out for help on Slack if no one gets assigned!

@melvin-bot melvin-bot Bot requested a review from dangrous May 27, 2026 14:19
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