Repository navigation
[HOLD for payment 2024-06-13] [$250] Tags - When deleting all tags, blank UI is shown #42220
Description
Activity
We think that this bug might be related to #wave-collect - Release 1
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.
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
App/src/pages/workspace/tags/WorkspaceTagsPage.tsx
Lines 325 to 331 in ac2b3a0
| {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:
App/src/pages/workspace/tags/WorkspaceTagsPage.tsx
Lines 325 to 326 in ac2b3a0
| {tagList.length === 0 && !isLoading && ( | |
| <WorkspaceEmptyStateSection |
To:
{shouldShowEmptyState && (
<WorkspaceEmptyStateSectionAnd 2) Tag list component:
App/src/pages/workspace/tags/WorkspaceTagsPage.tsx
Lines 332 to 333 in ac2b3a0
| {tagList.length > 0 && !isLoading && ( | |
| <SelectionList |
To:
{!shouldShowEmptyState && (
<SelectionListResult Video
Screen.Recording.2024-05-16.at.2.40.55.AM.mov
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.
App/src/pages/workspace/tags/WorkspaceTagsPage.tsx
Lines 325 to 326 in e35ab02
| {tagList.length === 0 && !isLoading && ( | |
| <WorkspaceEmptyStateSection |
App/src/pages/workspace/tags/WorkspaceTagsPage.tsx
Lines 332 to 333 in e35ab02
| {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)
@JmillsExpensify Huh... This is 4 days overdue. Who can take care of this?
Job added to Upwork: https://www.upwork.com/jobs/~015255d5c42b2d8ce7
Opening this up to the community.
39 remaining items
@JmillsExpensify, @Beamanator, @allroundexperts, @tienifr Eep! 4 days overdue now. Issues have feelings too...
@JmillsExpensify looks like we're ready for payment here 🙏
Payment summary:
- Contributor: $250 @tienifr
- Contributor+: $250 @allroundexperts
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.
Checklist
- Create WorkspaceTagsSettingsPage #37755
- https://github.com/Expensify/App/pull/37755/files#r1650184022
- N/A
- A regression test would be helpful. The steps given in the OP look good enough to me.
@mallenexpensify can you confirm the payment summary above?
Contributor: @tienifr due $250 via NewDot
Contributor+: @allroundexperts due $250 via NewDot
TestRail Gh https://github.com/Expensify/Expensify/issues/414355
$250 approved for @allroundexperts. @tienifr don't forget to submit via New Expensify.
@JmillsExpensify, @Beamanator, @allroundexperts, @tienifr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
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:
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?
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
Issue Owner
Current Issue Owner: @JmillsExpensify