App icon indicating copy to clipboard operation
App copied to clipboard

Skip confirmation page for Quick Actions

Open Gonals opened this issue 1 year ago • 35 comments

Details

Fixed Issues

$ https://github.com/Expensify/App/issues/38051 PROPOSAL:

Tests

  1. Log into Newdot

  2. Create a manual money request from someone

  3. Confirm it displays in the Quick Action Button (QAB): Screenshot 2024-04-04 at 7 02 18 PM

  4. Click the QAB. It should take you to create a new manual request. After entering the amount, the request should be created immediately, without asking for confirmation. The Button should say "Request" instead of "Next": Screenshot 2024-04-04 at 7 02 29 PM

  5. Repeat steps 2-4, but with a Scan request. The request should be created automatically after you add the image.

  6. Repeat steps 2-4, but with a Distance request. The request should be created automatically after you select the distance and click the button.

  7. Repeat steps 2-4 for Send Money. The money should be sent without asking for confirmation, and the button should say "Pay Elsewhere/With expensify" depending on your setup: Screenshot 2024-04-04 at 7 04 16 PM

  8. Repeat steps 2-4, but requesting from a workspace. In this case, it should ask for confirmation.

  9. Repeat steps 5, but requesting from a workspace. The request should be created automatically after you add the image.

  10. Repeat steps 6, but requesting from a workspace. The request should be created automatically after you add the image.

  11. Repeat steps 2-4, but splitting the request. After entering the amount, the request should be created immediately, and the button should say Split: Screenshot 2024-04-04 at 7 16 54 PM

  12. Repeat steps 5, but splitting the request. The request should be created automatically after you add the image.

  13. Create a task from the global create button.

  14. The QAB should now be set to Assign Task

  15. Confirm the Assign Task flow skips the confirmation page

Note: Split distance doesn't work correctly. This is an unrelated, known issue

  • [x] Verify that no errors appear in the JS console

Offline tests

None

QA Steps

Same as tests

  • [ ] Verify that no errors appear in the JS console

PR Author Checklist

  • [x] I linked the correct issue in the ### Fixed Issues section above
  • [x] I wrote clear testing steps that cover the changes made in this PR
    • [x] I added steps for local testing in the Tests section
    • [x] I added steps for the expected offline behavior in the Offline steps section
    • [x] I added steps for Staging and/or Production testing in the QA steps section
    • [x] I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • [x] 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)
    • [x] 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).
  • [x] I included screenshots or videos for tests on all platforms
  • [x] I ran the tests on all platforms & verified they passed on:
    • [x] Android: Native
    • [x] Android: mWeb Chrome
    • [x] iOS: Native
    • [x] iOS: mWeb Safari
    • [x] MacOS: Chrome / Safari
    • [x] MacOS: Desktop
  • [x] 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)
  • [x] I followed proper code patterns (see Reviewing the code)
    • [x] 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)
    • [x] I verified that the left part of a conditional rendering a React component is a boolean and NOT a string, e.g. myBool && <MyComponent />.
    • [x] I verified that comments were added to code that is not self explanatory
    • [x] 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.
    • [x] I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • [x] If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • [x] I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • [x] 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)
    • [x] 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.
    • [x] I verified the JSDocs style guidelines (in STYLE.md) were followed
  • [x] If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • [x] I followed the guidelines as stated in the Review Guidelines
  • [x] 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)
  • [x] I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • [x] I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • [x] I verified that if a function's arguments changed that all usages have also been updated correctly
  • [x] If any new file was added I verified that:
    • [x] 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
  • [x] If a new CSS style is added I verified that:
    • [x] A similar style doesn't already exist
    • [x] The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • [x] 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.
  • [x] 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)
  • [x] 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.
  • [x] 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.
  • [x] 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:
    • [x] I verified that all the inputs inside a form are aligned with each other.
    • [x] I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • [x] 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.
  • [x] 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
MacOS: Desktop

Gonals avatar Apr 02 '24 15:04 Gonals

@c3024 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[bot] avatar Apr 02 '24 15:04 melvin-bot[bot]

Please merge main as the version in package.json is old and backend sends an error asking to update.

c3024 avatar Apr 03 '24 06:04 c3024

Please merge main as the version in package.json is old and backend sends an error asking to update.

This is still in WIP, so no need to review for now

Gonals avatar Apr 03 '24 11:04 Gonals

@c3024, this is OFF WIP and ready for review. I can't give you access to the design doc, but I think the instructions are pretty self-explanatory. Let me know if you need additional context

Gonals avatar Apr 04 '24 17:04 Gonals

  1. Repeat steps 2-4, but with a Distance request. The request should be created automatically after you select the distance and click the button.

One-to-one distance request can be made from FAB but from the DM and from the QAB distance tab is missing for a one-to-one request.

https://github.com/Expensify/App/assets/102477862/e13f8f9d-c09e-4a63-b5ae-ce38ed23ca9e

