[$250] Workspace switcher search bar is in the wrong place
If you havenβt already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
**Version Number:**v1.4.64-3 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: Slack conversation:
Action Performed:
Break down in numbered steps
- Add enough workspaces so the search in the workspace switcher is visible(8+)
- Open the workspace switcher
Expected Result:
Describe what you think should've happened
The search bar should be below the workspaces title
Actual Result:
Describe what actually happened
Search bar is below Choose workspace
Workaround:
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
- [ ] Android: Native
- [ ] Android: mWeb Chrome
- [ ] iOS: Native
- [ ] iOS: mWeb Safari
- [x] MacOS: Chrome / Safari
- [ ] MacOS: Desktop
Screenshots/Videos
Add any screenshot/video evidence
Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~01f05cea763c8e597d
- Upwork Job ID: 1782868524583206912
- Last Price Increase: 2024-04-23
- Automatic offers:
- getusha | Reviewer | 0
- Krishna2323 | Contributor | 0
Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Workspace switcher search bar is in the wrong place
What is the root cause of that problem?
We have included the everything section as a section of selection list. https://github.com/Expensify/App/blob/109d0f01e20be8448ecfd79754d9ac7f6f1eea0f/src/pages/WorkspaceSwitcherPage/index.tsx#L140-L154
What changes do you think we should make in order to solve the problem?
We first need to remove the section from SelectionList sections and create the jsx for everything section.
pseudo-code:
<View style={[styles.mh4, styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.mb1]}>
<Text
style={styles.label}
color={theme.textSupporting}
>
{translate('workspace.switcher.everythingSection')}
</Text>
</View>
<View>
<UserListItem
item={{
text: CONST.WORKSPACE_SWITCHER.NAME,
policyID: '',
icons: [{source: Expensicons.ExpensifyAppIcon, name: CONST.WORKSPACE_SWITCHER.NAME, type: CONST.ICON_TYPE_AVATAR}],
brickRoadIndicator: getIndicatorTypeForPolicy(undefined),
isSelected: activeWorkspaceID === undefined,
keyForList: CONST.WORKSPACE_SWITCHER.NAME,
}}
isFocused={false}
isDisabled={false}
showTooltip={false}
canSelectMultiple={false}
onSelectRow={() =>
selectPolicy({
text: CONST.WORKSPACE_SWITCHER.NAME,
policyID: '',
icons: [{source: Expensicons.ExpensifyAppIcon, name: CONST.WORKSPACE_SWITCHER.NAME, type: CONST.ICON_TYPE_AVATAR}],
brickRoadIndicator: getIndicatorTypeForPolicy(undefined),
isSelected: activeWorkspaceID === undefined,
keyForList: CONST.WORKSPACE_SWITCHER.NAME,
})
}
/>
</View>
This will be placed before the selection list. This is just pseudo-code, props are filled randomly. Minor styling changes can be discussed during PR phase.
What alternative solutions did you explore? (Optional)
https://github.com/Expensify/App/assets/85894871/21ffcb5c-41d2-4965-b749-c91fe908b15c
Job added to Upwork: https://www.upwork.com/jobs/~01f05cea763c8e597d
Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (External)
Proposal
Please re-state the problem that we are trying to solve in this issue.
Search bar is below Choose workspace
What is the root cause of that problem?
This is a feature request
What changes do you think we should make in order to solve the problem?
- Pass the
BaseSelectionList's currentTextInputcomponent (wrapped inside a memoized variable) as a children of section'sCustomSectionHeader. Of course, we'll need to update the types accordingly:
https://github.com/Expensify/App/blob/6b18ee91e8f7e498096b1ce04027a830f118ad12/src/components/SelectionList/BaseSelectionList.tsx#L318-L320
<section.CustomSectionHeader
section={section}
>
{textInput}
</section.CustomSectionHeader>
- Inside
WorkspacesSectionHeader, render that children with proper style. InWorkspaceSwitcherPage:- Disable
shouldShowTopTextInput(new prop) to hide the current text input - Move
headerMessagetoWorkspacesSectionHeader(or we can wrap inside the above mentioned variable) - Use
iconLeftto display the magnifier icon and modifytextInputLabeltoFind a workspace.
- Disable
What alternative solutions did you explore? (Optional)
NA
Proposal updated to include detailed implementation.
@gijoe0295 i don't like the idea of modifying BaseSelectionList just for this since it's used multiple places. @Krishna2323 could you provide a more complete branch to test? there are some details you missed from the design.
@getusha test branch.
Proposal
Please re-state the problem that we are trying to solve in this issue.
Workspace switcher search bar is in the wrong place
What is the root cause of that problem?
Everything section is part of same SelectionList component. So according to SelectionList component logic every section will be under text input
What changes do you think we should make in order to solve the problem?
We just need to create one more SelectionList component that have everything section inside. So everything section will be rendered on top of the text input. This way we don't need to do custom style changes for section and don't need create custom logic to replicate SelectionList functionality
<SelectionList<WorkspaceListItem>
containerStyle={{
flexBasis: 'auto',
flexGrow: 0,
}}
ListItem={UserListItem}
sections={everythingSection}
onSelectRow={selectPolicy}
initiallyFocusedOptionKey={activeWorkspaceID ?? CONST.WORKSPACE_SWITCHER.NAME}
/>
<SelectionList<WorkspaceListItem>
ListItem={UserListItem}
sections={sections}
onSelectRow={selectPolicy}
textInputLabel={usersWorkspaces.length >= CONST.WORKSPACE_SWITCHER.MINIMUM_WORKSPACES_TO_SHOW_SEARCH ? translate('common.search') : undefined}
textInputValue={searchTerm}
onChangeText={setSearchTerm}
headerMessage={headerMessage}
listFooterContent={shouldShowCreateWorkspace ? WorkspaceCardCreateAWorkspaceInstance : null}
initiallyFocusedOptionKey={activeWorkspaceID ?? CONST.WORKSPACE_SWITCHER.NAME}
showLoadingPlaceholder
/>
What alternative solutions did you explore? (Optional)
We can separate everything section from SelectionList component and write everything custom.
https://github.com/Expensify/App/assets/6459339/a8ec7963-20de-4558-ba99-8a1b51d6b050
π£ @Delgee! π£ Hey, it seems we donβt have your contributor details yet! You'll only have to do this once, and this is how we'll hire you on Upwork. Please follow these steps:
- Make sure you've read and understood the contributing guidelines.
- Get the email address used to login to your Expensify account. If you don't already have an Expensify account, create one here. If you have multiple accounts (e.g. one for testing), please use your main account email.
- Get the link to your Upwork profile. It's necessary because we only pay via Upwork. You can access it by logging in, and then clicking on your name. It'll look like this. If you don't already have an account, sign up for one here.
- Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details.
Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>
Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/delgee
β Contributor details stored successfully. Thank you for contributing to Expensify!
The branch @Krishna2323 provided looks good, we can proceed with that.
This is not highlighted when selected, but we can address this on the PR as it is a minor issue. π π π C+ Reviewed!
Triggered auto assignment to @blimpich, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
π£ @getusha π An offer has been automatically sent to your Upwork account for the Reviewer role π Thanks for contributing to the Expensify app!
π£ @Krishna2323 π An offer has been automatically sent to your Upwork account for the Contributor role π Thanks for contributing to the Expensify app!
Offer link Upwork job Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review π§βπ» Keep in mind: Code of Conduct | Contributing π
@getusha, PR ready for review.
This issue has not been updated in over 15 days. @JmillsExpensify, @blimpich, @getusha, @Krishna2323 eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
PR is under review.
β οΈ Looks like this issue was linked to a Deploy Blocker here
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
Reviewing label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.81-11 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pull/41158
If no regressions arise, payment will be issued on 2024-06-18. :confetti_ball:
For reference, here are some details about the assignees on this issue:
- @getusha requires payment automatic offer (Reviewer)
- @Krishna2323 requires payment automatic offer (Contributor)
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
- [ ] [@getusha] The PR that introduced the bug has been identified. Link to the PR:
- [ ] [@getusha] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
- [ ] [@getusha] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
- [ ] [@getusha] Determine if we should create a regression test for this bug.
- [ ] [@getusha] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
- [ ] [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.4.82-4 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
- https://github.com/Expensify/App/pull/41158
If no regressions arise, payment will be issued on 2024-06-20. :confetti_ball:
For reference, here are some details about the assignees on this issue:
- @getusha requires payment automatic offer (Reviewer)
- @Krishna2323 requires payment automatic offer (Contributor)
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
- [ ] [@getusha] The PR that introduced the bug has been identified. Link to the PR:
- [ ] [@getusha] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
- [ ] [@getusha] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
- [ ] [@getusha] Determine if we should create a regression test for this bug.
- [ ] [@getusha] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
- [ ] [@JmillsExpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:
Payment summary:
- Contributor: @Krishna2323 $250
- Contributor+: @getusha $250
I've paid out @Krishna2323. @getusha Mind filling out the BZ checklist above, and additionally, can you confirm if you'll be paid via Upwork or NewDot?
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
[@getusha] The PR that introduced the bug has been identified. Link to the PR: N/a this is a feature request [@getusha] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment: N/a [@getusha] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion: N/a [@getusha] Determine if we should create a regression test for this bug: I don't think we need a regression test for this, as it is not something that will be accidentally affected unless there is intentional UI design change. [@getusha] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again. N/a
I've paid out @Krishna2323. @getusha Mind filling out the BZ checklist above, and additionally, can you confirm if you'll be paid via Upwork or NewDot?
newDot, i just requested. thanks!