You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-06-11] [$250] categories-Inconsistent category order display in list & expense page #61156
Version Number: v9.1.38-0 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail:https://expensify.testrail.io/index.php?/tests/view/6018886 Email or phone of affected tester (no customers):slottwo1+sa@gmail.com Issue reported by: Applause Internal Team Device used: Redminote note 10s android 13 App Component: Other
To make it consistent across the app, we should find other list items that uses sorting and use Array.sort as well. For example, tags are using lodashSortBy so we need to fix that
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
choose one of the below methods and apply it to the other place
Huh, interesting. I wonder which one we prefer. cc @Expensify/design - super minor but how do we want the order to look for these lists.
@daledah does this mismatch occur in other lists at all like tags? Or are there benefits to either sort that we would notice, especially with larger lists at all?
If there is no performance or genuinely engineering benefit to using one over the other, I agree with @shawnborton that we would like this to remain alphabetical, which I believe is sortNative: https://playcode.io/2363112
changed the title [-]categories-Inconsistent category order display in list & expense page[/-][+][$250] categories-Inconsistent category order display in list & expense page[/+]on Apr 30, 2025
changed the title [-][$250] categories-Inconsistent category order display in list & expense page[/-][+][Due for payment 2025-06-11] [$250] categories-Inconsistent category order display in list & expense page[/+]on Jun 4, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.58-4 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@ahmedGaber93@twisterdotcom@ahmedGaber93 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
2b. Reported on staging (eg. found during regression or PR testing)
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other: Applause Internal Team
[Contributor] 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. I can't able to reach to the offending PR as those files refactored many times.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Apr 30, 2025
Triggered auto assignment to @twisterdotcom (
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.daledah commentedon Apr 30, 2025
🚨 Edited by proposal-police: This proposal was edited at 2025-04-30 16:26:33 UTC.
Proposal
Please re-state the problem that we are trying to solve in this issue.
In categories page, it shows small "a" category, at the end of the list. Not showing in alphabetical order.
What is the root cause of that problem?
In
WorkspaceCategoriesPage, we uselodashSortBywith custom compare function and option:App/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Line 142 in 4453806
App/src/libs/LocaleCompare.ts
Lines 24 to 26 in 4453806
App/src/libs/LocaleCompare.ts
Line 5 in 4453806
While in
CategoryPicker, we usesortCategorieswith nativeArray.sortandString.prototype.localeCompareApp/src/libs/CategoryOptionListUtils.ts
Line 97 in 4453806
App/src/libs/CategoryOptionListUtils.ts
Line 221 in 4453806
There's a different between native
Array.sortand LodashsortBymethod, see this example.These differences in sort method and compare function lead to inconsistent in category order between pages
What changes do you think we should make in order to solve the problem?
From this comment, we want to use native
Array.sortmethod, so we should apply this method to WS Categories pageApp/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Line 142 in 4453806
Implement same as here
App/src/libs/CategoryOptionListUtils.ts
Line 221 in 760ae21
To increase performance, we can combine the two methods to use
Array.sortwithlocaleCompareApp/src/pages/workspace/categories/WorkspaceCategoriesPage.tsx
Line 142 in 4453806
To make it consistent across the app, we should find other list items that uses sorting and use
Array.sortas well. For example, tags are usinglodashSortByso we need to fix thatApp/src/libs/TagsOptionsListUtils.ts
Lines 164 to 167 in 760ae21
App/src/pages/workspace/tags/WorkspaceTagsPage.tsx
Line 190 in 760ae21
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
NA
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
twisterdotcom commentedon Apr 30, 2025
Huh, interesting. I wonder which one we prefer. cc @Expensify/design - super minor but how do we want the order to look for these lists.
@daledah does this mismatch occur in other lists at all like tags? Or are there benefits to either sort that we would notice, especially with larger lists at all?
daledah commentedon Apr 30, 2025
@twisterdotcom For tags, both places use
lodashSortByApp/src/libs/TagsOptionsListUtils.ts
Lines 164 to 167 in 760ae21
App/src/pages/workspace/tags/WorkspaceTagsPage.tsx
Line 190 in 760ae21
shawnborton commentedon Apr 30, 2025
Hmm I think I would expect to see something like A, a, B, b as the correct order there... what are you thinking?
twisterdotcom commentedon Apr 30, 2025
If there is no performance or genuinely engineering benefit to using one over the other, I agree with @shawnborton that we would like this to remain alphabetical, which I believe is
sortNative: https://playcode.io/2363112[-]categories-Inconsistent category order display in list & expense page[/-][+][$250] categories-Inconsistent category order display in list & expense page[/+]melvin-bot commentedon Apr 30, 2025
Job added to Upwork: https://www.upwork.com/jobs/~021917611980787285967
melvin-bot commentedon Apr 30, 2025
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ahmedGaber93 (
External)29 remaining items
[-][$250] categories-Inconsistent category order display in list & expense page[/-][+][Due for payment 2025-06-11] [$250] categories-Inconsistent category order display in list & expense page[/+]melvin-bot commentedon Jun 4, 2025
Reviewinglabel has been removed, please complete the "BugZero Checklist".melvin-bot commentedon Jun 4, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.58-4 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 2025-06-11. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jun 4, 2025
@ahmedGaber93 @twisterdotcom @ahmedGaber93 The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
ahmedGaber93 commentedon Jun 11, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] 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. I can't able to reach to the offending PR as those files refactored many times.
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source 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: N/A
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue: https://github.com/Expensify/Expensify/issues/510678
Regression Test Proposal
Test:
Do we agree 👍 or 👎
twisterdotcom commentedon Jun 12, 2025
Payment Summary:
JmillsExpensify commentedon Jul 11, 2025
$250 approved for @ahmedGaber93