Resolved issue_Category - Parent category is disabled when selected#85448
Conversation
|
@youssef-lr Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
| @@ -65,7 +65,10 @@ function getCategoryOptionTree(options: Record<string, Category> | Category[], i | |||
| const isChild = array.length - 1 === index; | |||
| const searchText = array.slice(0, index + 1).join(CONST.PARENT_CHILD_SEPARATOR); | |||
| const selectedParentOption = !isChild && Object.values(selectedOptions).find((op) => op.name === searchText); | |||
| const isParentOptionDisabled = !selectedParentOption || !selectedParentOption.enabled || selectedParentOption.pendingAction === CONST.RED_BRICK_ROAD_PENDING_ACTION.DELETE; | |||
| const optionParent = !isChild && Object.values(options).find((op) => op.name === searchText); | |||
There was a problem hiding this comment.
I'm a bit confused
We reverted the original PR
But where are the changes from the original PR?
Could you open a PR with the main changes from the reverted PR + with all regression fixes?
|
@ZhenjaHorbach #85359 is resolved, working on others. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@ijmalik |
|
Hi @ZhenjaHorbach, Thanks for checking! Here's the status of each issue: ✅ Resolved & Pushed
⏳ Waiting on Design Decision
🚫 Not Related to This PR
WIP
I've updated the PR description with links to these issues and added test cases for the resolved ones. Let me know if you need anything else! |
#85361 (comment) – Confirmed same behavior as OldDot, awaiting final product/design decision I think we can leave the same behaviour as in OD |
|
Observation: Precondition: Expected Behavior: Actual Result: Note: Only the circular radio button is selectable; clicking anywhere else on the row (including the category name) does nothing. Could you please help direct this issue to the appropriate person or PR author? It seems to have been introduced elsewhere. Thanks! cat-select-able.webm |
|
Oh |
|
Created a bug for this issue |
If you see any further potential edge cases I might have missed, Please let me know and I’ll address them promptly. The PR description has been updated with links to the issue and testing steps. Let me know if anything else is needed. Thanks |
|
Lint and jest issues |
|
@ZhenjaHorbach I'm working on resolving the lint and Jest issues – will push an update shortly. |
0254fd4 to
5b1c6e1
Compare
|
@ZhenjaHorbach The lint and Jest issues have been resolved. |
|
I will recheck today! |
|
bump @ZhenjaHorbach |
|
I will check today! |
|
Sorry for the delay @ijmalik |
|
@ZhenjaHorbach – conflicts resolved and branch updated to latest main. Ready for review. Please let me know if anything else is needed. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / Safari2026-05-04.14.17.48.mov2026-05-04.14.22.52.mov2026-05-04.14.24.14.mov2026-05-04.14.25.32.mov2026-05-04.14.28.44.mov |
|
Actually, I'm not sure about this behaviour CC: @trjExpensify 2026-05-04.14.45.23.mov |
|
Classic isn't very sophisticated in this regard.
It does run the risk of ending up in a scenario like the below if you have matching child category names: 2026-05-06_02-27-22.mp4So I think showing the parent and child like you have in your video is an improvement for context in that case. But I think the logic for what you outlined should be based solely on whether that parent is selectable or not as a result of the config. I.e
^^ in this scenario Category A would have a radio button as it's independently selectable as a category.
^^ in this scenario Category A would not have a radio button as it's not independently selectable as a category. |
@ijmalik |
Yes, it is working in the same manner. Kindly check below video link: |
|
@ZhenjaHorbach – To add more detail to my previous reply: Scenario1: Scenario2: This PR already implements the behavior trjExpensify described: Please see the video for confirmation: Demo Video Let me know if any further adjustments are needed. CC: trjExpensify |
|
I will complete reviewing today or on the weekend |
|
Okay then |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @yuwenmemon has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/yuwenmemon in version: 9.3.78-0 🚀
Bundle Size Analysis (Sentry): |
|
I reviewed the changes in this PR against all category-related help site articles under
No help site changes are required. This PR is a bug fix for internal category separator parsing and subcategory display logic (disabled states, search grouping, leaf-name display). No user-facing workflows, settings labels, navigation paths, or documented behavior changed — only internal code handling was corrected. |
|
Deploy Blocker ##91133 was identified to be related to this PR. |
|
I’ve reviewed the behavior in OldDot/Classic for a category named : and found the following:
This means that OldDot does not support selecting a colon-only category either – it simply shows a blank entry that does nothing. Our PR’s behavior (the colon category not appearing in the list) is visually different but functionally identical: the category : cannot be selected or used in an expense. The PR does not introduce a regression in terms of selectability – it was already impossible in OldDot. If the expectation is to fully support : as a selectable category, that would require changes beyond the scope of this PR (it would need frontend work to treat alone colon as a valid category name). I recommend handling that as a separate feature request. For now, the PR remains consistent with the legacy behavior (no selection possible). Please let me know if you’d still like me to adjust the PR, or if we can close this deploy blocker. Please see OldDot Demo Video |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.78-1 🚀
|


Explanation of Change
Fixed Issues
$#85359, #85364,#85357,#82068
PROPOSAL:
Tests
Test Case 1: Category - Parent category is disabled when selected#85359
Precondition:Create both categories - Car and Car: Tesla
1.Go to workspace chat.
2.Create an expense with Tesla subcategory.
3.Open the expense.
4.Click Category.
5.On the search field, type Car.
6.Car will be enabled because Car is a valid category (there are Car and Car: Tesla categories).
Test Case 2: Search keeps parent and subcategories together#85364
Precondition:
Create both categories - D and D:E:F
1.Go to staging.new.expensify.com
2.Go to workspace chat.
3.Click + > Create expense > Manual.
4.Enter amount > Next.
5.Click Category.
6.Select D.
7.Click Category.
On the search field, type D.
Verify that Parent category (D) and subcategories (E and F) will be arranged together.
Test Case 3: Category - Category appears as disabled when the category is A: B: #85357
Precondition:
Create this category - A: B:
1.Go to staging.new.expensify.com
2.Go to workspace chat.
3.Click + > Create expense > Manual.
4.Enter amount > Next.
5.Click Category.
6.Expected Result:
Verify that B: will be enabled.
Test Case 4: Category starting with a colon #85361
Precondition: Create a category named :D in the workspace.
1.Go to staging.new.expensify.com
2.Go to workspace chat.
3.Click + → Create expense → Manual.
4.Enter amount → Next.
5.Click Category.
6.Expected Result:
The category :D appears as a top‑level item with no indentation (i.e., not shown as a subcategory).
Test Case 5: Selected field shows only leaf category
Precondition: Workspace has a category Parent:Child.
1.Go to workspace chat.
2.Create an expense and select the category Parent:Child.
3.After selection, observe the field that displays the chosen category (e.g., in the expense form).
4.Expected Result:
Only the leaf name Child is displayed, not the full path Parent:Child.
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari