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

[HOLD for payment 2024-04-15] [$500] HIGH: Add empty state UI for the LHN #34926

Closed
roryabraham opened this issue Jan 22, 2024 · 66 comments
Closed
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.

Comments

@roryabraham
Copy link
Contributor

roryabraham commented Jan 22, 2024

Slack context: https://expensify.slack.com/archives/C01GTK53T8Q/p1705945570975289

Problem

In #focus mode it's possible to "clear out" your LHN such that there's no chats that appear. Note that this only happens on mobile because on wide screens you always have a chat open. In this case, the app looks semi-broken because it's so empty.

image

Solution

Create an "empty state" UI that gives the user something fun to look at when they've cleared out the LHN in #focus mode.

Mockup
Figma link

image

Empty state animation
Fireworks lottie file

Empty state illustration
Fireworks.svg.zip
Note that ideally we will want to use an animation here—I'm just attaching the SVG as a just-in-case.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~012902c6ddfd90e221
  • Upwork Job ID: 1749533931715035136
  • Last Price Increase: 2024-01-22
  • Automatic offers:
    • DylanDylann | Contributor | 28123180
    • tienifr | Contributor | 0
@roryabraham roryabraham added External Added to denote the issue can be worked on by a contributor Daily KSv2 NewFeature Something to build that is a new item. labels Jan 22, 2024
@roryabraham roryabraham self-assigned this Jan 22, 2024
Copy link

melvin-bot bot commented Jan 22, 2024

Job added to Upwork: https://www.upwork.com/jobs/~012902c6ddfd90e221

@melvin-bot melvin-bot bot changed the title [LOW] Empty state UI for the LHN [$500] [LOW] Empty state UI for the LHN Jan 22, 2024
Copy link

melvin-bot bot commented Jan 22, 2024

@melvin-bot melvin-bot bot added Weekly KSv2 Help Wanted Apply this label when an issue is open to proposals by contributors and removed Daily KSv2 labels Jan 22, 2024
Copy link

melvin-bot bot commented Jan 22, 2024

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

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jan 22, 2024
@roryabraham
Copy link
Contributor Author

Cheers to @dannymcclain for the mockup. If possible, can you include some Figma screenshots in the issue description to show precise sizes and layout? That would be helpful

@dannymcclain
Copy link
Contributor

@roryabraham haha I was JUST about to post a link to the Figma. Yes, I'll get some stuff together and add it to the description.

@roryabraham
Copy link
Contributor Author

Cheers!

@abzokhattab
Copy link
Contributor

abzokhattab commented Jan 22, 2024

Proposal

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

show nothing to see here if LHN visible options are zero.

What is the root cause of that problem?

new feature

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

If the length of options inside the LHN is zero,then display the "nothing to show here" page. This is done by adding a condition in the LHN list component below to show the new page when there are no options

if data.length === 0 --> then show the new page.

<View style={style || styles.flex1}>
<FlashList
indicatorStyle="white"
keyboardShouldPersistTaps="always"
contentContainerStyle={contentContainerStyles}
data={data}
testID="lhn-options-list"
keyExtractor={keyExtractor}
renderItem={renderItem}
estimatedItemSize={optionMode === CONST.OPTION_MODE.COMPACT ? variables.optionRowHeightCompact : variables.optionRowHeight}
extraData={[currentReportID]}
showsVerticalScrollIndicator={false}
/>

@neonbhai
Copy link
Contributor

neonbhai commented Jan 22, 2024

Proposal

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

Empty state UI for the LHN

What is the root cause of that problem?

New Feature

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

We will show the new view here if data is empty:

