Skip to content

Spend - New created category is added on the bottom of the list on "Filters" page. #91686

Closed

Description

@applause-bot

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.3.82-0
Reproducible in staging?: Yes
Reproducible in production?: No
If this was caught during regression testing, add the test name, ID and link from BrowserStack: #90029
Email or phone of affected tester (no customers): ibellicotest+2250@gmail.com
Issue reported by: Applause Internal Team
Bug source: Exploratory - Significant User Experience Deterioration
Device used: Motorola MotoG60 / Android 12 (Hybrid app) - Windows 11 / Chrome
App Component: Search

Action Performed:

Prerequisite: Account has at least one workspace.

  1. Open the staging.new.expensify.com website.
  2. Navigate to "Workspaces" > Open any workspace > "Categories"
  3. Click on "Add Category" and create a new category that won´t be placed last alphabetically.
  4. Note that new category is added to list and is correctly placed.
  5. Navigate to "Spend"
  6. Click on "Filters" icon > "Category"
  7. Note that the just created category is placed last on categories list.

Expected Result:

New created category should added alphabetically to categories list on "Filters" page.

Actual Result:

New created category is displayed on the bottom of categories list on "Filters" page.

Workaround:

Unknown

Platforms:

  • Android: App
  • Android: mWeb Chrome
  • iOS: App
  • iOS: mWeb Safari
  • iOS: mWeb Chrome
  • Windows: Chrome
  • MacOS: Chrome Safari

Screenshots/Videos

Bug7163122_1779763708346.New_Category.mp4

View all open jobs on GitHub

Applause Internal Information
Exported by: Julia Ponikarchuk
Bug ID: 7163122

Activity

  1. added
    DeployBlockerCash
    Bug
    on May 26, 2026
  2. applause-bot commented on May 26, 2026

    @applause-bot
    Author

    While Applause doesn't embed attachments for this bug, here are the links for quick view:
    https://platform.applause.com/services/links/v1/external/3a29ade5fe752f6cfea125075f5585b114febec67135a0df564780ee9a1f18f3

  3. melvin-bot commented on May 26, 2026

    @melvin-bot

    You have been assigned to this deploy blocker because you recently merged this PR: #90029

  4. melvin-bot commented on May 26, 2026

    @melvin-bot

    💬 A slack conversation has been started in #expensify-open-source

  5. github-actions commented on May 26, 2026

    @github-actions
    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.
  6. MelvinBot commented on May 26, 2026

    @MelvinBot
    Contributor

    Proposal

    What is the root cause of that problem?

    PR #90029 replaced the old SearchMultipleSelectionPicker (which explicitly sorted items alphabetically via sortOptionsWithEmptyValue) with a new CategorySelector + MultiSelect component pair that never sorts the items.

    In CategorySelector.tsx:67-74, category names are collected into a Set (which preserves insertion order from Onyx — not alphabetical) and passed directly to MultiSelect without sorting. MultiSelect.tsx:68 only filters for search, it never sorts.

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

    Sort the uniqueCategoryNames array alphabetically in CategorySelector.tsx before mapping to items. Change line 68 from:

    Array.from(uniqueCategoryNames) → Array.from(uniqueCategoryNames).sort((a, b) => localeCompare(a, b))

    where localeCompare comes from the existing useLocalize() hook already imported on line 21. The "No category" item is already prepended at line 55 (before the sorted items are pushed), so it stays at the top.

    Note: TagSelector.tsx:43 has the same missing-sort bug and should be fixed the same way.

    What alternative solutions did you explore? (Optional)

    An alternative would be adding sorting logic inside MultiSelect.tsx itself, but that would force alphabetical ordering on all consumers. Sorting at the selector level is more appropriate since different selectors may have different ordering requirements.


    Next Steps for Contributor+ team: Reply with @MelvinBot implement this to create a draft PR, @MelvinBot <your feedback> to refine this analysis, or explain why you are rejecting Melvin's proposal.

  7. bernhardoj commented on May 26, 2026

    @bernhardoj
    Contributor

    This is because we don't do any sorting on the list. Do we want to sort here?

    cc: @trjExpensify

  8. JS00001 commented on May 26, 2026

    @JS00001
    Contributor

    I think we should sort these alphabetically

  9. JS00001 commented on May 26, 2026

    @JS00001
    Contributor

    Fixed by CP, popup no longer exists

  10. trjExpensify commented on May 26, 2026

    @trjExpensify
    Contributor

    I agree, but No category stay up top.

  11. removed
    DeployBlockerCash
    on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

BugEngineeringHourly

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions