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 plus icon in the workspace switcher when you already have at least one workspace #52409

Open
JmillsExpensify opened this issue Nov 12, 2024 · 20 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

@JmillsExpensify
Copy link

JmillsExpensify commented Nov 12, 2024

We originally added the ability to create as many workspaces as you want via the workspace switcher. Unfortunately this is creating confusion and duplicate workspaces, and it's ultimately a whack-a-mole situation given that we already have other workspace creation flows via Track, Global Create and Settings.

As a result, in an effort to simply this particular flow, moving forward we will limit the workspace switcher to exactly two things:

  1. Creating your first workspace. As a reminder, we already show an empty state to create your first workspace, as long as you're not part of any existing workspaces. (The empty state for this case looks like this). This prevents accidental duplicate creation while still promoting that you create at least one.
    File

  2. Focus the workspace switcher on...switching between workspaces. As a result, we'll remove the plus icon when you have one or more workspaces (highlighted in the red box below). This ensures that our multi-workspace creation flow uniformly happens via Settings, and keeps the workspace switcher focused on switching.
    CleanShot 2024-11-12 at 17 15 11@2x

Issue OwnerCurrent Issue Owner: @suneox
@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 12, 2024
@JmillsExpensify JmillsExpensify self-assigned this Nov 12, 2024
@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 12, 2024
Copy link

melvin-bot bot commented Nov 12, 2024

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

Copy link

melvin-bot bot commented Nov 12, 2024

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

@cretadn22
Copy link
Contributor

cretadn22 commented Nov 12, 2024

Proposal

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

Remove plus icon in the workspace switcher when you already have at least one workspace

What is the root cause of that problem?

New feature

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

In WorkspacesSectionHeader, we need to remove shouldShowCreateWorkspaceIcon prop and remove the New workspace button

What alternative solutions did you explore? (Optional)

We can remove WorkspacesSectionHeader component add this code to WorkspaceSwitcherPage directly

<View>
<Text
style={styles.label}
color={theme.textSupporting}
>
{translate('common.workspaces')}
</Text>
</View>

@nkdengineer
Copy link
Contributor

Proposal

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

Remove plus icon in the workspace switcher when you already have at least one workspace

What is the root cause of that problem?

New feature

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

Since we don't want to display the plus icon any more, we can remove this here and remove the shouldShowCreateWorkspaceIcon prop

