App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Workspace switcher search bar is in the wrong place

Open rlinoz opened this issue 1 year ago β€’ 17 comments

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

  1. Add enough workspaces so the search in the workspace switcher is visible(8+)
  2. Open the workspace switcher

Expected Result:

Describe what you think should've happened The search bar should be below the workspaces title image

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 image

View all open jobs on GitHub

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

rlinoz avatar Apr 23 '24 20:04 rlinoz

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.

melvin-bot[bot] avatar Apr 23 '24 20:04 melvin-bot[bot]

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

Krishna2323 avatar Apr 23 '24 20:04 Krishna2323

Job added to Upwork: https://www.upwork.com/jobs/~01f05cea763c8e597d

melvin-bot[bot] avatar Apr 23 '24 20:04 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @getusha (External)

melvin-bot[bot] avatar Apr 23 '24 20:04 melvin-bot[bot]

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?

  1. Pass the BaseSelectionList's current TextInput component (wrapped inside a memoized variable) as a children of section's CustomSectionHeader. 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>
  1. Inside WorkspacesSectionHeader, render that children with proper style. In WorkspaceSwitcherPage:
    • Disable shouldShowTopTextInput (new prop) to hide the current text input
    • Move headerMessage to WorkspacesSectionHeader (or we can wrap inside the above mentioned variable)
    • Use iconLeft to display the magnifier icon and modify textInputLabel to Find a workspace.

What alternative solutions did you explore? (Optional)

NA

gijoe0295 avatar Apr 23 '24 20:04 gijoe0295

Proposal Updated

  • Added a note and result video

Krishna2323 avatar Apr 23 '24 20:04 Krishna2323

Proposal updated to include detailed implementation.

gijoe0295 avatar Apr 23 '24 20:04 gijoe0295

@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 avatar Apr 24 '24 12:04 getusha

@getusha test branch.

Krishna2323 avatar Apr 24 '24 12:04 Krishna2323

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 avatar Apr 24 '24 17:04 Delgee

πŸ“£ @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:

  1. Make sure you've read and understood the contributing guidelines.
  2. 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.
  3. 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.
  4. Copy the format below and paste it in a comment on this issue. Replace the placeholder text with your actual details. Screen Shot 2022-11-16 at 4 42 54 PM Format:
Contributor details
Your Expensify account email: <REPLACE EMAIL HERE>
Upwork Profile Link: <REPLACE LINK HERE>

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

Contributor details Your Expensify account email: [email protected] Upwork Profile Link: https://www.upwork.com/freelancers/delgee

Delgee avatar Apr 24 '24 17:04 Delgee

βœ… Contributor details stored successfully. Thank you for contributing to Expensify!

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

The branch @Krishna2323 provided looks good, we can proceed with that.

Screenshot 2024-04-26 at 4 28 33 in the afternoon

This is not highlighted when selected, but we can address this on the PR as it is a minor issue. πŸŽ€ πŸ‘€ πŸŽ€ C+ Reviewed!

getusha avatar Apr 26 '24 13:04 getusha

Triggered auto assignment to @blimpich, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Apr 26 '24 13:04 melvin-bot[bot]

πŸ“£ @getusha πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] avatar Apr 26 '24 16:04 melvin-bot[bot]

πŸ“£ @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 πŸ“–

melvin-bot[bot] avatar Apr 26 '24 16:04 melvin-bot[bot]

@getusha, PR ready for review.

Krishna2323 avatar Apr 28 '24 22:04 Krishna2323

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!

melvin-bot[bot] avatar May 22 '24 18:05 melvin-bot[bot]

PR is under review.

getusha avatar May 22 '24 18:05 getusha

⚠️ 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.

melvin-bot[bot] avatar Jun 07 '24 14:06 melvin-bot[bot]

Reviewing label has been removed, please complete the "BugZero Checklist".

melvin-bot[bot] avatar Jun 11 '24 23:06 melvin-bot[bot]

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:

melvin-bot[bot] avatar Jun 11 '24 23:06 melvin-bot[bot]

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:

melvin-bot[bot] avatar Jun 11 '24 23:06 melvin-bot[bot]

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:

melvin-bot[bot] avatar Jun 13 '24 15:06 melvin-bot[bot]

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:

melvin-bot[bot] avatar Jun 13 '24 15:06 melvin-bot[bot]

Payment summary:

  • Contributor: @Krishna2323 $250
  • Contributor+: @getusha $250

JmillsExpensify avatar Jun 22 '24 17:06 JmillsExpensify

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?

JmillsExpensify avatar Jun 22 '24 17:06 JmillsExpensify

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

getusha avatar Jun 23 '24 10:06 getusha

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!

getusha avatar Jun 23 '24 10:06 getusha