[HOLD for payment 2021-12-27] [HOLD for payment 2021-12-15] Add "Workspace" to the Workspace menu on the left pane header on Desktop/Web and button to delete/add new workspaces
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Problem
There are three issues we are tackling here based on the conversation below.
- There is now
Workspaceheader on web when a user is viewing the Workspace menu, making it inconsistent with mobile. - As discussed here, there is no option to delete or create a new workspace from within the Workspace menu

Solution
- Add a
Workspaceheader to web/desktop so that is consistent with mobile - Add a "3 dot button" to the Workspace menu, and allow a user to select from two options;
New WorkspaceandDelete Workspace

Triggered auto assignment to @SofiedeVreese (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.
Picking this up for ya @SofiedeVreese just to get it out there. Job posted
https://www.upwork.com/jobs/~01a0df2a984ccdedd6
Triggered auto assignment to @chiragsalian (Exported), see https://stackoverflow.com/c/expensify/questions/7972 for more details.
Proposal
It is enabled here only if isSmallScreenWidth is true that's why it is shown for mobile alone.
https://github.com/Expensify/App/blob/2578d3a662a1f405af6c8cabb8b2e36862206077/src/pages/workspace/WorkspaceSidebar.js#L100-L106
We should remove the check, and refactor like this

Now it will show for all web & desktop also.
I see more options ( vertical three dots...) in the workspace side bar, from the image above. What options do we want to show now?
Hmm, have you tested that plan @Santhosh-Sellavel. I have not but the reason I ask is because the component says HeaderWithCloseButton so I feel like a close button would show next to the header in your current plan which isn't what we want.
So maybe the proposal would involve a change wherein isSmallScreenWidth is moved to be within HeaderWithCloseButton so that the close button is only shown for mobile devices and not web & desktop. Does that make sense? Let me know if I'm mistaken.
Proposal Just removing the isSmallScreenWidth won't solve it as we don't want the close button. Hence I recommend adding a conditional element Header for large screens.
{
isSmallScreenWidth
? (
<HeaderWithCloseButton
title={translate('workspace.common.workspace')}
onCloseButtonPress={() => Navigation.dismissModal()}
/>
)
:
(
<Header title={translate('workspace.common.workspace')} />
)
}
So maybe the proposal would involve a change wherein
isSmallScreenWidthis moved to be withinHeaderWithCloseButton
@chiragsalian I wouldn't recommend that as HeaderWithCloseButton is used at multiple places like IOUModal etc. Here the close button is relevant for all platforms including Web & Desktop.
Nice yeah i like that plan, then we don't have to worry about the 3 dots too since its literally just the header. Plain and simple. I like it 🙂
@kevinksullivan, feel to hire @mananjadhav in upwork. @mananjadhav feel free to create the PR.
Thanks @chiragsalian
@chiragsalian I tested out Chirag. The HeaderWithCloseButton will show a close icon. I see more options in the Expected section as said here https://github.com/Expensify/App/issues/5185#issuecomment-916550999
The header alone we can use, we need some styling. I suggest we use HeaderWithCloseButton component itself. And rename it to more generic name. The close button can be configurable with a new prop like shouldShowClose
That being said, the three dots essentially replace the "x" icon. Style-wise, hopefully the top part of the left pane is basically identical to mobile, with the exception that the "X" button is removed. Here it is in full context:

Let me know if that make sense.
@kevinksullivan I know you had a separate issue for the three dots (I think?) but I wonder if it makes sense to address this together.
@mananjadhav, maybe pause on the PR atm, until we confirm the design. It's a little different than the original expected result. I think it makes sense to tackle the three dots design here too.
@shawnborton I am guessing the three dots are not there at the moment and will be added sometime later? Adding the three dots menu would be a part of WorkspaceSidebar, so shouldn't have an impact on the design if we just add the Header. Might require some basic flex styling changes.
Ideally it won't require any style changes, we should be able to reuse the header component in both the left pane and in the right pane. It's just a matter of only passing through the icon with three dots on the left for desktop. We will provide that .svg for the icon as well.
@chiragsalian I tested out Chirag. The
HeaderWithCloseButtonwill show a close icon. I see more options in the Expected section as said here #5185 (comment)The header alone we can use, we need some styling. ~I suggest we use
HeaderWithCloseButtoncomponent itself. And rename it to a more generic name.~ So we can just make, the close button can be configurable with a new prop like shouldShowCloseButton
I think we should just use HeaderWithCloseButton and add more options like other actions we have like download, etc. an
Along with the changes I suggested above. we can use shouldShowCloseButton to hide it if not smallScreenWidth
@chiragsalian
Updated Proposal
@chiragsalian, Based on @shawnborton's feedback on the requirement here's my updated proposal. We modify the HeaderWithCloseButton
- Add three props:
shouldShowThreeDotsMenu(for lack of better word, need suggestions ),shouldShowCloseButtonand a functiononThreeDotIconPress. - Add the following code:
props.shouldShowThreeDotsMenu && (
<Tooltip text={props.translate('common.more')}>
<TouchableOpacity
onPress={props.onThreeDotIconPress}
style={[styles.touchableButtonImage]}
>
<Icon src={ThreeDotIcon} />
</TouchableOpacity>
</Tooltip>
- Update the close button section like:
props.shouldShowCloseButton && (
<Tooltip text={props.translate('common.close')}>
<TouchableOpacity
onPress={props.onCloseButtonPress}
style={[styles.touchableButtonImage, styles.mr0]}
accessibilityRole="button"
accessibilityLabel={props.translate('common.close')}
>
<Icon src={Close} />
</TouchableOpacity>
</Tooltip>
)
- Lastly, in
WorkspaceSidebar, removeisSmallScreenWidthconditional render.
{
<HeaderWithCloseButton
title={translate('workspace.common.workspace')}
shouldShowCloseButton={isSmallScreenWidth}
onCloseButtonPress={isSmallScreenWidth ? () => Navigation.dismissModal(): null}
/** Guessing we don't have it right now but whenever we add */
shouldShowThreeDotMenu={true}
onThreeDotMenu={() => ourFunctionToHandleThis()}
/>
}
@Santhosh-Sellavel, firstly I'm unsure what to reply to your post because there is no question associated with it. It felt like you were sharing a thought. Then a little unsure why you linked my https://github.com/Expensify/App/issues/5185#issuecomment-916550999 to begin with.
So we've to still wait for @kevinksullivan to confirm he's on board with the changes.
Additionally, you mentioned The HeaderWithCloseButton will show a close icon in your post here but we don't want to show a close button hence I preferred manan's proposal at this time. The original design also didn't have 3 dots and was just the header which is why manan's original proposal fit the solution better.
Let me know if I'm misunderstanding something or if you have any follow-up questions for me. Plus feel free to hit me up on Expensify chat anytime for questions. My email - "[email protected]" 🙂
@mananjadhav, I like the proposal thought. Question though, what are the options shown when the 3 dots are clicked? When I create a workspace on mobile or web I don't see it so I was wondering what is it even supposed to contain? Is it for specific pages that doesn't include the workspace page?
Afaik, it seems we are planning to add more menu options in Workspace on click of the button. Even I am not sure what atm, @shawnborton might be the best person to share. I am guessing what he expects is that we don’t redo this when we add that menu.
I added those checks and icon so that whenever we plan to add it we just have to add the prop and the function handling. Headed components stays the same.