Open JmillsExpensify opened 1 week ago
Current assignee @JmillsExpensify is eligible for the Bug assigner, not assigning anyone new.
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk (External
)
⚠️ 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.
Let me know if you have any questions on this issues, happy to clarify.
Edited by proposal-police: This proposal was edited at 2024-11-05 11:54:40 UTC.
Don't show two creation options at the same time in the workspace switcher
We did not hide the option if the user does not have workspaces or member group of a workspace https://github.com/Expensify/App/blob/3d0f309b5ebc4f5bfd1279949c6eddca663e42a4/src/pages/WorkspaceSwitcherPage/WorkspacesSectionHeader.tsx#L31-L33
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 https://github.com/Expensify/App/blob/3d0f309b5ebc4f5bfd1279949c6eddca663e42a4/src/pages/home/sidebar/SidebarScreen/FloatingActionButtonAndPopover.tsx#L456-L459
In this issue we decided to return true for hasActiveChatEnabledPolicies if the user is member of other group workspaces
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).
Edited by proposal-police: This proposal was edited at 2024-11-05 12:05:03 UTC.
Don't show two creation options at the same time in the workspace switcher
We do not hide the Plus
icon for empty state view:
We need to pass shouldShowCreateWorkspace
:
https://github.com/Expensify/App/blob/3d0f309b5ebc4f5bfd1279949c6eddca663e42a4/src/pages/WorkspaceSwitcherPage/index.tsx#L149
to the below component:
<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:
https://github.com/Expensify/App/blob/3d0f309b5ebc4f5bfd1279949c6eddca663e42a4/src/pages/WorkspaceSwitcherPage/index.tsx#L196
Don't show two creation options at the same time in the workspace switcher
Changes request
Accept shouldShowCreateWorkspace
on WorkspacesSectionHeader
https://github.com/Expensify/App/blob/3d0f309b5ebc4f5bfd1279949c6eddca663e42a4/src/pages/WorkspaceSwitcherPage/WorkspacesSectionHeader.tsx#L16
And only show the + icon if shouldShowCreateWorkspace
is true
https://github.com/Expensify/App/blob/3d0f309b5ebc4f5bfd1279949c6eddca663e42a4/src/pages/WorkspaceSwitcherPage/WorkspacesSectionHeader.tsx#L31
{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
https://github.com/Expensify/App/blob/3d0f309b5ebc4f5bfd1279949c6eddca663e42a4/src/pages/WorkspaceSwitcherPage/index.tsx#L186
<WorkspacesSectionHeader
shouldShowCreateWorkspace={!shouldShowCreateWorkspace}
/>
Result
Updated the proposal to add an extra point and pass the prop to main component
I’ll review the proposals shortly.
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
Triggered auto assignment to @MariaHCD, see https://stackoverflow.com/c/expensify/questions/7972 for more details.
@brunovjk @MariaHCD I believe my proposal is the first with the correct solution
Timestamp:
Btw to be honest I started writing my proposal before proposal 2 was posted, and don't use any information from proposal 2
I think we can go with @twilight2294's https://github.com/Expensify/App/issues/52030#issuecomment-2456991192.
@brunovjk , yes i was the first one to give the correct approach to the bug, so my solution is valid in this case :)
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!
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 9.0.60-3 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2024-11-20. :confetti_ball:
For reference, here are some details about the assignees on this issue:
@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]
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:
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).
Issue Owner
Current Issue Owner: @JmillsExpensify