Skip to content

[HOLD for payment 2024-06-13] [$250] Tags - When deleting all tags, blank UI is shown #42220

Description

@lanitochka17

If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!


Version Number: 1.4.74-0
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: N/A
Email or phone of affected tester (no customers): applausetester+emilio@applause.expensifail.com
Issue reported by: Applause - Internal Team

Action Performed:

  1. Open the New Expensify App
  2. Sign into a valid account
  3. Click on WS > More features > Enable Tags (Notice that there will be an UI there since you have no tags yet)
  4. Create any tag then delete this tag

Expected Result:

User expects the initial "No Tag" UI to show up again and immediately

Actual Result:

No UI is shown, just a blank space. Even after exiting and returning or refreshing

Workaround:

Unknown

Platforms:

Which of our officially supported platforms is this issue occurring on?

  • Android: Native
  • Android: mWeb Chrome
  • iOS: Native
  • iOS: mWeb Safari
  • MacOS: Chrome / Safari
  • MacOS: Desktop

Screenshots/Videos

Add any screenshot/video evidence

Bug6482021_1715805828702.Tag_UI_is_not_shown_after_deleting_.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~015255d5c42b2d8ce7
  • Upwork Job ID: 1793173724031148032
  • Last Price Increase: 2024-05-22
  • Automatic offers:
    • tienifr | Contributor | 102491218
Issue OwnerCurrent Issue Owner: @JmillsExpensify

Activity

added
BugSomething is broken. Auto assigns a BugZero manager.
on May 15, 2024

lanitochka17 commented on May 15, 2024

@lanitochka17
Author

We think that this bug might be related to #wave-collect - Release 1

melvin-bot commented on May 15, 2024

@melvin-bot

Triggered auto assignment to @JmillsExpensify (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.

allgandalf commented on May 15, 2024

@allgandalf
Contributor

Proposal

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

Empty state UI is not shown when we delete tags and the action is still in optimistic state

What is the root cause of that problem?

We check for the length of the tagList and if it is zero then we display the empty UI component

{tagList.length === 0 && !isLoading && (
<WorkspaceEmptyStateSection
title={translate('workspace.tags.emptyTags.title')}
icon={Illustrations.EmptyStateExpenses}
subtitle={translate('workspace.tags.emptyTags.subtitle')}
/>
)}

When we delete the tags, the tags are still present in the tagList array with having a pending action delete. This causes the empty UI component to not show.

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

We need to update the condition of showing the Empty UI to consider the case if all the element in the tagList have pendingAction as delete, if true then we need to show the empty UI component.
We can reuse the same logic from categories:

const shouldShowEmptyState = !categoryList.some((category) => category.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) && !isLoading;

So we can introduce a new variable similar to categories which is shouldShowEmptyState:

const shouldShowEmptyState = !tagList.some((tag) => tag.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) && !isLoading;

Then update the condition at 1) empty UI state:

{tagList.length === 0 && !isLoading && (
<WorkspaceEmptyStateSection

To:

{shouldShowEmptyState && (
                    <WorkspaceEmptyStateSection

And 2) Tag list component:

{tagList.length > 0 && !isLoading && (
<SelectionList

To:

 {!shouldShowEmptyState && (
                    <SelectionList
Result Video
Screen.Recording.2024-05-16.at.2.40.55.AM.mov

Krishna2323 commented on May 15, 2024

@Krishna2323
Contributor

Proposal

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

Tags - When deleting all tags, blank UI is shown

What is the root cause of that problem?

The condition for showing empty WorkspaceEmptyStateSection isn't correct, we need to check for pending action also.

{tagList.length === 0 && !isLoading && (
<WorkspaceEmptyStateSection

{tagList.length > 0 && !isLoading && (
<SelectionList

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

We need to first check for !tagList.some((tag) => tag.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE), this will check if we have any tag list item with pending action not equal to DELETE and then we also need to check !(tagList.every((tag) => tag.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) && isOffline), this will check if all the list options has pending action of DELETE and isOffline is true, we need to add this check because in offline mode we want to show the deleted options instead of WorkspaceEmptyStateSection. We also need to check other policy pages and update that. Categories page condition also needs to be updated.

    const shouldShowEmptyState =
        !(tagList.every((tag) => tag.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) && isOffline) &&
        !tagList.some((tag) => tag.pendingAction !== CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE) &&
        !isLoading;

What alternative solutions did you explore? (Optional)

melvin-bot commented on May 21, 2024

@melvin-bot

@JmillsExpensify Huh... This is 4 days overdue. Who can take care of this?

added
ExternalAdded to denote the issue can be worked on by a contributor
on May 22, 2024
changed the title [-]Tags - When deleting all tags, blank UI is shown[/-] [+][$250] Tags - When deleting all tags, blank UI is shown[/+] on May 22, 2024

melvin-bot commented on May 22, 2024

@melvin-bot
added
Help WantedApply this label when an issue is open to proposals by contributors
on May 22, 2024

JmillsExpensify commented on May 22, 2024

@JmillsExpensify
Contributor

Opening this up to the community.

39 remaining items

melvin-bot commented on Jun 17, 2024

@melvin-bot

@JmillsExpensify, @Beamanator, @allroundexperts, @tienifr Eep! 4 days overdue now. Issues have feelings too...

Beamanator commented on Jun 18, 2024

@Beamanator
Contributor

@JmillsExpensify looks like we're ready for payment here 🙏

JmillsExpensify commented on Jun 19, 2024

@JmillsExpensify
Contributor

Payment summary:

JmillsExpensify commented on Jun 19, 2024

@JmillsExpensify
Contributor

Contributor paid out. C+ needs to fill out the checklist and is paid via New Expensify, so I'll circle back on this issue for payment approval.

allroundexperts commented on Jun 23, 2024

@allroundexperts
Contributor

Checklist

  1. Create WorkspaceTagsSettingsPage #37755
  2. https://github.com/Expensify/App/pull/37755/files#r1650184022
  3. N/A
  4. A regression test would be helpful. The steps given in the OP look good enough to me.

JmillsExpensify commented on Jul 20, 2024

@JmillsExpensify
Contributor

@mallenexpensify can you confirm the payment summary above?

mallenexpensify commented on Jul 22, 2024

@mallenexpensify
Contributor

Contributor: @tienifr due $250 via NewDot
Contributor+: @allroundexperts due $250 via NewDot

TestRail Gh https://github.com/Expensify/Expensify/issues/414355

JmillsExpensify commented on Jul 22, 2024

@JmillsExpensify
Contributor

$250 approved for @allroundexperts. @tienifr don't forget to submit via New Expensify.

melvin-bot commented on Jul 26, 2024

@melvin-bot

@JmillsExpensify, @Beamanator, @allroundexperts, @tienifr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

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

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions