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

[$250] Remove the redundant + New workspace button from the Workspaces page when no workspaces exist #51500

Open
jamesdeanexpensify opened this issue Oct 25, 2024 · 7 comments
Assignees
Labels
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

@jamesdeanexpensify
Copy link
Contributor

jamesdeanexpensify commented Oct 25, 2024

Slack thread
https://expensify.slack.com/archives/C07HPDRELLD/p1729808604309359

Problem
When no workspaces exist and you go to the Workspaces screen, we offer two buttons that do the same thing (New workspace). Not only is this redundant, it unnecessarily takes up screen real estate on mobile and distracts the user with two CTAs (though they're the same, one CTA is still best practice).

Solution
When no workspaces exist and you go to the Workspaces screen, remove the top + New workspace button so only the bottom/card New workspace button shows.

Where I'm talking about
image (95)
image (96)

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021850943776036588977
  • Upwork Job ID: 1850943776036588977
  • Last Price Increase: 2024-10-28
Issue OwnerCurrent Issue Owner: @thesahindia
@jamesdeanexpensify jamesdeanexpensify added Daily KSv2 Internal Requires API changes or must be handled by Expensify staff Planning Changes still in the thought process labels Oct 25, 2024
@jamesdeanexpensify jamesdeanexpensify self-assigned this Oct 25, 2024
@jamesdeanexpensify jamesdeanexpensify added Help Wanted Apply this label when an issue is open to proposals by contributors and removed Internal Requires API changes or must be handled by Expensify staff Planning Changes still in the thought process labels Oct 25, 2024
@Krishna2323
Copy link
Contributor

Krishna2323 commented Oct 25, 2024

Edited by proposal-police: This proposal was edited at 2024-10-25 21:37:43 UTC.

Proposal


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

Remove the redundant + New workspace button from the Workspaces page when no workspaces exist

What is the root cause of that problem?

Design improvement

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


  • We can remove the {!shouldUseNarrowLayout && getHeaderButton()} & {shouldUseNarrowLayout && <View style={[styles.pl5, styles.pr5]}>{getHeaderButton()}</View>}.

    <HeaderWithBackButton
    title={translate('common.workspaces')}
    shouldShowBackButton={shouldUseNarrowLayout}
    shouldDisplaySearchRouter
    onBackButtonPress={() => Navigation.goBack()}
    icon={Illustrations.BigRocket}
    >
    {!shouldUseNarrowLayout && getHeaderButton()}
    </HeaderWithBackButton>
    {shouldUseNarrowLayout && <View style={[styles.pl5, styles.pr5]}>{getHeaderButton()}</View>}

  • We can just update above lines to:

                <HeaderWithBackButton
                    title={translate('common.workspaces')}
                    shouldShowBackButton={shouldUseNarrowLayout}
                    shouldDisplaySearchRouter
                    onBackButtonPress={() => Navigation.goBack()}
                    icon={Illustrations.BigRocket}
                />
  • We can alsoe remove shouldDisplaySearchRouter from here.

What alternative solutions did you explore? (Optional)

  • We should return null when isEmptyObject(workspaces) is true.

    const getHeaderButton = () => (
    <Button
    accessibilityLabel={translate('workspace.new.newWorkspace')}
    success
    text={translate('workspace.new.newWorkspace')}
    onPress={() => interceptAnonymousUser(() => App.createWorkspaceWithPolicyDraftAndNavigateToIt())}
    icon={Expensicons.Plus}
    style={[shouldUseNarrowLayout && styles.flexGrow1, shouldUseNarrowLayout && styles.mb3]}
    />
    );

  • We can also hide the "+" icon on the workspace switcher page when !policies || isEmptyObject(policies) is true in WorkspaceSwitcherPage, for this we need to introduce a new prop to hide the "+" in WorkspacesSectionHeader.

    <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>

Result

@zfurtak
Copy link
Contributor

zfurtak commented Oct 28, 2024

Hello, I'm Zuza from Software Mansion agency and I could take care of the issue 😊

@melvin-bot melvin-bot bot added the Overdue label Oct 28, 2024
@Krishna2323
Copy link
Contributor

@jamesdeanexpensify, I think you forgot to add the external label 😅

@mallenexpensify mallenexpensify added the External Added to denote the issue can be worked on by a contributor label Oct 28, 2024
Copy link

melvin-bot bot commented Oct 28, 2024

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

@melvin-bot melvin-bot bot changed the title Remove the redundant + New workspace button from the Workspaces page when no workspaces exist [$250] Remove the redundant + New workspace button from the Workspaces page when no workspaces exist Oct 28, 2024
Copy link

melvin-bot bot commented Oct 28, 2024

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

@melvin-bot melvin-bot bot removed the Overdue label Oct 28, 2024
@mallenexpensify mallenexpensify removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Oct 28, 2024
@mallenexpensify mallenexpensify added the Bug Something is broken. Auto assigns a BugZero manager. label Oct 28, 2024
Copy link

melvin-bot bot commented Oct 28, 2024

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

@mallenexpensify
Copy link
Contributor

Throwing a LOT of 🎯🎯🎯 over here, ha
@thesahindia can you please review @Krishna2323 's proposal at the top here? If it doesn't work out we can assign @zfurtak .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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
Status: No status
Development

No branches or pull requests

5 participants