return (
<View style={style || styles.flex1}>
<FlashList

We can use the BlockingView component indicate that the LHN is empty:

const isLHNEmpty = data.length === 0;

...
return ( 
  {isLHNEmpty ? (
      <BlockingView
          icon={Illustrations.EmptyLHN}
          title={translate('common.EmptyLHN')}
          subtitle={translate('common.EmptyLHN')}
      />
  ) : (
  ...

If the illustration finalizes to be Lottie Animation, we can extend BlockingView to take in an optional prop of type DotLottieAnimation here and render if passed:

type BlockingViewProps = {
   
   ...
   
   /**JSON object representing a Lottie animation. Will be shown over the title text*/
   illustration?: DotLottieAnimation;
}
  
  ...
  
  {!_.isNull(illustration) ? (
      <Lottie
          source={illustration}
          style={styles.w100}
          webStyle={styles.w100}
          autoPlay
          loop
      />
   ) : (
   
   ...

Alternatively

We can create a new component with styles similar to BlockingView to show the icon, title and subtitle. This allows greater control if the design changes in the future

@jeremy-croff
Copy link
Contributor

Proposal

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

There's no zero state for the sidebar when there's no option list items

What is the root cause of that problem?

This use cases has not been handled. A new user would always have the concierge chat. It's possible to get into the zero state use case when they get cleared from the focus flow.

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

We should create a new zero state component, with props for the icon, text, and instructions.

We can use this in the component where we can render a zero state if the data is empty. And can reuse this component for future use cases.

What alternative solutions did you explore? (Optional)

  • Don't allow last item to be hidden ( limits user experience )
  • Don't allow concierge to be hidden in focus

@tienifr
Copy link
Contributor

tienifr commented Jan 23, 2024

Proposal

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

We want to create an "empty state" UI that gives the user something fun to look at when they've cleared out the LHN in #focus mode

What is the root cause of that problem?

This is a new feature.

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

This issue looks straight forward at a glance, but the complicated thing here is that in the subtitle text we're rendering the icons inside the text itself, and the BlockingView component that we typically use for this use case does not support such inline icons yet. The existing subtitle of BlockingView as suggested above won't be able to support that use case.

  1. We need to add support for custom subtitle renderer in BlockingView. We need to update this to
{renderSubtitle ? renderSubtitle() : (
    shouldEmbedLinkWithSubtitle ? (
        <Text style={[styles.textAlignCenter]}>{renderContent()}</Text>
    ) : (
        <View style={[styles.alignItemsCenter, styles.justifyContentCenter]}>{renderContent()}</View>
    )
)}

so that we support custom subtitle renderer renderSubtitle as a prop.

  1. In LHNOptionsList, define a renderEmptyStateSubtitle with the logic to embed the icons into the text
const renderEmptyStateSubtitle = useCallback(() =>
        <View style={[styles.alignItemsCenter, styles.justifyContentCenter]}>
            <Text color={theme.placeholderText} style={styles.textAlignCenter}>
                {translate('common.findAChatUsingThe')}
                <Icon
                    src={Expensicons.MagnifyingGlass}
                    width={variables.iconSizeSmall}
                    height={variables.iconSizeSmall}
                    small
                    inline
                    fill={theme.icon}
                />
                {translate('common.buttonAboveOrCreateSomethingUsingThe')}
                <Icon
                    src={Expensicons.Plus}
                    width={variables.iconSizeSmall}
                    height={variables.iconSizeSmall}
                    small
                    inline
                    fill={theme.icon}
                />
                {translate('common.buttonBelow')}
            </Text>
        </View>, 
    [theme, styles.alignItemsCenter, styles.justifyContentCenter, styles.textAlignCenter, translate]);

In here I use the regular text space to render the space between the icon and surround text, but if we want it to be exact pixels, we can do that by passing custom styles to the Icon (and also a bit of style handling inside Icon itself for the icon container, current component as is doesn't seem to be able to support such exact pixels).

We also need to embed the icons inside wrapper Text component, make sure the icons are inline and style it properly for it to work as per design.

  1. And then if the LHN is empty (by checking the data passed into the FlashList), render the BlockingView instead of the FlashList
<BlockingView
    icon={Illustrations.TeleScope}
    iconWidth={variables.emptyWorkspaceIconWidth}
    iconHeight={variables.emptyWorkspaceIconHeight}
    title={translate('common.nothingToSeeHere')}
    shouldShowLink={false}
    renderSubtitle={renderEmptyStateSubtitle}
/>

Or we can make use of the ListEmptyComponent prop of the FlashList to do this.

  1. Some translations used above needs to be added here
nothingToSeeHere: 'Nothing to see here',
findAChatUsingThe: 'Find a chat using the ',
buttonAboveOrCreateSomethingUsingThe: " button above, or create something using the ",
buttonBelow: ' button below.',
  1. In case we want to go with a Lottie animation, we can passed in a animation prop into BlockingView and use it with <Lottie /> instead of icon if it's defined. According to the confirmation here, we should use the LottieAnimations.Fireworks for this, we already use that animation elsewhere like in here so can just do the same for the BlockingView with the same approach.

We can also isolate the changes in 2 and 3 (by condition) to only smallScreenWidth screens, since this not found page only applies to small screen as per the OP.

What alternative solutions did you explore? (Optional)

There might be further minor style changes needed (color, spacing, ...) that can be addressed in the PR phase.

If we're worried about the text being broken down into chunks for translations (I saw we're doing it in many other places in the app so I think we're fine with it), we can improve the translation variables engine so that it can put Icons as variables.

Regarding the inline app icons in the text, one alternative is we can use equivalent chat emojis, but that won't look like the app's design (and the buttons we're telling the users about) and it will look inconsistent.

Result (before Lottie animation was confirmed, with Lottie it will be look a bit different)

Simulator Screenshot - iPhone 15 Pro - 2024-01-23 at 11 53 43

@roryabraham
Copy link
Contributor Author

Thanks for the proposals everyone, just want to clarify that the designs are finalized. Going to hold off on accepting a proposal until I get the final 👍🏼 from @dannymcclain https://expensify.slack.com/archives/C01GTK53T8Q/p1706085371949699?thread_ts=1705945570.975289&cid=C01GTK53T8Q

@dannymcclain
Copy link
Contributor

Thanks @roryabraham! I think we may want to consider an alternate illustration and some updated copy. Structurally, I think the layout is pretty well determined, but I'd like to get the final details worked out with the team.

@roryabraham
Copy link
Contributor Author

kk, going to slap the Planning label on this and temporarily remove Help Wanted. My apologies to those that left proposals already – @dubielzyk-expensify joined the convo a bit after I created this issue and came in swinging with some awesome ideas we don't want to ignore.

@roryabraham roryabraham added Planning Changes still in the thought process and removed Help Wanted Apply this label when an issue is open to proposals by contributors labels Jan 24, 2024
@laurenreidexpensify
Copy link
Contributor

Waiting for KI retest on #37296

@DylanDylann
Copy link
Contributor

DylanDylann commented Mar 26, 2024

@laurenreidexpensify no longer hold, please remove hold label

@DylanDylann DylanDylann mentioned this issue Apr 1, 2024
50 tasks
@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Weekly KSv2 labels Apr 1, 2024
@laurenreidexpensify laurenreidexpensify changed the title [HOLD 37296][$500] HIGH: Add empty state UI for the LHN [$500] HIGH: Add empty state UI for the LHN Apr 2, 2024
@laurenreidexpensify
Copy link
Contributor

PR deployed to staging 🚀

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Apr 8, 2024
@melvin-bot melvin-bot bot changed the title [$500] HIGH: Add empty state UI for the LHN [HOLD for payment 2024-04-15] [$500] HIGH: Add empty state UI for the LHN Apr 8, 2024
Copy link

melvin-bot bot commented Apr 8, 2024

Reviewing label has been removed, please complete the "BugZero Checklist".

@melvin-bot melvin-bot bot removed the Reviewing Has a PR in review label Apr 8, 2024
Copy link

melvin-bot bot commented Apr 8, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 1.4.60-13 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

If no regressions arise, payment will be issued on 2024-04-15. 🎊

For reference, here are some details about the assignees on this issue:

Copy link

melvin-bot bot commented Apr 8, 2024

BugZero Checklist: The PR adding this new feature has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:

  • [@DylanDylann] Please propose regression test steps to ensure the new feature will work correctly on production in further releases.
  • [@laurenreidexpensify] Link the GH issue for creating/updating the regression test once above steps have been agreed upon.

@trjExpensify
Copy link
Contributor

Heads up, @tienifr & @DylanDylann: #39932 (comment)

@tienifr
Copy link
Contributor

tienifr commented Apr 10, 2024

#39932 is not a regression from this one as per #39932 (comment).

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Apr 14, 2024
@laurenreidexpensify
Copy link
Contributor

@trjExpensify can you confirm ^^

@roryabraham
Copy link
Contributor Author

according to the investigation of a few people on #39932, it was not caused by #37361. So we don't think this caused a regression

@trjExpensify
Copy link
Contributor

Correct yeah, seems like it's onboarding related. :)

@laurenreidexpensify
Copy link
Contributor

Payment Summary:

@laurenreidexpensify
Copy link
Contributor

Payment Summary:

@laurenreidexpensify
Copy link
Contributor

@DylanDylann @tienifr please confirm checklist / regression testing

@DylanDylann
Copy link
Contributor

DylanDylann commented Apr 17, 2024

Regression Test Proposal

Small screen devices only

  1. Switch to #focus mode
  2. Mark all reports as read or unpin them so that LHN is cleared out
  3. Verify the empty state UI shows as expected
  4. Verify it in different themes, languages and devices

Do we agree 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Daily KSv2 External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item.
Projects
No open projects
Archived in project
Status: Release 1: Ideal Nav & Collect Simplfied Profile, Members, Categories, Workflows (approvals)
Development

No branches or pull requests