Skip to content

Fix - Update empty state for tag and category#62670

Merged
thienlnam merged 18 commits intoExpensify:mainfrom
FitseTLT:fix-add-CTAs-in-empty-state-component-category-tag
Jun 11, 2025
Merged

Fix - Update empty state for tag and category#62670
thienlnam merged 18 commits intoExpensify:mainfrom
FitseTLT:fix-add-CTAs-in-empty-state-component-category-tag

Conversation

@FitseTLT
Copy link
Contributor

Details

Fixed Issues

$ #61908
PROPOSAL: #61908 (comment)

Tests

  1. Create a workspace
  2. delete all the categories
  3. Verify that add category and import spreadsheet buttons appear in the empty state component
  4. Enable tag feature
  5. Verify that add tag and import spreadsheet buttons appear in the empty state component
  • Verify that no errors appear in the JS console

Offline tests

Same as above

QA Steps

Same as above

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
    • MacOS: Desktop
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I verified the translation was requested/reviewed in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is approved by marketing by adding the Waiting for Copy label for a copy review on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG))
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label so the design team can review the changes.
  • If a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
2025-05-23.21-35-56.mp4
Android: mWeb Chrome
2025-05-23.21-34-39.mp4
iOS: Native
2025-05-23.19-48-07.mp4
iOS: mWeb Safari
2025-05-23.19-49-32.mp4
MacOS: Chrome / Safari
2025-05-23.19-46-10.mp4
MacOS: Desktop
2025-05-23.19-46-47.mp4

@FitseTLT FitseTLT requested a review from a team as a code owner May 23, 2025 19:54
@melvin-bot melvin-bot bot requested review from fedirjh and shawnborton and removed request for a team May 23, 2025 19:54
@melvin-bot
Copy link

melvin-bot bot commented May 23, 2025

@shawnborton @fedirjh One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@FitseTLT
Copy link
Contributor Author

@shawnborton I don't like the styling on large screens. The empty state component has maxWidth of 400 but looks like this is too small for importspreadsheet and add category buttons. We have many options but let me know your suggestion and will implement it 👍

@shawnborton
Copy link
Contributor

Hmm what if we shorten the button label to just be "Import"? Cc @Expensify/design for thoughts on that, but I think that would be really helpful and allow us to maintain the 50/50 split.

@FitseTLT
Copy link
Contributor Author

We can also consider increasing maxWidth.

@shawnborton
Copy link
Contributor

I'd prefer not to, as we've kind of standardized on this component in many places.

@fedirjh
Copy link
Contributor

fedirjh commented May 26, 2025

Hmm what if we shorten the button label to just be "Import"?

@shawnborton @FitseTLT we can use Add and Import

Screenshot 2025-05-26 at 6 45 08 PM

@dannymcclain
Copy link
Contributor

Not against shortening to Import (as long as the menu item stays the same). We could also just stack the buttons like we typically do on smaller viewports. No super strong feelings, but it seems like those are the two best options.

@shawnborton
Copy link
Contributor

@fedirjh do we still have room to keep Add category in your mock? We could also ditch the icons too and see if that helps!

@fedirjh
Copy link
Contributor

fedirjh commented May 26, 2025

@shawnborton These are different variations, For mobile should we make buttons go full width?

Wide View Mobile
Screenshot 2025-05-26 at 9 50 23 PM Screenshot 2025-05-26 at 9 50 42 PM
Screenshot 2025-05-26 at 9 52 25 PM Screenshot 2025-05-26 at 9 52 22 PM
Screenshot 2025-05-26 at 9 53 16 PM Screenshot 2025-05-26 at 9 53 41 PM
Screenshot 2025-05-26 at 9 54 39 PM Screenshot 2025-05-26 at 9 54 42 PM
Screenshot 2025-05-26 at 9 55 45 PM Screenshot 2025-05-26 at 9 55 48 PM

@dubielzyk-expensify
Copy link
Contributor

For mobile should we make buttons go full width?

Yes they should 👍

Alternatively we could stack the buttons vertically, but so far this is my favorite:

image

No massive feelings though.

@shawnborton
Copy link
Contributor

Yeah for this one:
CleanShot 2025-05-27 at 08 42 38@2x

The idea is that on desktop, each button takes up 50% width. This is an existing pattern. Can you try it?

And yes, on mobile, they should take up 100% width and be stacked. Thanks!

Copy link
Contributor

@fedirjh fedirjh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FitseTLT Can you please merge main ?

@FitseTLT
Copy link
Contributor Author

FitseTLT commented May 30, 2025

It looks like this: Let me know your opinion on the success type of the buttons I thought it looked nice when I make only the add tag/category buttons success type.

2025-05-30.23-28-24.mp4

In small screen, I think it is better if we stretch the buttons. I don't like it now.

2025-05-30.23-33-20.mp4

@shawnborton
Copy link
Contributor

Yeah, again, please see our comments here - on mobile, the buttons are stacked and take up 100% width.

@fedirjh
Copy link
Contributor

fedirjh commented Jun 3, 2025

@FitseTLT Can you merge main and address this #62670 (comment) ?

@FitseTLT
Copy link
Contributor Author

FitseTLT commented Jun 3, 2025