c3024 avatar Apr 05 '24 06:04 c3024

Not related to QAB but split requests are created in different group chats instead of all being created in the same chat.

https://github.com/Expensify/App/assets/102477862/59885e31-3249-498a-9ae6-732944e0476b

c3024 avatar Apr 05 '24 07:04 c3024

There are changes in task files but no tests specified. Is skip confirmation for tasks WIP?

c3024 avatar Apr 05 '24 11:04 c3024

Margin/padding between num pad and Pay Elsewhere button is less here compared to that between numpad and Next in normal flow.

Screenshot 2024-04-05 at 4 55 45 PM

Screenshot 2024-04-05 at 4 55 29 PM

c3024 avatar Apr 05 '24 11:04 c3024

Not related to QAB but split requests are created in different group chats instead of all being created in the same chat.

qabSplitRequestManual.mp4

Yeah, I noticed. I believe this is being worked on in a different project

Gonals avatar Apr 08 '24 12:04 Gonals

  1. Repeat steps 2-4, but with a Distance request. The request should be created automatically after you select the distance and click the button.

One-to-one distance request can be made from FAB but from the DM and from the QAB distance tab is missing for a one-to-one request.

distanceTabMissing.mp4

Ah, I think you need to be in the beta. You cn remove the canUseP2PDistanceRequests check in IOURequestStartPage for testing purposes.

Gonals avatar Apr 08 '24 15:04 Gonals

There are changes in task files but no tests specified. Is skip confirmation for tasks WIP?

Added test instructions 👍

Gonals avatar Apr 08 '24 15:04 Gonals

  1. Repeat steps 2-4, but with a Distance request. The request should be created automatically after you select the distance and click the button.

One-to-one distance request can be made from FAB but from the DM and from the QAB distance tab is missing for a one-to-one request. distanceTabMissing.mp4

Ah, I think you need to be in the beta. You cn remove the canUseP2PDistanceRequests check in IOURequestStartPage for testing purposes.

Or just test requesting from a workspace, instead of an individual

Gonals avatar Apr 08 '24 16:04 Gonals

@c3024 Comments addressed!

Gonals avatar Apr 08 '24 16:04 Gonals

Creating task from QAB creates a duplicate optimistic report action and then removes previous report actions.

https://github.com/Expensify/App/assets/102477862/e6621dc8-ff20-41be-91ce-fa755334c9b2

Everything else tests well on Chrome. Will test on other platforms.

c3024 avatar Apr 09 '24 11:04 c3024

Creating task from QAB creates a duplicate optimistic report action and then removes previous report actions.

qabTask.mp4 Everything else tests well on Chrome. Will test on other platforms.

I'm not seeing this behavior in Chrome. I just merged some recent task-related changes, so that might be it. Can you give it another try?

Gonals avatar Apr 09 '24 17:04 Gonals

Creating task from QAB creates a duplicate optimistic report action and then removes previous report actions. qabTask.mp4 Everything else tests well on Chrome. Will test on other platforms.

I'm not seeing this behavior in Chrome. I just merged some recent task-related changes, so that might be it. Can you give it another try?

This was for assigning task to oneself in the self DM. I will check again.

c3024 avatar Apr 09 '24 17:04 c3024

This check here https://github.com/Expensify/App/blob/b9bd07fcbf13ad517a0b42b5a4dc4abafefb91f7/src/libs/ReportUtils.ts#L5166 is failing with assigneeReportID as string and parentReportID as number adding a duplicate report action when assigning task to oneself in their own DM with QAB. Screenshot 2024-04-10 at 12 02 07 AM

Screenshot 2024-04-09 at 11 50 19 PM

I wonder why TypeScript did not complain.

Also there is a typecheck failure for Task.clearOutTaskInfoAndNavigate()

c3024 avatar Apr 09 '24 18:04 c3024

This check here

https://github.com/Expensify/App/blob/b9bd07fcbf13ad517a0b42b5a4dc4abafefb91f7/src/libs/ReportUtils.ts#L5166

is failing with assigneeReportID as string and parentReportID as number adding a duplicate report action when assigning task to oneself in their own DM with QAB. Screenshot 2024-04-10 at 12 02 07 AM Screenshot 2024-04-09 at 11 50 19 PM

I wonder why TypeScript did not complain.

Also there is a typecheck failure for Task.clearOutTaskInfoAndNavigate()

Huh. I still can't reproduce the issue with the selfDM. It works just fine for me, but I can fix the type discrepancy and see if that fixes it for you

Gonals avatar Apr 09 '24 21:04 Gonals

This check here https://github.com/Expensify/App/blob/b9bd07fcbf13ad517a0b42b5a4dc4abafefb91f7/src/libs/ReportUtils.ts#L5166

