App icon indicating copy to clipboard operation
App copied to clipboard

[$250] Filters button should not be shown on Search page during "select mode".

Open m-natarajan opened this issue 1 year ago β€’ 8 comments

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.28-2 Reproducible in staging?: Y Reproducible in production?: Y If this was caught during regression testing, add the test name, ID and link from TestRail: Email or phone of affected tester (no customers): Logs: https://stackoverflow.com/c/expensify/questions/4856 Expensify/Expensify Issue URL: Issue reported by: @dannymcclain Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1725380044951249

Action Performed:

  1. Go to staging.new.expensify.com
  2. Click Search and select few expenses

Expected Result:

Filters button should not be shown on search during select mode

Actual Result:

Filters button are shown on search during select mode

Workaround:

Unknown

Platforms:

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

  • [ ] Android: Native
  • [ ] Android: mWeb Chrome
  • [ ] iOS: Native
  • [ ] iOS: mWeb Safari
  • [x] MacOS: Chrome / Safari
  • [ ] MacOS: Desktop

Screenshots/Videos

CleanShot 2024-09-03 at 11 13 12@2x

Snip - (32) New Expensify - Google Chrome

Add any screenshot/video evidence

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021832173197655902215
  • Upwork Job ID: 1832173197655902215
  • Last Price Increase: 2024-09-06
Issue OwnerCurrent Issue Owner: @jjcoffee

m-natarajan avatar Sep 03 '24 21:09 m-natarajan

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

melvin-bot[bot] avatar Sep 03 '24 21:09 melvin-bot[bot]

Edited by proposal-police: This proposal was edited at 2024-09-07 20:52:11 UTC.

Proposal

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

What is the root cause of that problem?

Filters button should not be shown on Search page during "select mode".

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

currently the filter button is always shown https://github.com/Expensify/App/blob/adc29abfa4bb354176966d70b0d52471a5c94a40/src/components/Search/SearchPageHeader.tsx#L314-L319

What alternative solutions did you explore? (Optional)

We should modify this to ensure the button is only shown if selectedTransactionsKeys.length==0

or Alternatively, we can use headerButtonsOptions.length == 0 unlike the condition of the selected button :

        {selectedTransactionsKeys.length === 0 && (
            <Button
                text={translate('search.filtersHeader')} 
                icon={Expensicons.Filters}
                onPress={() => Navigation.navigate(ROUTES.SEARCH_ADVANCED_FILTERS)}
                medium
            />
        )}

POC

https://github.com/user-attachments/assets/821acbc9-28a3-4612-a6cb-5fcddd3c4224

abzokhattab avatar Sep 03 '24 21:09 abzokhattab

Proposal

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

Filters button should not be shown on Search page during "select mode".

What is the root cause of that problem?

We show the selected button if headerButtonsOptions.length > 0 and always showing the filters button without any conditioning

https://github.com/Expensify/App/blob/6e500c23d601110f3ed36d7c278edd35706395af/src/components/Search/SearchPageHeader.tsx#L303-L319

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

We should update it to if-else condition, to show the selected button if headerButtonsOptions.length > 0, and else show the filters button

{headerButtonsOptions.length > 0 ? (
    <ButtonWithDropdownMenu
        onPress={() => null}
        shouldAlwaysShowDropdownMenu
        pressOnEnter
        buttonSize={CONST.DROPDOWN_BUTTON_SIZE.MEDIUM}
        customText={translate('workspace.common.selected', {selectedNumber: selectedTransactionsKeys.length})}
        options={headerButtonsOptions}
        isSplitButton={false}
    />
) : (
    <Button
        text={translate('search.filtersHeader')}
        icon={Expensicons.Filters}
        onPress={() => Navigation.navigate(ROUTES.SEARCH_ADVANCED_FILTERS)}
        medium
    />
)}

What alternative solutions did you explore? (Optional)

nyomanjyotisa avatar Sep 03 '24 23:09 nyomanjyotisa

Hi, I'm Wiktor Gut from SWM agency, please assign me this issue!

Guccio163 avatar Sep 04 '24 06:09 Guccio163

Job added to Upwork: https://www.upwork.com/jobs/~021832173197655902215

melvin-bot[bot] avatar Sep 06 '24 21:09 melvin-bot[bot]

Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee (External)

melvin-bot[bot] avatar Sep 06 '24 21:09 melvin-bot[bot]

@jjcoffee plz review the proposals above, thx

mallenexpensify avatar Sep 06 '24 21:09 mallenexpensify

Updated proposal

Added a minor clarification explaining why I used the headerButtonsOptions.length == 0 condition, but the overall solution idea remains unchanged

abzokhattab avatar Sep 07 '24 21:09 abzokhattab

Hi @luacmartins, can you please take a peek at this bug and assign it? It's a pretty small thing connected directly to Search, so I'd love to handle it quickly as part of SWM πŸ™

Guccio163 avatar Sep 09 '24 09:09 Guccio163

Sounds like @Guccio163 is going to work on this!

:ribbon::eyes::ribbon: C+ reviewed

jjcoffee avatar Sep 09 '24 12:09 jjcoffee

Triggered auto assignment to @thienlnam, see https://stackoverflow.com/c/expensify/questions/7972 for more details.

melvin-bot[bot] avatar Sep 09 '24 12:09 melvin-bot[bot]

I think the existing proposals need to be reviewed first base on this contributing guideline

nyomanjyotisa avatar Sep 09 '24 12:09 nyomanjyotisa

@nyomanjyotisa Oh sorry, I hadn't encountered that before! In that case both proposals are basically the same, so I think we're good to go with @abzokhattab's proposal since his was first.

:ribbon::eyes::ribbon: C+ reviewed

jjcoffee avatar Sep 09 '24 12:09 jjcoffee

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

melvin-bot[bot] avatar Sep 09 '24 12:09 melvin-bot[bot]

I believe the if-else condition proposed in my solution is necessary, since we want to prevent redundant/unnecessary checks and optimize performance

nyomanjyotisa avatar Sep 09 '24 13:09 nyomanjyotisa

πŸ“£ @jjcoffee πŸŽ‰ An offer has been automatically sent to your Upwork account for the Reviewer role πŸŽ‰ Thanks for contributing to the Expensify app!

Offer link Upwork job

melvin-bot[bot] avatar Sep 09 '24 18:09 melvin-bot[bot]

Sorry everyone, this is part of the Search project and @Guccio163 is working on this already.

luacmartins avatar Sep 09 '24 18:09 luacmartins

@abzokhattab and @nyomanjyotisa , once the linked PR has been on production for 7 days, without a regression, I'll review this issue for potential payment. One key point to consider here is this from CONTRIBUTING.md .

You can propose solutions on any issue at any time, but if you propose solutions to jobs before the Help Wanted label is applied, you do so at your own risk. Proposals will not be reviewed until the label is added and there is always a chance that we might not add the label or hire an external contributor for the job.

That doesn't guarantee that no one else will be eligible for compensation, I'll update everyone at the end.

mallenexpensify avatar Sep 11 '24 00:09 mallenexpensify

@luacmartins I think you closed this by mistake?

jjcoffee avatar Sep 12 '24 07:09 jjcoffee

Oh for some reason my merge commit closed the issue. Reopening.

luacmartins avatar Sep 12 '24 14:09 luacmartins

Deployed to production Sept 12 so payment should be due 2024-09-19. cc @mallenexpensify

jjcoffee avatar Sep 17 '24 10:09 jjcoffee

  • The PR that introduced the bug has been identified. Link to the PR: N/A - just a missed feature
  • 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: N/A
  • 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: B/A
  • Determine if we should create a regression test for this bug. Yes
  • 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.

Regression Test Proposal

  1. Open Search page
  2. Ensure no reports are selected
  3. Verify that the Filters button is visible and that X selected is not visible
  4. Select a few reports
  5. Verify that the Filters button is no longer visible and that the X selected button becomes visible

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

jjcoffee avatar Sep 19 '24 14:09 jjcoffee

Thanks! No need for regression tests at this time, we'll add them as part of the project wrap up

luacmartins avatar Sep 19 '24 22:09 luacmartins

Contributor: @jjcoffee paid $250 via Upwork

Thx!

mallenexpensify avatar Sep 19 '24 22:09 mallenexpensify

@mallenexpensify Any update about potential payment based on this? Since the solution in my proposal was used in the PR

nyomanjyotisa avatar Sep 20 '24 04:09 nyomanjyotisa

same, since my proposal was the selected solution. please let us know about any potential payments.

Thx!!

abzokhattab avatar Sep 20 '24 06:09 abzokhattab

@nyomanjyotisa @abzokhattab sorry, but this was within the regression period and the Search project is being handled by SWM and myself, so we won't be able to issue additional payments at this time.

luacmartins avatar Sep 20 '24 08:09 luacmartins

To provide more details...

Based on the above, compensation isn't due. @Guccio163 if you referenced the proposals and used any code from those (for all or part of the PR), please comment and provide details. Thx

mallenexpensify avatar Sep 20 '24 23:09 mallenexpensify