Skip to content

Add PlusMinus icon and allow negative values in MoneyRequestAmountInput#56092

Merged
nkuoch merged 94 commits intoExpensify:mainfrom
callstack-internal:feature/allow-negative
Jun 20, 2025
Merged

Add PlusMinus icon and allow negative values in MoneyRequestAmountInput#56092
nkuoch merged 94 commits intoExpensify:mainfrom
callstack-internal:feature/allow-negative

Conversation

@pasyukevich
Copy link
Member

@pasyukevich pasyukevich commented Jan 30, 2025

Explanation of Change

Fixed Issues

$ #53441
PROPOSAL:

Tests

📱 Mobile

1️⃣ Verify negative expense cannot be created without a workspace

(account without workspaces needed)

  • Open the Create Expense screen.
  • Enter an amount and press Flip.
  • Verify that a minus sign appears before the currency.
  • Press Next.
  • Verify that you cannot proceed because a workspace is required.

2️⃣ Verify negative value functionality

(workspace required before running this test)

  • Open the Create Expense screen.
  • Enter an amount and press Flip.
  • Verify that a minus sign appears before the currency.
  • Press Next.
  • Verify that the selected workspace is the receiver.
  • Confirm the amount is negative on the current screen and submit the expense.
  • Open the newly created expense.
  • Verify that the amount has a minus sign.
  • Tap the amount and confirm that the minus sign appears before the currency.
  • Enter a new amount, press Flip, and submit.
  • Verify that the updated value is correct.
  • Verify that the update confirmation message is correct.

3️⃣ Verify negative value option is hidden for DM

  • Open DM.
  • Open the Create Expense screen.
  • Verify that the Flip button is hidden.

4️⃣ Verify negative value option is hidden for Split Bill

  • Start creating a Split Bill.
  • Verify that the Flip button is disabled.
  • Complete creation of the Split Bill.
  • Open the created Split Bill.
  • Update the amount.
  • Verify that the amount updated correctly and the history comment is accurate.

💻 Desktop

⚠️ Note: No Flip button — negative value input is manual using -.


1️⃣ Verify negative expense cannot be created without a workspace

(account without workspaces needed)

  • Open the Create Expense screen.
  • Place the cursor at the start of the amount field and enter - followed by a number.
  • Verify that a minus sign appears before the currency.
  • Press Next.
  • Verify that you cannot proceed because a workspace is required.

2️⃣ Verify negative value functionality

(workspace required before running this test)

  • Open the Create Expense screen.
  • Place the cursor at the start of the amount field and enter - followed by a number.
  • Verify that a minus sign appears before the currency.
  • Press Next.
  • Verify that the selected workspace is the receiver.
  • Confirm the amount is negative on the current screen and submit the expense.
  • Open the newly created expense.
  • Verify that the amount has a minus sign.
  • Edit the amount and confirm that the minus sign appears before the currency in the input field.
  • Enter a new amount with - and submit.
  • Verify that the updated value is correct.
  • Verify that the update confirmation message is correct.

3️⃣ Verify negative value option is hidden for DM

  • Open DM.
  • Open the Create Expense screen.
  • Attempt to enter -.
  • Verify that:
    • The minus sign is ignored or blocked

4️⃣ Verify negative value option is hidden for Split Bill

  • Start creating a Split Bill.

  • Attempt to enter - in the amount field.

  • Verify that:

    • The minus sign is ignored
  • Complete creation of the Split Bill.

  • Open the created Split Bill.

  • Update the amount (without minus).

  • Verify that the amount updated correctly and the history comment is accurate.

  • Verify that no errors appear in the JS console

Offline 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 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 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-native-converted.webm
Android: mWeb Chrome
android-web-converted.webm
iOS: Native
ios-native-converted.mp4
iOS: mWeb Safari
ios-web-converted.mp4
MacOS: Chrome / Safari
mac-web-converted.mov
MacOS: Desktop
mac-native-converted.mov