@shawnborton should that be applied to empty state component generally so that other instances using it would be affected too?

@shawnborton
Copy link
Contributor

What do you mean exactly?

@FitseTLT
Copy link
Contributor Author

FitseTLT commented Jun 3, 2025

What do you mean exactly?

We use empty state component in different places like in Reports.
image

So the suggestion to make the buttons full width for narrow layout apply to the component generally or only the empty state component we are dealing in this pr which is only tag and category?

@shawnborton
Copy link
Contributor

Ah, I didn't realize it was like that on mobile. Yes, we should update that for every place we use it, not just this PR. Can you take care of that?

@FitseTLT
Copy link
Contributor Author

FitseTLT commented Jun 3, 2025

Ah, I didn't realize it was like that on mobile. Yes, we should update that for every place we use it, not just this PR. Can you take care of that?

Its even easier from programmiing perspective. ON IT.

@FitseTLT
Copy link
Contributor Author

FitseTLT commented Jun 4, 2025

Nice catch @shawnborton Fixed

image

@shawnborton
Copy link
Contributor

Nice, and can you show me what it looks like now on mobile when there is indeed a category present? Thanks!

@FitseTLT
Copy link
Contributor Author

FitseTLT commented Jun 4, 2025

2025-06-04.17-15-07.mp4

@shawnborton
Copy link
Contributor

Okay nice, that looks correct to me. I think we can move into final review then!

Copy link
Contributor

@fedirjh fedirjh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Screenshots/Videos

Android: HybridApp
Tags Categories
Screenshot 2025-06-04 at 5 23 17 PM Screenshot 2025-06-04 at 5 23 23 PM
Android: mWeb Chrome
Tags Categories
Screenshot 2025-06-04 at 5 24 37 PM Screenshot 2025-06-04 at 5 24 17 PM
iOS: HybridApp
Tags Categories
Screenshot 2025-06-04 at 5 30 32 PM Screenshot 2025-06-04 at 5 29 40 PM
iOS: mWeb Safari
Tags Categories
Screenshot 2025-06-04 at 5 27 28 PM Screenshot 2025-06-04 at 5 27 23 PM
MacOS: Chrome / Safari Screenshot 2025-06-04 at 5 32 13 PM Screenshot 2025-06-04 at 5 32 18 PM
MacOS: Desktop Screenshot 2025-06-04 at 5 31 24 PM Screenshot 2025-06-04 at 5 31 28 PM

thienlnam
thienlnam previously approved these changes Jun 4, 2025
Copy link
Contributor

@thienlnam thienlnam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@thienlnam
Copy link
Contributor

Ah conflicts

@FitseTLT
Copy link
Contributor Author

FitseTLT commented Jun 4, 2025

I have resolved it but wait. I have one question for the author of the pr that conficted with this pr 👍

@FitseTLT
Copy link
Contributor Author

FitseTLT commented Jun 9, 2025

@fedirjh I have added one change of hiding the action buttons when policy has accounting connections. U can give a quick 👀 and we are good to go.

lottieWebViewStyles={styles.emptyStateFolderWebStyles}
headerContentStyles={styles.emptyStateFolderWebStyles}
buttons={
!policyHasAccountingConnections
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@FitseTLT Can you please explain this change, why the buttons are hidden in this case?

Copy link
Contributor Author

@FitseTLT FitseTLT Jun 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because we don't show the buttons when there is accounting connections even in their original place so we shouldn't do in the empty state component too.

const hasPrimaryActions = !hasAccountingConnections && !isMultiLevelTags;
return (
<View style={[styles.flexRow, styles.gap2, shouldUseNarrowLayout && styles.mb3]}>
{hasPrimaryActions && (

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, So that means tags and categories are managed in the accounting software. @shawnborton should we update the text in that case? Current state when accounting is enabled :

Screenshot 2025-06-09 at 4 11 46 PM

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I definitely think we should.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree that we should update the text. cc @jamesdeanexpensify @LLPeckham in case you have any good ideas here. Basically we want to change the empty state text to let them know that tags are controlled by their accounting sync.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your tags are currently importing from an accounting connection. Head over to [accounting] to make any changes.

Or something like that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Love it, that sounds great to me!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great shout!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need for categories @jamesdeanexpensify

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean like:

Your categories are currently importing from an accounting connection. Head over to [accounting] to make any changes.

@FitseTLT
Copy link
Contributor Author

FitseTLT commented Jun 11, 2025

Here is how it looks

2025-06-11.16-37-43.mp4

@shawnborton
Copy link
Contributor

Feels pretty good to me 👍

Copy link
Contributor

@thienlnam thienlnam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet! Thanks for being thorough with design on this one!

@thienlnam thienlnam merged commit 09c475d into Expensify:main Jun 11, 2025
17 checks passed
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@github-actions
Copy link
Contributor

🚀 Deployed to staging by https://github.com/thienlnam in version: 9.1.65-0 🚀

platform result
🖥 desktop 🖥 success ✅
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@github-actions
Copy link
Contributor

🚀 Deployed to production by https://github.com/Julesssss in version: 9.1.65-1 🚀

platform result
🖥 desktop 🖥 success ✅
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants