Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[HOLD for payment 2024-11-20] [$125] Don't show two creation options at the same time in the workspace switcher #52030

Closed
JmillsExpensify opened this issue Nov 5, 2024 · 25 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor

Comments

@JmillsExpensify
Copy link

JmillsExpensify commented Nov 5, 2024

Problem: When we prompt users to create a new workspace in the workspace switcher, they become confused by two options that do the same thing, which leads to frustration.

Solution: Let's simplify the decisions we're asking users to take when creating a workspace, and in particular, let's not add creation options that do the same thing and compete with our "green brick road" pattern.

All in all, our solution will look like this:

  • Don't show the plus button when we show the empty state promoting workspace creation.
    CleanShot 2024-11-05 at 00 38 06@2x

For clarity, this means that we should show the small plus button only when the empty state doesn't show. (Related, the empty state should only show when someone doesn't have an existing group workspace that they're a member of).
File

Issue OwnerCurrent Issue Owner: @JmillsExpensify
@JmillsExpensify JmillsExpensify added External Added to denote the issue can be worked on by a contributor Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Nov 5, 2024
@JmillsExpensify JmillsExpensify self-assigned this Nov 5, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 5, 2024
Copy link

melvin-bot bot commented Nov 5, 2024

Current assignee @JmillsExpensify is eligible for the Bug assigner, not assigning anyone new.

Copy link

melvin-bot bot commented Nov 5, 2024

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

@JmillsExpensify JmillsExpensify changed the title Don't show two creation options at the same time in the workspace switcher [$125] Don't show two creation options at the same time in the workspace switcher Nov 5, 2024
Copy link

melvin-bot bot commented Nov 5, 2024

⚠️ Could not update price automatically because there is no linked Upwork Job ID. The BZ team member will need to update the price manually in Upwork.

@JmillsExpensify
Copy link
Author

Let me know if you have any questions on this issues, happy to clarify.

@NJ-2020
Copy link
Contributor

NJ-2020 commented Nov 5, 2024

Edited by proposal-police: This proposal was edited at 2024-11-05 11:54:40 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

Don't show two creation options at the same time in the workspace switcher

What is the root cause of that problem?

We did not hide the option if the user does not have workspaces or member group of a workspace

<Tooltip text={translate('workspace.new.newWorkspace')}>
<PressableWithFeedback
accessibilityLabel={translate('workspace.new.newWorkspace')}

What changes do you think we should make in order to solve the problem?

We should check if the user has a workspace or a member of other group workspaces then we will show the option inside the workspace switcher page

const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);

{Policy.hasActiveChatEnabledPolicies(Object.values(allPolicies ?? {})) && (
    <Tooltip text={translate('workspace.new.newWorkspace')}>
        <PressableWithFeedback
            accessibilityLabel={translate('workspace.new.newWorkspace')}
            role={CONST.ROLE.BUTTON}
            onPress={() => {
                const activeRoute = Navigation.getActiveRouteWithoutParams();
                interceptAnonymousUser(() => App.createWorkspaceWithPolicyDraftAndNavigateToIt('', '', false, false, activeRoute));
            }}
        >
            {({hovered}) => (
                <Icon
                    src={Expensicons.Plus}
                    width={12}
                    height={12}
                    additionalStyles={[styles.buttonDefaultBG, styles.borderRadiusNormal, styles.p2, hovered && styles.buttonHoveredBG]}
                    fill={theme.icon}
                />
            )}
        </PressableWithFeedback>
    </Tooltip>
)}

It should similar to promotion create workspace button

