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-07-24] iOS - Search - Empty modal is shown when tapping on "0 selected" dropdown #45445

Closed
3 of 6 tasks
m-natarajan opened this issue Jul 16, 2024 · 24 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering

Comments

@m-natarajan
Copy link

m-natarajan commented Jul 16, 2024

If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] 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:

  • User has at least one expense.
  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?

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

Screenshots/Videos

Bug6543329_1721086768147.RPReplay_Final1721086632.mp4

View all open jobs on GitHub

Issue OwnerCurrent Issue Owner: @abekkala
@m-natarajan m-natarajan added DeployBlockerCash This issue or pull request should block deployment Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. DeployBlocker Indicates it should block deploying the API labels Jul 16, 2024
Copy link

melvin-bot bot commented Jul 16, 2024

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

Copy link

melvin-bot bot commented Jul 16, 2024

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 github-actions bot added Engineering Hourly KSv2 and removed Daily KSv2 labels Jul 16, 2024
Copy link
Contributor

👋 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
Copy link
Contributor

Krishna2323 commented Jul 16, 2024

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.

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.

const options: Array<DropdownOption<SearchHeaderOptionValue>> = [];
if (selectedItemsKeys.length === 0) {
return options;
}

if (options.length === 0) {
const emptyOptionStyle = {
interactive: false,
iconFill: theme.icon,
iconHeight: variables.iconSizeLarge,
iconWidth: variables.iconSizeLarge,
numberOfLinesTitle: 2,
titleStyle: {...styles.colorMuted, ...styles.fontWeightNormal},
};
options.push({
icon: Expensicons.Exclamation,
text: translate('search.bulkActions.noOptionsAvailable'),
value: undefined,
...emptyOptionStyle,
});
}

@neonbhai
Copy link
Contributor

neonbhai commented Jul 16, 2024

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
Copy link
Contributor

Proposal

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

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

What is the root cause of that problem?

  • This button is always interactive even if there are no dropdown options to display:
    <Button
    onPress={openMenu}
    ref={buttonRef}
    style={[styles.w100, styles.ph5]}
    text={translate('workspace.common.selected', {selectedNumber: itemsLength})}
    shouldShowRightIcon
    isContentCentered
    iconRight={Expensicons.DownArrow}
    />
  • When there is no selected item, so there is no dropdown options, press on it still open modal.

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

  • We should disable that button if there is no dropdown options:
    <Button
    onPress={openMenu}
    ref={buttonRef}
    style={[styles.w100, styles.ph5]}
    text={translate('workspace.common.selected', {selectedNumber: itemsLength})}
    shouldShowRightIcon
    isContentCentered
    iconRight={Expensicons.DownArrow}
    />
            <Button
                ...
                isDisabled={options.length === 0}
                shouldShowRightIcon={options.length !== 0}
            />

Result

image

What alternative solutions did you explore? (Optional)

  • We can hide the SearchSelectedNarrow if there are no dropdown options by early returning in here:
    if (options.length === 0) {
        return null;
    }

or update:

<Button
onPress={openMenu}
ref={buttonRef}
style={[styles.w100, styles.ph5]}
text={translate('workspace.common.selected', {selectedNumber: itemsLength})}
shouldShowRightIcon
isContentCentered
iconRight={Expensicons.DownArrow}
/>

to:

            <Button
                ...
                style={[styles.w100, styles.ph5, options.length === 0 && {opacity: 0}]}
                isDisabled={options.length === 0}
            />

Result

Alternative solution 1 Alternative solution 2
image image

@cead22 cead22 removed the DeployBlocker Indicates it should block deploying the API label Jul 16, 2024
@thienlnam thienlnam assigned thienlnam and unassigned techievivek Jul 16, 2024
@thienlnam
Copy link
Contributor

Will take this over since Vivek is offline

@thienlnam
Copy link
Contributor

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

@allroundexperts
Copy link
Contributor

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

Copy link

melvin-bot bot commented Jul 16, 2024

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

@melvin-bot melvin-bot bot added Reviewing Has a PR in review Weekly KSv2 and removed Hourly KSv2 labels Jul 16, 2024
@thienlnam
Copy link
Contributor

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

@dominictb
Copy link
Contributor

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

@melvin-bot melvin-bot bot added Weekly KSv2 Awaiting Payment Auto-added when associated PR is deployed to production and removed Weekly KSv2 labels Jul 17, 2024
@melvin-bot melvin-bot bot changed the title iOS - Search - Empty modal is shown when tapping on "0 selected" dropdown [HOLD for payment 2024-07-24] iOS - Search - Empty modal is shown when tapping on "0 selected" dropdown Jul 17, 2024
Copy link

melvin-bot bot commented Jul 17, 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 Jul 17, 2024
Copy link

melvin-bot bot commented Jul 17, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.7-8 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-07-24. 🎊

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

Copy link

melvin-bot bot commented Jul 17, 2024

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:

  • [@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
  • [@allroundexperts] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@allroundexperts] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@allroundexperts] Determine if we should create a regression test for this bug.
  • [@allroundexperts] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@abekkala] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@roryabraham roryabraham removed the DeployBlockerCash This issue or pull request should block deployment label Jul 17, 2024
@abekkala
Copy link
Contributor

PAYMENT SUMMARY FOR JULY 24

@melvin-bot melvin-bot bot added Weekly KSv2 and removed Weekly KSv2 labels Jul 18, 2024
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2024-07-24] iOS - Search - Empty modal is shown when tapping on "0 selected" dropdown [HOLD for payment 2024-07-25] [HOLD for payment 2024-07-24] iOS - Search - Empty modal is shown when tapping on "0 selected" dropdown Jul 18, 2024
Copy link

melvin-bot bot commented Jul 18, 2024

The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.8-6 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-07-25. 🎊

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

Copy link

melvin-bot bot commented Jul 18, 2024

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:

  • [@allroundexperts] The PR that introduced the bug has been identified. Link to the PR:
  • [@allroundexperts] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake. Link to comment:
  • [@allroundexperts] A discussion in #expensify-bugs has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner. Link to discussion:
  • [@allroundexperts] Determine if we should create a regression test for this bug.
  • [@allroundexperts] If we decide to create a regression test for the bug, please propose the regression test steps to ensure the same bug will not reach production again.
  • [@abekkala] Link the GH issue for creating/updating the regression test once above steps have been agreed upon:

@abekkala abekkala changed the title [HOLD for payment 2024-07-25] [HOLD for payment 2024-07-24] iOS - Search - Empty modal is shown when tapping on "0 selected" dropdown [HOLD for payment 2024-07-24] iOS - Search - Empty modal is shown when tapping on "0 selected" dropdown Jul 18, 2024
@abekkala
Copy link
Contributor

PAYMENT SUMMARY FOR JULY 24

@melvin-bot melvin-bot bot added Daily KSv2 and removed Weekly KSv2 labels Jul 23, 2024
@abekkala
Copy link
Contributor

@dominictb payment sent and contract ended - thank you! 🎉

@allroundexperts
Copy link
Contributor

Checklist

  1. [Search] Selection Mode for small screens #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
Copy link

$250 approved for @allroundexperts

@JmillsExpensify
Copy link

Re-opening for the regression test.

@abekkala
Copy link
Contributor

QA GH for regression test created.

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 Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering
Projects
None yet
Development

No branches or pull requests