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-09-27][$125] [Search v2.1] - Selected categories are not arranged alphabetically in Category field #48496

Closed
6 tasks done
IuliiaHerets opened this issue Sep 3, 2024 · 32 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 External Added to denote the issue can be worked on by a contributor

Comments

@IuliiaHerets
Copy link

IuliiaHerets commented Sep 3, 2024

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.28-0
Reproducible in staging?: Y
Reproducible in production?: Y
Email or phone of affected tester (no customers): applausetester+kh010901@applause.expensifail.com
Issue reported by: Applause Internal Team

Action Performed:

  1. Go to staging.new.expensify.com
  2. Go to Search.
  3. Click Filters.
  4. Click Category.
  5. Randomly select a few categories.
  6. Click Save.

Expected Result:

The selected categories will be arranged alphabetically in Category field.

Actual Result:

The selected categories are not arranged alphabetically in Category field.

Workaround:

Unknown

Platforms:

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

Screenshots/Videos

Bug6591710_1725368473798.20240903_205902.mp4

View all open jobs on GitHub

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016ce9ccc4019cea35
  • Upwork Job ID: 1831045716418683547
  • Last Price Increase: 2024-09-03
  • Automatic offers:
    • shubham1206agra | Reviewer | 103872397
    • Tony-MK | Contributor | 103872399
Issue OwnerCurrent Issue Owner: @shubham1206agra
@IuliiaHerets IuliiaHerets added Daily KSv2 Bug Something is broken. Auto assigns a BugZero manager. labels Sep 3, 2024
Copy link

melvin-bot bot commented Sep 3, 2024

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

@IuliiaHerets
Copy link
Author

We think that this bug might be related to #wave-control

@IuliiaHerets
Copy link
Author

@puneetlath FYI I haven't added the External label as I wasn't 100% sure about this issue. Please take a look and add the label if you agree it's a bug and can be handled by external contributors

@etCoderDysto
Copy link
Contributor

etCoderDysto commented Sep 3, 2024

Proposal

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

Search filters - Selected categories are not arranged alphabetically in Category field

What is the root cause of that problem?

On saving selected items, we are not sorting selected items before updating filter form with the selected items

const onSaveSelection = useCallback((values: string[]) => SearchActions.updateAdvancedFilters({category: values}), []);

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

We should sort the selected items first before updating filter form with the selected items

const onSaveSelection = useCallback((values: string[]) => SearchActions.updateAdvancedFilters({category: values.sort(localeCompare)}), [])

What alternative solutions did you explore? (Optional)

We can sort the selected items in SearchMultipleSelectionPicker, if we want to sort all fields on the filter page

