App icon indicating copy to clipboard operation
App copied to clipboard

[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

Open kevinksullivan opened this issue 5 years ago • 61 comments

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.

  1. There is now Workspace header on web when a user is viewing the Workspace menu, making it inconsistent with mobile.
  2. As discussed here, there is no option to delete or create a new workspace from within the Workspace menu

image

Solution

  1. Add a Workspace header to web/desktop so that is consistent with mobile
  2. Add a "3 dot button" to the Workspace menu, and allow a user to select from two options; New Workspace and Delete Workspace

image

View all open jobs on GitHub

kevinksullivan avatar Sep 10 '21 00:09 kevinksullivan

Triggered auto assignment to @SofiedeVreese (AutoAssignerTriage), see https://stackoverflow.com/c/expensify/questions/4749 for more details.

MelvinBot avatar Sep 10 '21 00:09 MelvinBot

Picking this up for ya @SofiedeVreese just to get it out there. Job posted

https://www.upwork.com/jobs/~01a0df2a984ccdedd6

kevinksullivan avatar Sep 10 '21 00:09 kevinksullivan

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

MelvinBot avatar Sep 10 '21 00:09 MelvinBot

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 Screenshot 2021-09-10 at 6 23 59 AM

Now it will show for all web & desktop also.

Santhosh-Sellavel avatar Sep 10 '21 00:09 Santhosh-Sellavel

Screenshot 2021-09-10 at 6 26 38 AM

I see more options ( vertical three dots...) in the workspace side bar, from the image above. What options do we want to show now?

Santhosh-Sellavel avatar Sep 10 '21 01:09 Santhosh-Sellavel

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.

chiragsalian avatar Sep 10 '21 01:09 chiragsalian

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 isSmallScreenWidth is moved to be within HeaderWithCloseButton

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

mananjadhav avatar Sep 10 '21 01:09 mananjadhav

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.

chiragsalian avatar Sep 10 '21 01:09 chiragsalian

Thanks @chiragsalian

mananjadhav avatar Sep 10 '21 01:09 mananjadhav

@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

Santhosh-Sellavel avatar Sep 10 '21 01:09 Santhosh-Sellavel

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

Let me know if that make sense.

shawnborton avatar Sep 10 '21 01:09 shawnborton

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

shawnborton avatar Sep 10 '21 01:09 shawnborton

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

chiragsalian avatar Sep 10 '21 01:09 chiragsalian

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

mananjadhav avatar Sep 10 '21 01:09 mananjadhav

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.

shawnborton avatar Sep 10 '21 01:09 shawnborton

@chiragsalian I tested out Chirag. The HeaderWithCloseButton will 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 HeaderWithCloseButton component 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

Santhosh-Sellavel avatar Sep 10 '21 01:09 Santhosh-Sellavel

Updated Proposal

@chiragsalian, Based on @shawnborton's feedback on the requirement here's my updated proposal. We modify the HeaderWithCloseButton

  1. Add three props: shouldShowThreeDotsMenu (for lack of better word, need suggestions ), shouldShowCloseButton and a function onThreeDotIconPress.
  2. Add the following code:

props.shouldShowThreeDotsMenu && (
                    <Tooltip text={props.translate('common.more')}>

                        <TouchableOpacity
                            onPress={props.onThreeDotIconPress}
                            style={[styles.touchableButtonImage]}
                        >
                            <Icon src={ThreeDotIcon} />
                        </TouchableOpacity>
                    </Tooltip>

  1. 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>
)
  1. Lastly, in WorkspaceSidebar, remove isSmallScreenWidth conditional 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()}
                            />
                        }

mananjadhav avatar Sep 10 '21 01:09 mananjadhav

@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]" 🙂

chiragsalian avatar Sep 10 '21 01:09 chiragsalian

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

chiragsalian avatar Sep 10 '21 01:09 chiragsalian

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.

mananjadhav avatar Sep 10 '21 02:09 mananjadhav