… currency flipping and improve amount validation
…to use updated utility functions and improve code clarity
@pasyukevich pasyukevich changed the title [WIP] Add PlusMinus icon and allow negative values in MoneyRequestAmountInput Add PlusMinus icon and allow negative values in MoneyRequestAmountInput Feb 7, 2025
@melvin-bot
Copy link

melvin-bot bot commented Feb 7, 2025

Hey! I see that you made changes to our Form component. Make sure to update the docs in FORMS.md accordingly. Cheers!

@pasyukevich pasyukevich marked this pull request as ready for review February 10, 2025 15:01
@pasyukevich pasyukevich requested review from a team as code owners February 10, 2025 15:01
@melvin-bot melvin-bot bot requested a review from ZhenjaHorbach February 10, 2025 15:01
@melvin-bot
Copy link

melvin-bot bot commented Feb 10, 2025

@ZhenjaHorbach 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 February 10, 2025 15:02
pasyukevich added a commit to callstack-internal/Expensify-App that referenced this pull request Jun 25, 2025
…ature/allow-negative"

This reverts commit 146dd00, reversing
changes made to b150b13.
techievivek added a commit that referenced this pull request Jun 25, 2025
[CP Stag]Revert "Merge pull request #56092 from callstack-internal/feature/all…
Julesssss added a commit that referenced this pull request Jun 25, 2025
* main: (586 commits)
  Update Mobile-Expensify submodule version to 9.1.71-4
  Update version to 9.1.71-4
  rename variable
  Update redirects.csv
  Update Mobile-Expensify submodule version to 9.1.71-3
  Update version to 9.1.71-3
  Update Mobile-Expensify submodule version to 9.1.71-2
  Update version to 9.1.71-2
  Revert "Merge pull request #56092 from callstack-internal/feature/allow-negative"
  fix: start test drive close the modal and do nothing
  Update src/hooks/useLoadingBarVisibility.ts
  fix can't scroll accounting selection
  ts
  same on ios
  Make previous rollout adjustment non-critical
  add fallbakc
  Update Mobile-Expensify submodule version to 9.1.71-1
  Update version to 9.1.71-1
  more memory for desktop build
  Update Mobile-Expensify submodule version to 9.1.71-0
  ...
roryabraham pushed a commit that referenced this pull request Jun 25, 2025
[CP Stag]Revert "Merge pull request #56092 from callstack-internal/feature/all…

(cherry picked from commit bc44aaf)

(cherry-picked to staging by roryabraham)
pasyukevich added a commit to callstack-internal/Expensify-App that referenced this pull request Jun 26, 2025
@github-actions
Copy link
Contributor

🚀 Deployed to production by https://github.com/chiragsalian in version: 9.1.71-11 🚀

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

@github-actions
Copy link
Contributor

🚀 Deployed to staging by https://github.com/nkuoch in version: 9.1.72-0 🚀

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

1 similar comment
@github-actions
Copy link
Contributor

🚀 Deployed to staging by https://github.com/nkuoch in version: 9.1.72-0 🚀

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

@mitarachim mitarachim mentioned this pull request Jun 29, 2025
8 tasks
@github-actions
Copy link
Contributor

🚀 Deployed to production by https://github.com/puneetlath in version: 9.1.72-10 🚀

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

Copilot AI added a commit that referenced this pull request Jul 7, 2025
Co-authored-by: nkuoch <2463975+nkuoch@users.noreply.github.com>
Copilot AI added a commit that referenced this pull request Jul 7, 2025
…6092

Co-authored-by: nkuoch <2463975+nkuoch@users.noreply.github.com>
luacmartins added a commit that referenced this pull request Oct 8, 2025
…ive-2

Reapply "Merge pull request #56092 from callstack-internal/feature/al…
@OSBotify
Copy link
Contributor

OSBotify commented Oct 8, 2025

🚀 Deployed to staging by https://github.com/nkuoch in version: 9.2.28-0 🚀

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

@OSBotify
Copy link
Contributor

🚀 Deployed to production by https://github.com/lakchote in version: 9.2.28-5 🚀

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants