App icon indicating copy to clipboard operation
App copied to clipboard

Replace OptionsSelector with SelectionList - part 1

Open filip-solecki opened this issue 1 year ago • 6 comments

Details

First part of migration OptionsSelector to SelectionList covers 4 pages. Remaining 3 will be covered in separate PR and OptionsSelector will be removed there as well.

Fixed Issues

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

Tests

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

BaseShareLogList:

  1. Log in to the app
  2. Go to Profile -> About -> Troubleshoot
  3. Enable Client side logging if disabled
  4. Click „View debug console”
  5. Click „Share log”
  6. Test all list’s functionalities

WorkspaceSwitcherPage

  1. Log in to the app
  2. Go to Home Page
  3. Click Logo in the left top corner
  4. Test all Workspace Switcher functionalities

TagPicker

  1. Log in to the app
  2. Click FAB icon
  3. Select Money Request
  4. Select an amount and go Next
  5. Select a Workspace as a user where to Request money and click Next
  6. Click on Show more
  7. Select Tag
  8. Search for a tag
  9. Verify that Search is working
  10. Select a Tag
  11. Verify that page is working properly and you can request a money

EditReportFieldDropdownPage

  1. Log in to the app
  2. On a Paid workspace, in Old dot, set report field of Dropdown type.
  3. Open ND and create an expense report on the above workspace.
  4. Open the expense report and make sure that canUseReportFields beta is enabled.
  5. Verify that created custom field show up.
  6. Click on it and test if everything works fine
  7. Make sure that the field gets saved successfully.
  8. Verify that selecting an already selected dropdown option again deselects it.

Offline tests

QA Steps

  • [x] 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

WorkspaceSwitcher

Android: Native

https://github.com/Expensify/App/assets/153545991/d283f778-896d-4c13-891a-f4b27b36bf3a

Android: mWeb Chrome

https://github.com/Expensify/App/assets/153545991/3e1e6bc7-7a06-4bf0-a2a2-35ae4327f445

iOS: Native

https://github.com/Expensify/App/assets/153545991/8157fd31-2126-4784-809e-bef6cf664f13

iOS: mWeb Safari

https://github.com/Expensify/App/assets/153545991/2a0088f6-22c5-4918-b816-49e261e2ad94

MacOS: Chrome / Safari

https://github.com/Expensify/App/assets/153545991/7c135140-1681-4f13-b154-69d92c5d70f9

MacOS: Desktop

https://github.com/Expensify/App/assets/153545991/c204d05f-9cfd-40ae-92b9-4c9ded063bb9

ShareLog

Android: Native

https://github.com/Expensify/App/assets/153545991/77bba172-aff4-4a00-a8fb-bab513cbd048

Android: mWeb Chrome

https://github.com/Expensify/App/assets/153545991/c01ac1be-41eb-4149-97ca-00e605ff1d24

iOS: Native

https://github.com/Expensify/App/assets/153545991/b2e54260-adad-4e1d-88fa-6e371021ff30

iOS: mWeb Safari

https://github.com/Expensify/App/assets/153545991/cd6fc12d-6cff-4c88-9688-3b81e8b229be

MacOS: Chrome / Safari

https://github.com/Expensify/App/assets/153545991/9a7d3eca-3d61-49af-841f-a90a5da28129

MacOS: Desktop

https://github.com/Expensify/App/assets/153545991/c82ec2b1-2ba0-40bd-b5ea-6a57057d0405

TagPicker

Android: Native

https://github.com/Expensify/App/assets/153545991/a404db1d-c3e0-444d-a765-4dda67a720c7

Android: mWeb Chrome

https://github.com/Expensify/App/assets/153545991/31088bc8-1891-4e5e-b504-06e6d91f4077

iOS: Native

https://github.com/Expensify/App/assets/153545991/44952f2f-d3ee-430f-8b83-96a5c3683a60

iOS: mWeb Safari

https://github.com/Expensify/App/assets/153545991/c354fc42-6f67-4a2f-84a3-d0b569b62bc6

MacOS: Chrome / Safari

https://github.com/Expensify/App/assets/153545991/065ddced-95ae-44ae-af3f-ce17592d27b3

MacOS: Desktop

https://github.com/Expensify/App/assets/153545991/e730bb54-68c7-486f-9148-c44b13733679

EditReportFieldDropdownPage

Android: Native

https://github.com/Expensify/App/assets/153545991/01f6e69e-c2df-440e-94e4-a3dd850f9cb5

Android: mWeb Chrome

https://github.com/Expensify/App/assets/153545991/98282ddb-ebba-4e25-8537-06ae7a98c0f1

iOS: Native

https://github.com/Expensify/App/assets/153545991/2de43139-4a36-44a2-9070-76bbe236b3aa

iOS: mWeb Safari

https://github.com/Expensify/App/assets/153545991/b4506e2e-a367-42ef-9e92-c9eeef9e2a0d

MacOS: Chrome / Safari

https://github.com/Expensify/App/assets/153545991/a03a4d2c-ba8f-4686-add6-f51b58369c26

MacOS: Desktop

https://github.com/Expensify/App/assets/153545991/e99b7646-2bd5-44b8-b116-80b3f7ee3fe8

EDIT Added `isSelected` mark in `EditReportFieldDropdownPage`, as on the screenshot below:

Simulator Screenshot - iPhone 15 Plus - 2024-03-27 at 12 02 57

filip-solecki avatar Mar 26 '24 11:03 filip-solecki

@Santhosh-Sellavel 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 Mar 27 '24 11:03 melvin-bot[bot]

@Santhosh-Sellavel kind bump here :)

filip-solecki avatar Mar 29 '24 08:03 filip-solecki

Taking this as C+ from @Santhosh-Sellavel. I will review

s77rt avatar Mar 29 '24 17:03 s77rt

On report dropdown the selected item should be highlighted

Screenshot 2024-03-29 at 11 15 17 PM

s77rt avatar Mar 30 '24 01:03 s77rt

On report dropdown after pressing the arrow button many items are highlighted

Screenshot 2024-03-29 at 11 15 22 PM

s77rt avatar Mar 30 '24 01:03 s77rt

On report dropdown searching for a selected option should appear as selected

https://github.com/Expensify/App/assets/16493223/8f07ffaf-d609-4958-9198-0cda7f6ef54d

s77rt avatar Mar 31 '24 01:03 s77rt

Group tooltips not showing everyone's tooltip PR: Screenshot 2024-03-31 at 8 31 53 PM

Staging: Screenshot 2024-03-31 at 8 32 05 PM

s77rt avatar Mar 31 '24 19:03 s77rt

If isLoadingNewOptions is true then we should not show the not found message (similar to OptionsSelector) Screenshot 2024-03-31 at 8 41 25 PM

s77rt avatar Mar 31 '24 19:03 s77rt

On report dropdown the selected item should be highlighted

Screenshot 2024-03-29 at 11 15 17 PM

This behvior is consistent with staging, but I can change it if we want to

filip-solecki avatar Apr 02 '24 11:04 filip-solecki

On report dropdown after pressing the arrow button many items are highlighted

Screenshot 2024-03-29 at 11 15 22 PM

This is global SelectionList issue, not sure if it should be covered by this PR

filip-solecki avatar Apr 02 '24 12:04 filip-solecki

Group tooltips not showing everyone's tooltip PR: Screenshot 2024-03-31 at 8 31 53 PM

Staging: Screenshot 2024-03-31 at 8 32 05 PM

Is it supported somewhere in SelectionList? I can't find any place, so maybe it should be done as a follow-up to extend SelectionList possibilities

filip-solecki avatar Apr 02 '24 13:04 filip-solecki

Hi @s77rt ! I've applied most of your requests, some of them are quite complex and I think they might be done as a follow-up, take a look!

filip-solecki avatar Apr 02 '24 13:04 filip-solecki

On report dropdown the selected item should be highlighted

This behvior is consistent with staging, but I can change it if we want to

On staging I'm seeing the item highlighted. Please fix it

s77rt avatar Apr 02 '24 15:04 s77rt

Can you address this one too https://github.com/Expensify/App/pull/38994#issuecomment-2028887141

s77rt avatar Apr 02 '24 15:04 s77rt

@s77rt fixes applied, and I've asked one question

filip-solecki avatar Apr 03 '24 09:04 filip-solecki

Failing TS is not related to this PR

filip-solecki avatar Apr 03 '24 19:04 filip-solecki

@s77rt All done! Left one thought

filip-solecki avatar Apr 04 '24 07:04 filip-solecki

@s77rt Ready for re-review!

filip-solecki avatar Apr 04 '24 10:04 filip-solecki

Reviewer Checklist

  • [X] I have verified the author checklist is complete (all boxes are checked off).
  • [X] I verified the correct issue is linked in the ### Fixed Issues section above
  • [X] I verified testing steps are clear and they cover the changes made in this PR
    • [X] I verified the steps for local testing are in the Tests section
    • [X] I verified the steps for Staging and/or Production testing are in the QA steps section
    • [X] 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)
    • [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 checked that screenshots or videos are included for tests on all platforms
  • [X] I included screenshots or videos for tests on all platforms
  • [X] I verified tests pass on all platforms & I tested again on:
    • [X] Android: Native
    • [X] Android: mWeb Chrome
    • [X] iOS: Native
    • [X] iOS: mWeb Safari
    • [X] MacOS: Chrome / Safari
    • [X] MacOS: Desktop
  • [X] 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
  • [X] I verified proper code patterns were followed (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] 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • [X] 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)
  • [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] If a new component is created I verified that:
    • [X] A similar component doesn't exist in the codebase
    • [X] All props are defined accurately and each prop has a /** comment above it */
    • [X] The file is named correctly
    • [X] The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • [X] The only data being stored in the state is data necessary for rendering and nothing else
    • [X] 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)
    • [X] 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)
    • [X] All JSX used for rendering exists in the render method
    • [X] 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
  • [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.
  • [X] I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: Native android
Android: mWeb Chrome mweb-chrome
iOS: Native ios
iOS: mWeb Safari mweb-safari
MacOS: Chrome / Safari web
MacOS: Desktop desktop

s77rt avatar Apr 04 '24 19:04 s77rt

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

melvin-bot[bot] avatar Apr 04 '24 19:04 melvin-bot[bot]

I think this PR introduced this error. It happens both on Share logs and when you click on the workspace switcher. https://github.com/Expensify/App/pull/39696#pullrequestreview-1982948642

danieldoglas avatar Apr 05 '24 11:04 danieldoglas

I'm reverting this PR so we can fix the error log that is happening before we merge it again. I recommend we do it step by step this time.

We've checked the [] Verify that no errors appear in the JS console item in the check list, but it was actually logging new errors.

danieldoglas avatar Apr 05 '24 12:04 danieldoglas

@danieldoglas Sorry I missed that. I added required change. cc @filip-solecki

s77rt avatar Apr 05 '24 12:04 s77rt

As for the duplicated variable I don't think we could have prevented that as it's a post-merge error

s77rt avatar Apr 05 '24 12:04 s77rt

I've prepared draft PR with fix, not sure if we should prepare these pages as separated PRs right now, we can do it with the rest of pages I think. I am checking new branch on all devices, I'll let you know @s77rt when it is ready for you!

filip-solecki avatar Apr 05 '24 13:04 filip-solecki

🚀 Deployed to staging by https://github.com/danieldoglas in version: 1.4.61-0 🚀

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

OSBotify avatar Apr 08 '24 11:04 OSBotify

🚀 Deployed to staging by https://github.com/danieldoglas in version: 1.4.61-0 🚀

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

OSBotify avatar Apr 08 '24 13:04 OSBotify

🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.61-8 🚀

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

OSBotify avatar Apr 10 '24 17:04 OSBotify