Replace OptionsSelector with SelectionList - part 1
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:
- Log in to the app
- Go to Profile -> About -> Troubleshoot
- Enable Client side logging if disabled
- Click „View debug console”
- Click „Share log”
- Test all list’s functionalities
WorkspaceSwitcherPage
- Log in to the app
- Go to Home Page
- Click Logo in the left top corner
- Test all Workspace Switcher functionalities
TagPicker
- Log in to the app
- Click FAB icon
- Select Money Request
- Select an amount and go Next
- Select a Workspace as a user where to Request money and click Next
- Click on Show more
- Select Tag
- Search for a tag
- Verify that Search is working
- Select a Tag
- Verify that page is working properly and you can request a money
EditReportFieldDropdownPage
- Log in to the app
- On a Paid workspace, in Old dot, set report field of Dropdown type.
- Open ND and create an expense report on the above workspace.
- Open the expense report and make sure that
canUseReportFieldsbeta is enabled. - Verify that created custom field show up.
- Click on it and test if everything works fine
- Make sure that the field gets saved successfully.
- 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 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 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] 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.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
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] 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
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:
@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]
@Santhosh-Sellavel kind bump here :)
Taking this as C+ from @Santhosh-Sellavel. I will review
On report dropdown the selected item should be highlighted
On report dropdown after pressing the arrow button many items are highlighted
On report dropdown searching for a selected option should appear as selected
https://github.com/Expensify/App/assets/16493223/8f07ffaf-d609-4958-9198-0cda7f6ef54d
Group tooltips not showing everyone's tooltip
PR:
Staging:
If isLoadingNewOptions is true then we should not show the not found message (similar to OptionsSelector)
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 report dropdown after pressing the arrow button many items are highlighted
![]()
This is global SelectionList issue, not sure if it should be covered by this PR
Group tooltips not showing everyone's tooltip PR:
Staging:
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
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!
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
Can you address this one too https://github.com/Expensify/App/pull/38994#issuecomment-2028887141
@s77rt fixes applied, and I've asked one question
Failing TS is not related to this PR
@s77rt All done! Left one thought
@s77rt Ready for re-review!
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 Issuessection 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
Testssection - [X] I verified the steps for Staging and/or Production testing are in the
QA stepssection - [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 verified the steps for local testing are in the
- [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.
toggleReportand notonIconClick). - [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] 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 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 usingAvatarhave 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
thisproperly so there are no scoping issues (i.e. foronClick={this.submit}the methodthis.submitshould be bound tothisin the constructor) - [X] Any internal methods bound to
thisare necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);ifthis.submitis never passed to a component event handler likeonClick) - [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
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] If the
mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps. - [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: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
MacOS: Desktop
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!
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
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 Sorry I missed that. I added required change. cc @filip-solecki
As for the duplicated variable I don't think we could have prevented that as it's a post-merge error
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!
🚀 Deployed to staging by https://github.com/danieldoglas in version: 1.4.61-0 🚀
| platform | result |
|---|---|
| 🤖 android 🤖 | success ✅ |
| 🖥 desktop 🖥 | cancelled 🔪 |
| 🍎 iOS 🍎 | success ✅ |
| 🕸 web 🕸 | success ✅ |
🚀 Deployed to staging by https://github.com/danieldoglas in version: 1.4.61-0 🚀
| platform | result |
|---|---|
| 🤖 android 🤖 | success ✅ |
| 🖥 desktop 🖥 | success ✅ |
| 🍎 iOS 🍎 | success ✅ |
| 🕸 web 🕸 | success ✅ |
🚀 Deployed to production by https://github.com/Julesssss in version: 1.4.61-8 🚀
| platform | result |
|---|---|
| 🤖 android 🤖 | success ✅ |
| 🖥 desktop 🖥 | success ✅ |
| 🍎 iOS 🍎 | success ✅ |
| 🕸 web 🕸 | success ✅ |