is failing with assigneeReportID as string and parentReportID as number adding a duplicate report action when assigning task to oneself in their own DM with QAB. Screenshot 2024-04-10 at 12 02 07 AM Screenshot 2024-04-09 at 11 50 19 PM I wonder why TypeScript did not complain. Also there is a typecheck failure for Task.clearOutTaskInfoAndNavigate()

Huh. I still can't reproduce the issue with the selfDM. It works just fine for me, but I can fix the type discrepancy and see if that fixes it for you

Actually, as far as I can tell, they should both be strings in this flow too 😕. I've fixed the clearOutTaskInfoAndNavigate issue. Let's see if that helps on your side? I can't seem to reproduce the problem in selfDM either 🤷

Gonals avatar Apr 09 '24 22:04 Gonals

I am still getting that bug not just for DMs.

https://github.com/Expensify/App/assets/102477862/91bbda41-41a5-47bd-a869-b6275ddf9f6d

https://github.com/Expensify/App/assets/102477862/b95f5d19-9480-40d9-85c5-a38b4a4a7a82

Screenshot 2024-04-10 at 10 35 34 AM

It looks like backend sends it as number. But I don't see any warnings or errors anywhere. Could you check if it is so?

Otherwise I will continue testing and finish the checklist and we can fix it later if someone else also sees this bug.

c3024 avatar Apr 10 '24 05:04 c3024

Theeeere we go. I was able to reproduce the issue when logging out and then back in after taking the original action. Looking into it

Gonals avatar Apr 10 '24 12:04 Gonals

This is a backend issue for sure, so let's keep moving for now, while I figure out the fix

Gonals avatar Apr 10 '24 12:04 Gonals

Ok! I figured out the issue and I have a fix in place. We can complete the review on this one in parallel with the other fix

Gonals avatar Apr 10 '24 12:04 Gonals

Some new changes have broken send money, and distance requests because report is undefined and this returns early.

https://github.com/Expensify/App/blob/b394f3d7803cf14df71dbcdee56860af14de0194/src/pages/iou/request/step/IOURequestStepConfirmation.tsx#L436

https://github.com/Expensify/App/assets/102477862/4433d607-38e0-4da1-b2be-73d20a6cfdd9

Screenshot 2024-04-10 at 10 45 47 PM

c3024 avatar Apr 10 '24 17:04 c3024

Some new changes have broken send money, and distance requests because report is undefined and this returns early.

https://github.com/Expensify/App/blob/b394f3d7803cf14df71dbcdee56860af14de0194/src/pages/iou/request/step/IOURequestStepConfirmation.tsx#L436

sendMoneyFailing.mp4 Screenshot 2024-04-10 at 10 45 47 PM

So many people touching this area these days 😓. On it

Gonals avatar Apr 10 '24 18:04 Gonals

Some new changes have broken send money, and distance requests because report is undefined and this returns early.

https://github.com/Expensify/App/blob/b394f3d7803cf14df71dbcdee56860af14de0194/src/pages/iou/request/step/IOURequestStepConfirmation.tsx#L436

sendMoneyFailing.mp4 Screenshot 2024-04-10 at 10 45 47 PM

Oh, not QAB flows, the whole flows! Let me look into that

Gonals avatar Apr 10 '24 18:04 Gonals

@c3024, the send money and distance flows are now fixed. Feel free to continue testing while I fight typescript (2 files got migrated)

Gonals avatar Apr 11 '24 16:04 Gonals

@c3024 All ready! Let's see if we can merge this before more conflicts appear! 😆

Gonals avatar Apr 11 '24 20:04 Gonals

QAB with skip confirm for split bill throws an error saying participants is undefined in splitBillAndOpenReport in IOU

https://github.com/Expensify/App/assets/102477862/28b9ce50-2f4a-4f76-92e7-6b37c0401937

participants is correctly logged just before here

https://github.com/Expensify/App/blob/aeb636f6810c12e9d576b3276201b368375c95eb/src/pages/iou/request/step/IOURequestStepAmount.js#L174

but in the splitBillAndOpenReport in IOU it is logged as undefined.

Another minor issue is there is no sound if we create a transaction with QAB with skip confirmation. In the existing QAB flow, there are sounds on transactions.

Apart from these, all tested well on Chrome.

c3024 avatar Apr 12 '24 05:04 c3024

QAB with skip confirm for split bill throws an error saying participants is undefined in splitBillAndOpenReport in IOU

splitBillAndOpenReportError.mp4 participants is correctly logged just before here

https://github.com/Expensify/App/blob/aeb636f6810c12e9d576b3276201b368375c95eb/src/pages/iou/request/step/IOURequestStepAmount.js#L174

but in the splitBillAndOpenReport in IOU it is logged as undefined.

Another minor issue is there is no sound if we create a transaction with QAB with skip confirmation. In the existing QAB flow, there are sounds on transactions.

Apart from these, all tested well on Chrome.

Likely something related to the latest merge. On it

Gonals avatar Apr 12 '24 08:04 Gonals