onSaveSelection(
    selectedItems
           .sort((a, b) => localeCompare(a.name, b.name))
           .map((item) => item.value)
           .flat(),

const handleConfirmSelection = useCallback(() => {
onSaveSelection(selectedItems.map((item) => item.value).flat());
Navigation.goBack(ROUTES.SEARCH_ADVANCED_FILTERS);

@Tony-MK
Copy link
Contributor

Tony-MK commented Sep 3, 2024

Proposal

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

Search filters - Selected categories are not arranged alphabetically in Category field

What is the root cause of that problem?

We don't sort the filterArray in the getFilterDisplayTitle function.

if (
(fieldName === CONST.SEARCH.SYNTAX_FILTER_KEYS.CATEGORY || fieldName === CONST.SEARCH.SYNTAX_FILTER_KEYS.CURRENCY || fieldName === CONST.SEARCH.SYNTAX_FILTER_KEYS.TAG) &&
filters[fieldName]
) {
const filterArray = filters[fieldName] ?? [];
return filterArray.join(', ');

So, the text created from the categories will not be ordered

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

We should sort the categories in filterArray so the text will be sorted.

return filterArray.join(', ');

return filterArray.sort(localeCompare).join(', ');

This change will also sort the currency and tag fields.

@puneetlath puneetlath added the External Added to denote the issue can be worked on by a contributor label Sep 3, 2024
@melvin-bot melvin-bot bot changed the title Search filters - Selected categories are not arranged alphabetically in Category field [$250] Search filters - Selected categories are not arranged alphabetically in Category field Sep 3, 2024
Copy link

melvin-bot bot commented Sep 3, 2024

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

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 3, 2024
Copy link

melvin-bot bot commented Sep 3, 2024

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

@puneetlath
Copy link
Contributor

It's not really a bug, more of an improvement request. But we can go ahead and do it for $125.

@puneetlath puneetlath changed the title [$250] Search filters - Selected categories are not arranged alphabetically in Category field [$125] Search filters - Selected categories are not arranged alphabetically in Category field Sep 3, 2024
Copy link

melvin-bot bot commented Sep 3, 2024

Upwork job price has been updated to $125

@shubham1206agra
Copy link
Contributor

@puneetlath Do you also want to sort the currencies similarly?

@puneetlath
Copy link
Contributor

Yes, I'd think we'd do it for any of the multi-select fields.

@shubham1206agra
Copy link
Contributor

@Tony-MK Please update your proposal

@etCoderDysto
Copy link
Contributor

etCoderDysto commented Sep 4, 2024

@shubham1206agra can you please comment on my proposal #48496 (comment). My alternative solution covers sorting currency, and other fields. We can also repeat my main solution on currency pages and others.

@Tony-MK
Copy link
Contributor

Tony-MK commented Sep 4, 2024

Proposal

Hi @shubham1206agra, I updated my proposal.

@shubham1206agra
Copy link
Contributor

Let's go with @Tony-MK's proposal.

🎀👀🎀 C+ reviewed

Copy link

melvin-bot bot commented Sep 8, 2024

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

@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Sep 8, 2024
Copy link

melvin-bot bot commented Sep 8, 2024

📣 @shubham1206agra 🎉 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

Copy link

melvin-bot bot commented Sep 8, 2024

📣 @Tony-MK 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!

Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑‍💻
Keep in mind: Code of Conduct | Contributing 📖

@luacmartins luacmartins changed the title [$125] [Search v2.1] - Selected categories are not arranged alphabetically in Category field [HOLD for payment 2024-09-27][$125] [Search v2.1] - Selected categories are not arranged alphabetically in Category field Sep 23, 2024
@luacmartins luacmartins added Awaiting Payment Auto-added when associated PR is deployed to production and removed Reviewing Has a PR in review labels Sep 23, 2024
@melvin-bot melvin-bot bot added the Overdue label Sep 23, 2024
@luacmartins luacmartins added Daily KSv2 and removed Weekly KSv2 labels Sep 23, 2024
@melvin-bot melvin-bot bot removed the Overdue label Sep 23, 2024
@luacmartins luacmartins moved this from Polish to Done in [#whatsnext] #expense Sep 23, 2024
Copy link

melvin-bot bot commented Sep 27, 2024

@puneetlath, @Tony-MK, @shubham1206agra Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Sep 27, 2024
@shubham1206agra
Copy link
Contributor

The PR was merged

@melvin-bot melvin-bot bot added Daily KSv2 and removed Overdue Daily KSv2 labels Sep 28, 2024
Copy link

melvin-bot bot commented Oct 3, 2024

@puneetlath, @Tony-MK, @shubham1206agra Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!

@melvin-bot melvin-bot bot added the Overdue label Oct 3, 2024
@puneetlath
Copy link
Contributor

I've paid @Tony-MK. @shubham1206agra can you please complete the checklist?

@Tony-MK
Copy link
Contributor

Tony-MK commented Oct 7, 2024

Hey @puneetlath, I believe you ended the Upwork contract but have not paid me yet.

Could you check on that, please?

@puneetlath
Copy link
Contributor

Seems like a bug on Upwork's side as this has been reported multiple times now on contracts I closed yesterday. Very strange. Will report it to them.

In the meantime, I've add the payment as a bonus. Sorry about that!

@Tony-MK
Copy link
Contributor

Tony-MK commented Oct 7, 2024

Thanks

Copy link

melvin-bot bot commented Oct 7, 2024

@puneetlath, @Tony-MK, @shubham1206agra 6 days overdue. This is scarier than being forced to listen to Vogon poetry!

@puneetlath
Copy link
Contributor

@shubham1206agra just waiting on the checklist from you now so that I can pay you out.

@shubham1206agra
Copy link
Contributor

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:

@melvin-bot melvin-bot bot removed the Overdue label Oct 8, 2024
@puneetlath
Copy link
Contributor

Why no regression test @shubham1206agra?

@shubham1206agra
Copy link
Contributor

Since it was covered by other filters.

@puneetlath
Copy link
Contributor

Ok cool. All paid. Thanks y'all!

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 External Added to denote the issue can be worked on by a contributor
Projects
Archived in project
Development

No branches or pull requests

6 participants