{shouldShowCreateWorkspaceIcon && (

What alternative solutions did you explore? (Optional)

@Nodebrute
Copy link
Contributor

Nodebrute commented Nov 12, 2024

Edited by proposal-police: This proposal was edited at 2024-11-12 16:28:26 UTC.

Proposal

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

Remove plus icon in the workspace switcher when you already have at least one workspace

What is the root cause of that problem?

Feature request

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

We can remove this code block

{shouldShowCreateWorkspaceIcon && (
<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>
)}

Note:Other cleanup can be done in the pr(for example removing unnecessary props)

What alternative solutions did you explore? (Optional)

We can also pass false here

<WorkspacesSectionHeader shouldShowCreateWorkspaceIcon={!shouldShowCreateWorkspace} />

@FitseTLT
Copy link
Contributor

Proposal

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

Remove plus icon in the workspace switcher when you already have at least one workspace

What is the root cause of that problem?

We show the button if the workspaces list is non-empty

const shouldShowCreateWorkspace = usersWorkspaces.length === 0;

<WorkspacesSectionHeader shouldShowCreateWorkspaceIcon={!shouldShowCreateWorkspace} />

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

We should show it when the workspaces list is zero

                    <WorkspacesSectionHeader shouldShowCreateWorkspaceIcon={shouldShowCreateWorkspace} />

What alternative solutions did you explore? (Optional)

@JmillsExpensify JmillsExpensify changed the title Remove plus icon in the workspace switcher when you already have at least one workspace [$250] Remove plus icon in the workspace switcher when you already have at least one workspace Nov 12, 2024
Copy link

melvin-bot bot commented Nov 12, 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.

@twilight2294
Copy link
Contributor

Proposal

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

Remove plus icon in the workspace switcher when you already have at least one workspace

What is the root cause of that problem?

Feature request,

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

Now we do not need the WorkspacesSectionHeader component anymore as we are only displaying the text and not icon, so we should delete the component WorkspacesSectionHeader altogether and then update the WorkspaceSwitcherPage to only display the text as follows:

--- a/src/pages/WorkspaceSwitcherPage/index.tsx
+++ b/src/pages/WorkspaceSwitcherPage/index.tsx
@@ -183,7 +183,16 @@ function WorkspaceSwitcherPage() {
                         pressableStyle={styles.flexRow}
                         shouldSyncFocus={false}
                     />
-                    <WorkspacesSectionHeader shouldShowCreateWorkspaceIcon={!shouldShowCreateWorkspace} />
+                    <View style={[styles.ph5, styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.mv2]}>
+                        <View>
+                            <Text
+                                style={styles.label}
+                                color={theme.textSupporting}
+                            >
+                                {translate('common.workspaces')}
+                            </Text>
+                        </View>
+                    </View>
                     <SelectionList<WorkspaceListItem>
                         ListItem={UserListItem}
                         sections={sections}

What alternative solutions did you explore? (Optional)

@JmillsExpensify
Copy link
Author

@suneox We've got a good amount of proposals on this issue, so let's try to prioritize getting through the first round of proposal review tomorrow. Thank you!

@Krishna2323
Copy link
Contributor

@JmillsExpensify, isn't this a dupe of #52030?

@suneox
Copy link
Contributor

suneox commented Nov 12, 2024

Since WorkspacesSectionHeader is only used on WorkspaceSwitcherPage and now it only contains a text header after removing the plus add icon so @twilight2294 solution remove WorkspaceSwitcherPage LGTM

We can go with @cretadn22 alternative proposal

🎀 👀 🎀 C+ reviewed

Copy link

melvin-bot bot commented Nov 12, 2024

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

@cretadn22
Copy link
Contributor

@suneox I’ve already outlined this approach in my alternative solution. Could you please take another look?

@suneox
Copy link
Contributor

suneox commented Nov 13, 2024

@suneox I’ve already outlined this approach in my alternative solution. Could you please take another look?

@cretadn22 Your alternative solution is missing container style

@cretadn22
Copy link
Contributor

cretadn22 commented Nov 13, 2024

@suneox This is a minor issue that can be addressed during the PR phase. I believe the proposal only needs to present the idea with a draft implementation to elaborate on it. I also feel it’s unfair when my proposal isn't selected because of the lack of minor styles in the proposal

@suneox
Copy link
Contributor

suneox commented Nov 13, 2024

Based on contributingGuides item 6 in Propose a solution for the job about

- Note: Before submitting a proposal on an issue, be sure to read any other existing proposals. ALL NEW PROPOSALS MUST BE DIFFERENT FROM EXISTING PROPOSALS. The *difference* should be important, meaningful or considerable.

I'd like to update selected proposal to @cretadn22 alternative proposal. Thanks for all proposal

cc: @marcochavezf

@twilight2294
Copy link
Contributor

twilight2294 commented Nov 13, 2024

@suneox this is not fair, with @cretadn22 if you do not apply the container style there would be alignment issues and the text would look weird, this should had been considered before writing the proposal :)

can you please apply the proposal from @cretadn22 and check yourself ? They posted incomplete proposal in the rush to post first

The difference should be important, meaningful or considerable.

The difference is indeed important as the style doesn't match the expected design if we do not also use container styles

In @cretadn22 's solution they mention that We can remove WorkspacesSectionHeader component add this code to WorkspaceSwitcherPage directly

When we implement @cretadn22 solution, the result we get is:

Screenshot 2024-11-13 at 4 00 07 PM

This is not at all expected @suneox @marcochavezf

The code they suggested didn't include the container style, which is important as without container style there are style issues in the page.

c.c. @marcochavezf

@Nodebrute
Copy link
Contributor

Nodebrute commented Nov 13, 2024

Just my two cents here: I believe this is a straightforward feature request, and minor styling adjustments can be easily handled in the PR itself. A proposal doesn’t need to include every small detail, and adding these minor changes to previous proposals might be unnecessary. I think this selection seems fair.

@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Nov 14, 2024
@garrettmknight garrettmknight moved this to Bugs and Follow Up Issues in [#whatsnext] #expense Nov 14, 2024
@marcochavezf
Copy link
Contributor

I agree with @Nodebrute; given the nature of the problem and the proposed solutions, it's difficult to determine which approach is objectively better.

That said, I appreciate your effort in defending your solution @twilight2294. I will respect @suneox's decision on this one, but I’m confident you'll have better luck with the next issue 🚀

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Nov 14, 2024
@twilight2294
Copy link
Contributor

Thanks, indeed hard luck but looking to contribute further

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: Bugs and Follow Up Issues
Development

No branches or pull requests

9 participants