Expensify / App

Welcome to New Expensify: a complete re-imagination of financial collaboration, centered around chat. Help us build the next generation of Expensify by sharing feedback and contributing to the code.
https://new.expensify.com
MIT License
3.29k stars 2.72k forks source link

[HOLD for payment 2024-07-24] iOS - Search - Empty modal is shown when tapping on "0 selected" dropdown #45445

Closed m-natarajan closed 1 week ago

m-natarajan commented 1 month ago

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: 9.0.7- 4 Reproducible in staging?: y Reproducible in production?: n 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): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: applause internal team Slack conversation:

Action Performed:

Precondition:

  1. Launch New Expensify app.
  2. Go to Search.
  3. Long tap on any expense.
  4. Tap Select.
  5. Unselect the selected expense.
  6. Tap "0 selected".

Expected Result:

There should not be any dropdown when no expense is selected.

Actual Result:

There is a "0 selected" dropdown when no expense is selected, which opens an empty modal when tapped.

Workaround:

unknown

Platforms:

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

Screenshots/Videos

https://github.com/user-attachments/assets/863c209c-a67b-46d7-9ed6-7910fcb4b5e9

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @abekkala
melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @techievivek (DeployBlockerCash), see https://stackoverflowteams.com/c/expensify/questions/9980/ for more details.

melvin-bot[bot] commented 1 month ago

Triggered auto assignment to @abekkala (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.

github-actions[bot] commented 1 month ago

:wave: Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:

  1. Identify the pull request that introduced this issue and revert it.
  2. Find someone who can quickly fix the issue.
  3. Fix the issue yourself.
Krishna2323 commented 1 month ago

Proposal

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

iOS - Search - Empty modal is shown when tapping on "0 selected" dropdown

What is the root cause of that problem?

Modal is set to true even if itemsLength is 0. https://github.com/Expensify/App/blob/7d58aa6694f8ef6eb298c35526a154f7e374fdd6/src/pages/Search/SearchSelectedNarrow.tsx#L50

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

Return from the function without calling openMenu(); if itemsLength is 0.

                onPress={() => {
                    if (!itemsLength) {
                        return;
                    }
                    openMenu();
                }}

What alternative solutions did you explore? (Optional)

Instead of returning empty options when selectedItemsKeys.length === 0 is true, we can add some content to display that no options is selected, it can be done the same way we do when options length is 0. https://github.com/Expensify/App/blob/7d58aa6694f8ef6eb298c35526a154f7e374fdd6/src/components/Search/SearchPageHeader.tsx#L49-L53 https://github.com/Expensify/App/blob/7d58aa6694f8ef6eb298c35526a154f7e374fdd6/src/components/Search/SearchPageHeader.tsx#L101-L117

neonbhai commented 1 month ago

Proposal

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

iOS - Search - Empty modal is shown when tapping on "0 selected" dropdown

What is the root cause of that problem?

We don't set isMobileSelectionModeActive as false when selected Items is empty on SearchListWithHeader.tsx page

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

We will set isMobileSelectionModeActive as false on this page, if the selected items are cleared with a useEffect:

useEffect(() => {
    if (isEmptyObject(selectedItems)){
        setIsMobileSelectionModeActive?.(false);
    } 
}, [selectedItems])

This would remove the checkmarks from the screen as the user would be expecting when they are trying deselect everything.

dominictb commented 1 month ago

Proposal

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

What is the root cause of that problem?

What alternative solutions did you explore? (Optional)

Result

Alternative solution 1 Alternative solution 2
image image
thienlnam commented 1 month ago

Will take this over since Vivek is offline

thienlnam commented 1 month ago

This was added from a recent PR since it's not reproducible on production right? Was someone able to find the linked PR?

allroundexperts commented 1 month ago

Thanks for the proposals everyone!

@dominictb's main proposal looks good to me. The disabling of the button is a more common pattern that we usually make use of in our app.

@dominictb Can you create the PR real quick since this is a deploy blocker?

πŸŽ€ πŸ‘€ πŸŽ€ C+ reviewed

melvin-bot[bot] commented 1 month ago

Current assignee @thienlnam is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new.

thienlnam commented 1 month ago

We're going with @dominictb's proposal, and will spin up the PR since you're offline - we'll still compensate you

dominictb commented 1 month ago

@thienlnam Thanks for creating a quick PR. I am not online at that time.

melvin-bot[bot] commented 1 month ago

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

melvin-bot[bot] commented 1 month ago

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

If no regressions arise, payment will be issued on 2024-07-24. :confetti_ball:

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

melvin-bot[bot] commented 1 month ago

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

abekkala commented 1 month ago

PAYMENT SUMMARY FOR JULY 24

melvin-bot[bot] commented 1 month ago

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

If no regressions arise, payment will be issued on 2024-07-25. :confetti_ball:

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

melvin-bot[bot] commented 1 month ago

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

abekkala commented 1 month ago

PAYMENT SUMMARY FOR JULY 24

abekkala commented 1 month ago

@dominictb payment sent and contract ended - thank you! πŸŽ‰

allroundexperts commented 1 month ago

Checklist

  1. https://github.com/Expensify/App/pull/44820
  2. https://github.com/Expensify/App/pull/44820/files#r1694343462
  3. N/A
  4. A regression test would be a nice addition.

Regression Test

Pre-req: Make sure that the user has at least one expense.

  1. Open the app, go to Search
  2. Long tap on any expense and press Select
  3. Unselect the selected expense
  4. Tap "0 selected"

Verify that there should not be any dropdown when no expense is selected

Do we πŸ‘ or πŸ‘Ž ?

JmillsExpensify commented 1 week ago

$250 approved for @allroundexperts

JmillsExpensify commented 1 week ago

Re-opening for the regression test.

abekkala commented 1 week ago

QA GH for regression test created.