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

Update workspace switcher to look and act more like a filter #52654

Open
jamesdeanexpensify opened this issue Nov 15, 2024 · 5 comments
Open
Assignees
Labels
Daily KSv2 NewFeature Something to build that is a new item.

Comments

@jamesdeanexpensify
Copy link
Contributor

jamesdeanexpensify commented Nov 15, 2024

Background

Coming from this long convo, we'd like to update the workspace switcher to look and act more like a filter.

Problem

The current workspace chat switcher has the "Everything" > "Expensify" selection as its default, which is unnecessary in general (especially when you don't have any workspaces) and takes up valuable real estate.

Solution

  • Remove the "Everything" > "Expensify" section of the workspace switcher completely. Showing everything both on and off workspace will just be the default of the product.
  • Since showing everything both on and off workspace will now be the default of the product, the workspace switcher should default to no workspaces selected in the switcher (which means it's showing everything).
    • The closed state of the switch should appear the same as it does now when "Everything > Expensify" is selected.
  • Selecting a given workspace will filter only for that workspace.
    • The closed state of the switcher should appear the same as it does now when a workspace is selected.
  • Note: If multiple workspaces exist, only allow for filtering on one workspace at a time. Don't allow multi-select.

Screenshots

Here's what we want the finished product to look like:
CleanShot 2024-11-15 at 13 43 23@2x

@jamesdeanexpensify jamesdeanexpensify added Daily KSv2 NewFeature Something to build that is a new item. labels Nov 15, 2024
Copy link

melvin-bot bot commented Nov 15, 2024

Triggered auto assignment to @CortneyOfstad (NewFeature), see https://stackoverflowteams.com/c/expensify/questions/14418#:~:text=BugZero%20process%20steps%20for%20feature%20requests for more details. Please add this Feature request to a GH project, as outlined in the SO.

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Daily KSv2 labels Nov 15, 2024
Copy link

melvin-bot bot commented Nov 15, 2024

⚠️ It looks like this issue is labelled as a New Feature but not tied to any GitHub Project. Keep in mind that all new features should be tied to GitHub Projects in order to properly track external CAP software time ⚠️

Copy link

melvin-bot bot commented Nov 15, 2024

Triggered auto assignment to Design team member for new feature review - @shawnborton (NewFeature)

@nkdengineer
Copy link
Contributor

nkdengineer commented Nov 15, 2024

Proposal

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

Update workspace switcher to look and act more like a filter

What is the root cause of that problem?

new feature

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

  1. Change translation key title here to "Filter by workspace"

headerTitle: 'Choose a workspace',

  1. Remove every thing section here

<View style={[styles.ph5, styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.mb1]}>
<Text
style={styles.label}
color={theme.textSupporting}
>
{translate('workspace.switcher.everythingSection')}
</Text>
</View>
<UserListItem
item={defaultPolicy}
isFocused={activeWorkspaceID === undefined}
showTooltip={false}
onSelectRow={() => selectPolicy(defaultPolicy)}
pressableStyle={styles.flexRow}
shouldSyncFocus={false}
/>
<WorkspacesSectionHeader shouldShowCreateWorkspaceIcon={!shouldShowCreateWorkspace} />

  1. Update onSelectRow function in SelectionList

  2. Add new button Clear filter

What alternative solutions did you explore? (Optional)

NA

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Nov 15, 2024
@Krishna2323
Copy link
Contributor

Krishna2323 commented Nov 15, 2024

Edited by proposal-police: This proposal was edited at 2024-11-15 20:18:58 UTC.

Proposal


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

Update workspace switcher to look and act more like a filter

What is the root cause of that problem?

Feature update

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


  • Remove header text UserListItem & WorkspacesSectionHeader.
    <View style={[styles.ph5, styles.flexRow, styles.justifyContentBetween, styles.alignItemsCenter, styles.mb1]}>
    <Text
    style={styles.label}
    color={theme.textSupporting}
    >
    {translate('workspace.switcher.everythingSection')}
    </Text>
    </View>
    <UserListItem
    item={defaultPolicy}
    isFocused={activeWorkspaceID === undefined}
    showTooltip={false}
    onSelectRow={() => selectPolicy(defaultPolicy)}
    pressableStyle={styles.flexRow}
    shouldSyncFocus={false}
    />
    <WorkspacesSectionHeader shouldShowCreateWorkspaceIcon={!shouldShowCreateWorkspace} />
  • Add confirm button props to SelectionList.
                        showConfirmButton
                        confirmButtonText={'Clear filter'}
                        onConfirm={() => selectPolicy(defaultPolicy)}
  • We need to add the translation for 'Clear filter' and update the translation for workspace.switcher.headerTitle.
  • We also need to introduce a prop in BaseSelectionList, to overwrite the success prop value.
    {showConfirmButton && (
    <FixedFooter style={[styles.mtAuto]}>
    <Button
    success
    large
    style={[styles.w100]}
    text={confirmButtonText || translate('common.confirm')}
    onPress={onConfirm}
    pressOnEnter
    enterKeyEventListenerPriority={1}
    />
    </FixedFooter>
    )}
    {!!footerContent && <FixedFooter style={[styles.mtAuto]}>{footerContent}</FixedFooter>}
    </View>

What alternative solutions did you explore? (Optional)

Result

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Daily KSv2 NewFeature Something to build that is a new item.
Projects
Status: No status
Development

No branches or pull requests

5 participants