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
Category - Subcategory with empty parent can be created #85361
Version Number: 9.3.38-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:#83200 Email or phone of affected tester (no customers):sdijnsoijsodosj@gmail.com Issue reported by: Applause Internal Team Bug source: Exploratory - Significant User Experience Deterioration Device used: Mac 26.2 / Chrome App Component: Money Requests
Action Performed:
Precondition:
Create this category - :D
Go to staging.new.expensify.com
Go to workspace chat.
Click + > Create expense > Manual.
Enter amount > Next.
Click Category.
Expected Result:
:D will be the category.
Actual Result:
D is the category, with spacing in front, which means that it is a subcategory with empty parent.
👋 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:
Identify the pull request that introduced this issue and revert it.
Classification: Frontend bug Causing PR: #83200 - "Multi-level categories with colons are shown with hierarchical indentation" by @ijmalik (High confidence) Related Issues: #82068 (original issue that PR #83200 fixed)
Recommendation: REVERT
PR #83200 introduces a regression that breaks category names starting with colons. While the PR successfully adds hierarchical indentation for multi-level categories (e.g., Primary:Secondary:Tertiary), it causes category names like :D to be incorrectly parsed as subcategories with empty parents.
Labels: Keeping DeployBlockerCash (App deploy is blocked by a frontend bug). No label changes needed as this is correctly classified as a frontend deploy blocker.
📋 Detailed Analysis
Evidence
PR #83200 changed PARENT_CHILD_SEPARATOR from ': ' (colon with space) to ':' (just colon) to enable hierarchical display of categories. This change causes the bug:
When a category named :D is processed, the code splits it by : separator
The split produces an array: ['', 'D'] (empty string + D)
The empty string is treated as a parent category, and D as a child
The display logic adds indentation, showing D with spacing as if it's a subcategory
When PARENT_CHILD_SEPARATOR is ':' and the category name is :D, this produces ['', 'D']. The empty string at index 0 is treated as a parent category, and the iteration creates an indented display for D as if it's a child of an empty parent.
The original separator ': ' (colon with space) would not have this issue with single-colon names, but the change was necessary for proper hierarchical display of legitimate multi-level categories like Primary:Secondary:Tertiary.
Please re-state the problem that we are trying to solve in this issue.
A category named :D (an emoticon) displays as D with leading indentation, making it appear as a subcategory with an empty parent. The colon in the name is incorrectly interpreted as a hierarchy separator.
With the old separator ': ', this split would produce [":D"] (no split, because there's no ": " in :D), and the category would display correctly as a top-level item.
With the new separator ':', the split produces an empty string at index 0. The falsy guard at line 40 skips the empty segment via continue, but "D" at index 1 still inherits index=1 indentation (4 spaces) from the times(index, ...) call at line 44. The result is D — displayed as an indented subcategory with no visible parent.
What changes do you think we should make in order to solve the problem?
In getCategoryOptionTree in src/libs/CategoryOptionListUtils.ts, replace the use of the raw array index for indentation with a separate depth counter that only increments for non-empty segments. When a segment from the split is empty (falsy), it should be skipped without advancing the depth. This way :D would split to ["", "D"], skip the empty segment, and render D at depth 0 (no indentation) — correctly treating it as a top-level category.
The same logic would also handle other edge cases like ::name (double colon) or names with consecutive colons.
What alternative solutions did you explore? (Optional)
Revert PARENT_CHILD_SEPARATOR back to ': ': This would fix :D because ":D".split(": ") = [":D"], but it could re-introduce the issue from #82068 if the server ever sends category hierarchies without the space (e.g., "Food:Meat"). The depth-counter approach is more robust because it keeps the bare ':' separator while correctly handling edge cases.
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.
Activity
melvin-bot commentedon Mar 16, 2026
You have been assigned to this deploy blocker because you recently merged this PR: #83200
melvin-bot commentedon Mar 16, 2026
💬 A slack conversation has been started in #expensify-open-source
github-actions commentedon Mar 16, 2026
👋 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:
OSBotify commentedon Mar 16, 2026
🔍 Investigation Summary
Classification: Frontend bug
Causing PR: #83200 - "Multi-level categories with colons are shown with hierarchical indentation" by @ijmalik (High confidence)
Related Issues: #82068 (original issue that PR #83200 fixed)
Recommendation: REVERT
PR #83200 introduces a regression that breaks category names starting with colons. While the PR successfully adds hierarchical indentation for multi-level categories (e.g., Primary:Secondary:Tertiary), it causes category names like :D to be incorrectly parsed as subcategories with empty parents.
Labels: Keeping DeployBlockerCash (App deploy is blocked by a frontend bug). No label changes needed as this is correctly classified as a frontend deploy blocker.
📋 Detailed Analysis
Evidence
PR #83200 changed PARENT_CHILD_SEPARATOR from ': ' (colon with space) to ':' (just colon) to enable hierarchical display of categories. This change causes the bug:
Verification
Root Cause
In CategoryOptionListUtils.ts line 36, the code splits category names:
When PARENT_CHILD_SEPARATOR is ':' and the category name is :D, this produces ['', 'D']. The empty string at index 0 is treated as a parent category, and the iteration creates an indented display for D as if it's a child of an empty parent.
The original separator ': ' (colon with space) would not have this issue with single-colon names, but the change was necessary for proper hierarchical display of legitimate multi-level categories like Primary:Secondary:Tertiary.
MelvinBot commentedon Mar 16, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
A category named
:D(an emoticon) displays asDwith leading indentation, making it appear as a subcategory with an empty parent. The colon in the name is incorrectly interpreted as a hierarchy separator.What is the root cause of that problem?
PR #83200 changed
PARENT_CHILD_SEPARATORfrom': '(colon-space) to':'(bare colon) insrc/CONST/index.ts:6053.In
getCategoryOptionTree, category names are split on this separator at line 36:With the old separator
': ', this split would produce[":D"](no split, because there's no": "in:D), and the category would display correctly as a top-level item.With the new separator
':', the split produces an empty string at index 0. The falsy guard at line 40 skips the empty segment viacontinue, but"D"at index 1 still inheritsindex=1indentation (4 spaces) from thetimes(index, ...)call at line 44. The result isD— displayed as an indented subcategory with no visible parent.What changes do you think we should make in order to solve the problem?
In
getCategoryOptionTreeinsrc/libs/CategoryOptionListUtils.ts, replace the use of the raw arrayindexfor indentation with a separatedepthcounter that only increments for non-empty segments. When a segment from the split is empty (falsy), it should be skipped without advancing the depth. This way:Dwould split to["", "D"], skip the empty segment, and renderDat depth 0 (no indentation) — correctly treating it as a top-level category.The same logic would also handle other edge cases like
::name(double colon) or names with consecutive colons.What alternative solutions did you explore? (Optional)
Revert
PARENT_CHILD_SEPARATORback to': ': This would fix:Dbecause":D".split(": ")=[":D"], but it could re-introduce the issue from #82068 if the server ever sends category hierarchies without the space (e.g.,"Food:Meat"). The depth-counter approach is more robust because it keeps the bare':'separator while correctly handling edge cases.Next Steps for Contributor+ team: Reply with
@MelvinBot implement thisto create a draft PR,@MelvinBot <your feedback>to refine this analysis, or explain why you are rejecting Melvin's proposal.ZhenjaHorbach commentedon Mar 16, 2026
The same behaviour is in OD
ZhenjaHorbach commentedon Mar 16, 2026
@Expensify/design
Could you clarify this issue?
I suppose it's not a bug since we have the same behaviour in OD
CC: @ijmalik
shawnborton commentedon Mar 16, 2026
Curious what @Expensify/product thinks, but I think it's okay if we mirror what we have in OD here.
ZhenjaHorbach commentedon Mar 16, 2026
So
Let's just close this issue
Since it's the same behaviour as in OD
IuliiaHerets commentedon Mar 16, 2026
Windows 10 / Chrome
Not Repro
v9.3.38-1
bandicam.2026-03-16.14-59-29-446.mp4