...(!isLoading && !Policy.hasActiveChatEnabledPolicies(allPolicies)
? [
{
displayInDefaultIconColor: true,

In this issue we decided to return true for hasActiveChatEnabledPolicies if the user is member of other group workspaces

What alternative solutions did you explore? (Optional)

@JmillsExpensify
Copy link
Author

JmillsExpensify commented Nov 5, 2024

Following on that proposal, please check this related issue as it's important that we stay consistent with it. In short, we shouldn't be showing the empty state as long as someone is a member of other group workspaces (whether or not they are policy expense chats enabled).

@twilight2294
Copy link
Contributor

twilight2294 commented Nov 5, 2024

Edited by proposal-police: This proposal was edited at 2024-11-05 12:05:03 UTC.

Proposal

Please re-state the problem that we are trying to solve in this issue.

Don't show two creation options at the same time in the workspace switcher

What is the root cause of that problem?

We do not hide the Plus icon for empty state view:

<Tooltip text={translate('workspace.new.newWorkspace')}>
<PressableWithFeedback
accessibilityLabel={translate('workspace.new.newWorkspace')}

What changes do you think we should make in order to solve the problem?

We need to pass shouldShowCreateWorkspace:

const shouldShowCreateWorkspace = usersWorkspaces.length === 0;

to the below component:

<WorkspacesSectionHeader />

<WorkspacesSectionHeader shouldShowCreateWorkspace={!shouldShowCreateWorkspace} />

And then in WorkspacesSectionHeader:

(shouldShowCreateWorkspace && <Tooltip text={translate('workspace.new.newWorkspace')}>
                <PressableWithFeedback
                    accessibilityLabel={translate('workspace.new.newWorkspace')}

We already pass shouldShowCreateWorkspace to show the empty content screen:

shouldShowListEmptyContent={shouldShowCreateWorkspace}

Screenshot 2024-11-05 at 5 34 25 PM

What alternative solutions did you explore? (Optional)

@nyomanjyotisa
Copy link
Contributor

nyomanjyotisa commented Nov 5, 2024

Proposal

Please re-state the problem that we are trying to solve in this issue.

Don't show two creation options at the same time in the workspace switcher

What is the root cause of that problem?

Changes request

What changes do you think we should make in order to solve the problem?

Accept shouldShowCreateWorkspace on WorkspacesSectionHeader

function WorkspacesSectionHeader() {

And only show the + icon if shouldShowCreateWorkspace is true

<Tooltip text={translate('workspace.new.newWorkspace')}>

            {shouldShowCreateWorkspace && (
                <Tooltip text={translate('workspace.new.newWorkspace')}>
                     ...
                </Tooltip>
            )}

Pass shouldShowCreateWorkspace, but we should use the opposite of the existing shouldShowCreateWorkspace variable, so we should pass !shouldShowCreateWorkspace

<WorkspacesSectionHeader />

                    <WorkspacesSectionHeader
                        shouldShowCreateWorkspace={!shouldShowCreateWorkspace}
                    />

Result

image

What alternative solutions did you explore? (Optional)

@twilight2294
Copy link
Contributor

twilight2294 commented Nov 5, 2024

Updated proposal

Updated the proposal to add an extra point and pass the prop to main component

@NJ-2020
Copy link
Contributor

NJ-2020 commented Nov 5, 2024

Proposal Updated

@brunovjk

This comment was marked as outdated.

@brunovjk
Copy link
Contributor

brunovjk commented Nov 5, 2024

Thank you, @NJ-2020, for proposal 1, but I don’t think the solution is suitable here.

Between proposals 2 and 3, both suggest a correct solution of passing shouldShowCreateWorkspace as a prop to WorkspacesSectionHeader. @twilight2294 (proposal 2) submitted first and identified the correct overall solution. @nyomanjyotisa (proposal 3) contributed a key detail—setting shouldShowCreateWorkspace to !shouldShowCreateWorkspace when passing it. I’m not sure if one used information from the other, but I think this detail could be noticed later anyway, like other details (e.g., prop type) we must check in PR. IMO the core of the solution was pointed out by proposal 2 first.

I think we can go with @twilight2294's proposal. However, both posted the proposal almost at the same time, difficult decision, I ask for your help with this call hehe

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Nov 5, 2024

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

@nyomanjyotisa
Copy link
Contributor

@brunovjk @MariaHCD I believe my proposal is the first with the correct solution

Timestamp:

  • 2024-11-05T12:03:30Z - Proposal 2 posted
  • 2024-11-05T12:04:58Z - Proposal 3 posted
  • 2024-11-05T12:07:55Z - Proposal 2 solution updated

Btw to be honest I started writing my proposal before proposal 2 was posted, and don't use any information from proposal 2

@twilight2294
Copy link
Contributor

I think we can go with @twilight2294's #52030 (comment).

@brunovjk , yes i was the first one to give the correct approach to the bug, so my solution is valid in this case :)

@MariaHCD
Copy link
Contributor

MariaHCD commented Nov 7, 2024

I agree with @brunovjk's decision here 👍🏼 The two proposals were posted at almost the same time and propose the same fix.

Let's proceed with @twilight2294 for this one.

Thank you for the contribution, @nyomanjyotisa!

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 7, 2024
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Daily KSv2 labels Nov 8, 2024
@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Nov 13, 2024
@melvin-bot melvin-bot bot changed the title [$125] Don't show two creation options at the same time in the workspace switcher [HOLD for payment 2024-11-20] [$125] Don't show two creation options at the same time in the workspace switcher Nov 13, 2024
@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Nov 13, 2024
Copy link

melvin-bot bot commented Nov 13, 2024

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

Copy link

melvin-bot bot commented Nov 13, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.60-3 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-11-20. 🎊

For reference, here are some details about the assignees on this issue:

  • @brunovjk requires payment (Needs manual offer from BZ)
  • @twilight2294 requires payment (Needs manual offer from BZ)

Copy link

melvin-bot bot commented Nov 13, 2024

@brunovjk @JmillsExpensify @brunovjk The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 19, 2024
@brunovjk
Copy link
Contributor

BugZero Checklist:

  • [Contributor] Classify the bug:
Bug classification

Source of bug:

  • 1a. Result of the original design (eg. a case wasn't considered)
  • 1b. Mistake during implementation
  • 1c. Backend bug
  • 1z. Other:

Where bug was reported:

  • 2a. Reported on production
  • 2b. Reported on staging (deploy blocker)
  • 2c. Reported on both staging and production
  • 2d. Reported on a PR
  • 2z. Other:

Who reported the bug:

  • 3a. Expensify user
  • 3b. Expensify employee
  • 3c. Contributor
  • 3d. QA
  • 3z. Other:
  • [Contributor] 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:

  • [Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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:

  • [Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.

Regression Test Proposal

Test:

  1. Login with new account
  2. Go to workspace switcher
  3. Verify that there is no Plus icon when there are no workspaces present.

Do we agree 👍 or 👎

Copy link

melvin-bot bot commented Nov 20, 2024

Payment Summary

Upwork Job

BugZero Checklist (@JmillsExpensify)

  • I have verified the correct assignees and roles are listed above and updated the neccesary manual offers
  • I have verified that there are no duplicate or incorrect contracts on Upwork for this job (https://www.upwork.com/ab/applicants//hired)
  • I have paid out the Upwork contracts or cancelled the ones that are incorrect
  • I have verified the payment summary above is correct

@JmillsExpensify
Copy link
Author

Payment summary:

@JmillsExpensify
Copy link
Author

Offers sent via Upwork

@brunovjk
Copy link
Contributor

Accepted @JmillsExpensify

@JmillsExpensify
Copy link
Author

Thanks everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 External Added to denote the issue can be worked on by a contributor
Projects
None yet
Development

No branches or pull requests

6 participants