App
App copied to clipboard
Prevent going back to participant page when categorizing
Explanation of Change
Prevent going back to participant page when categorizing
Fixed Issues
$ https://github.com/Expensify/App/issues/53274 https://github.com/Expensify/App/issues/53318 PROPOSAL:
Tests
- https://github.com/Expensify/App/issues/53274
- Login with a new account
- Create two new workspaces
- Create a track expense
- Categorize it
- Select a category
- On the confirmation page, click on the back button
- Verify that the category page is displayed
- https://github.com/Expensify/App/issues/53318 (only Android/IOS app)
Precondition:
- Device font size should be small.
- Account has no workspace.
- Create a track expense
- Categorize it
- On the upgrade page, click on the upgrade button
- Verify that the success message is center-aligned
- [x] Verify that no errors appear in the JS console
Offline tests
Same
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
- https://github.com/Expensify/App/issues/53274
- Login with a new account
- Create two new workspaces
- Create a track expense
- Categorize it
- Select a category
- On the confirmation page, click on the back button
- Verify that the category page is displayed
- https://github.com/Expensify/App/issues/53318 (only Android/IOS app)
Precondition:
- Device font size should be small.
- Account has no workspace.
- Create a track expense
- Categorize it
- On the upgrade page, click on the upgrade button
- Verify that the success message is center-aligned
- [x] Verify that no errors appear in the JS console
PR Author Checklist
- [x] I linked the correct issue in the
### Fixed Issuessection above - [x] I wrote clear testing steps that cover the changes made in this PR
- [x] I added steps for local testing in the
Testssection - [x] I added steps for the expected offline behavior in the
Offline stepssection - [x] I added steps for Staging and/or Production testing in the
QA stepssection - [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 added steps for local testing in the
- [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.
toggleReportand notonIconClick) - [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 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:
- [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] 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.
- [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 usingAvatarare 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.ts 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
Avataris modified, I verified thatAvataris 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
Designlabel and/or tagged@Expensify/designso the design team can review the changes.
- [x] If a new page is added, I verified it's using the
ScrollViewcomponent to make it scrollable when more elements are added to the page. - [x] I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
- [x] If the
mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.
Screenshots/Videos
Android: Native
https://github.com/user-attachments/assets/9171fcd0-e17c-4d36-b5a6-e42b3b61da98
Android: mWeb Chrome
https://github.com/user-attachments/assets/ca788ce7-c6d6-4ea2-996d-7075b73a2591
iOS: Native
https://github.com/user-attachments/assets/3bb345d3-e85a-4ce4-8e18-8d054e48d6cf
iOS: mWeb Safari
https://github.com/user-attachments/assets/247cac59-14e1-4306-bd68-2eee2c1132da
MacOS: Chrome / Safari
https://github.com/user-attachments/assets/09b30572-4f0b-4ba8-a5ac-b2ee188fe881
MacOS: Desktop
https://github.com/user-attachments/assets/fb463fc8-0424-426a-86dd-a4c70666f3d4
@Ollyws 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]
Wouldn't it make more sense that pressing back here takes us back to the category select page?
@trjExpensify What do you think?
Yes, that's what I would expect. If you go back from the category list, then we close the RHP and NOT show a workspace list.
@Ollyws All good now.
Yes, that's what I would expect. If you go back from the category list, then we close the RHP and NOT show a workspace list.
This is working fine when we're going back from the category list, but when we go back from the submit page it closes the panel instead of going back to the category list:
https://github.com/user-attachments/assets/141e19ea-6019-4ef2-9a5e-e72fc8d8fe98
Right, I agree if you go back from the confirmation page it should take you to the category list. If you go back from the category list, it closes the RHP.
@Ollyws When we are from the category step we always closeAndNavigate to the confirmation step. Then I think it's good to close the RHP in confirmation in this case because if in the confirmation step we click on category item to open the category step and click the back button two times, it also closes the RHP.
https://github.com/Expensify/App/blob/ce282d38777e9e0a267e1b6f44bff9c4aace98ee/src/pages/iou/request/step/IOURequestStepCategory.tsx#L130-L133
cc @trjExpensify
https://github.com/user-attachments/assets/15a36556-bd04-4131-96e4-8e277e2bf533
What's your opinion on the behaviour in this video @trjExpensify ?
Yeah, my expectation was:
- Click "categorize it"
- Upgrade to a workspace to unlock categories
- Choose a category
- Land on the confirmation page
- Go back
- Choose a category
- Go back
- Close the RHP
Whereas, what appears to be happening is:
- Click "categorize it"
- Upgrade to a workspace to unlock categories
- Choose a category
- Land on the confirmation page
- Go back
- Close the RHP
I prefer the first, but I'm not super passionate. Is @nkdengineer basically saying that because this is the same category selector on the confirmation page, we don't navigate back to it when you go back from there ordinarily. CC: @luacmartins @mountiny if you have any strong opinions on this.
I agree that the first option @trjExpensify laid out is better.
Same as Tom and Carlos
@nkdengineer Can you please update the PR based on that expected outcome? thanks!
I updated with this approach. However, I noticed that the animation is different when we click on the category section of the confirmation page for the first time.
@trjExpensify cc @mountiny @Ollyws
https://github.com/user-attachments/assets/ce12511d-0311-45b1-a4b5-c297ab01735f
@nkdengineer That is not right, we should be pushing that screen in.
@mountiny Currently, we're using closeAndNavigate then this bug will not happen.
https://github.com/Expensify/App/blob/37105a1b4c60ba6416b3ae3415c2265a53c55257/src/pages/iou/request/step/IOURequestStepCategory.tsx#L131
But we need to use navigate instead because we want this behavior.
After that when we navigate to this screen, the animation is wrong because the screen is existed https://github.com/Expensify/App/blob/37105a1b4c60ba6416b3ae3415c2265a53c55257/src/components/MoneyRequestConfirmationListFooter.tsx#L432
I feel like there must be a way to achieve this @adamgrzybowski @WojtekBoman in case you have an idea on how to achieve this flow in the RHP
Yeah, my expectation was:
- Click "categorize it"
- Upgrade to a workspace to unlock categories
- Choose a category
- Land on the confirmation page
- Go back
- Choose a category
- Go back
- Close the RHP
@mountiny @trjExpensify @nkdengineer
I'd like to make sure. Is this what we want to achieve?
https://github.com/user-attachments/assets/e394a289-5b9d-40b9-900c-9d16f4a56053
@WojtekBoman @adamgrzybowski That looks good for the flow once you already upgraded to workspace. I guess its harder when the user does not have a workspace yet and then by categorizing it, we need to create a workspace
I guess its harder when the user does not have a workspace yet and then by categorizing it, we need to create a workspace
They go through an upgrade interstitial. Confirming on that page (before seeing the category list) is what creates the workspace.
https://github.com/user-attachments/assets/a8980d33-813e-40c6-b1f3-fe5494411f59
After upgrading the workspace, categorizing flow is opened and works the same way as on the previous video that I attached
That looks like what we're after.
@WojtekBoman nice! What changes have you made?
https://github.com/Expensify/App/blob/37105a1b4c60ba6416b3ae3415c2265a53c55257/src/components/MoneyRequestConfirmationListFooter.tsx#L432
Here, I added CONST.NAVIGATION.ACTION_TYPE.PUSH as the second param of Navigation.navigate
I only added the two changes I mentioned above, but I'm not very familiar with the categorization flow, so it's possible I missed something
Thank you! @nkdengineer can you please check these out?
Thanks, @WojtekBoman. @mountiny I updated the code and the test steps.
Thanks! @Ollyws what is your ETA for the review?
🚧 @mountiny has triggered a test build. You can view the workflow run here.
@mountiny Will get to this one later today.
:test_tube::test_tube: Use the links below to test this adhoc build on Android, iOS, Desktop, and Web. Happy testing! :test_tube::test_tube:
| Android :robot: | iOS :apple: |
|---|---|
| https://ad-hoc-expensify-cash.s3.amazonaws.com/android/53420/index.html | https://ad-hoc-expensify-cash.s3.amazonaws.com/ios/53420/index.html |
| Desktop :computer: | Web :spider_web: |
| https://ad-hoc-expensify-cash.s3.amazonaws.com/desktop/53420/NewExpensify.dmg | https://53420.pr-testing.expensify.com |
:eyes: View the workflow run that generated this build :eyes: