Repository navigation
Description
Background
When a workspace admin creates or edits an expense and opens the Category picker, a gray + at the top right lets them create a new category. When they search for a category that doesn't exist, the picker only shows No results found. Nothing on the page connects that dead end to the +.
We saw this exact issue recently in a new-user onboarding session. The admin sign-up wanted to categorize an expense as Training, searched for it, got no results, and had no clear next step. At that point the admin has already told us the exact category name they want, so we can offer to create it in one tap.
Product and design details
Create expense > Category picker, Training searched, No results found with Create "Training" category row below
Basics
The row appears in any expense Category picker that already shows the gray +, so we are not introducing a new permission rule. In practice that's:
- Creating an expense.
- Editing an expense's category.
Users who don't see the + (e.g. non-admin members) see today's No results found with no row.
Trigger
We show the row only when the search returns zero results. <search> is the search string as typed, with leading and trailing spaces removed. We keep the user's capitalization. When the search matches one or more categories, even partially, we show the matches as today and no create row.
We also don't show the row when the search string can't be a category name, so the user only sees No results found, as today. That's when the string:
- Is a reserved name:
Uncategorizedor###. - Contains HTML tags, e.g.
<b>. - Is longer than 255 characters.
These match the rules on the existing new-category page, so the row never offers an option that validation would reject.
Creating the category
Tapping the row:
- Creates a new, enabled category on the expense's workspace, named with the search string.
- Selects that category on the expense.
- Closes the picker and returns the user to the page they came from (e.g.
Create expenseconfirmation), withCategoryfilled in.
We reuse the existing category-creation behavior used by the +, including how it works offline. There's no confirmation step and no intermediate create page, because the user has already typed the name.
Disabled category with the same name
The picker hides disabled categories, so a search can return zero results even though the workspace already has a disabled category with that exact name. Creating it would fail as a duplicate. In this case, tapping the row turns the existing category back on and selects it on the expense instead of creating a new one.
Loading and empty states
No new loading or empty state. The row appears with No results found and updates as the user types.
Issue Owner
Current Issue Owner: @JS00001Upwork Automation - Do Not Edit
- Upwork Job URL: https://www.upwork.com/jobs/~022117210517241577021
- Upwork Job ID: 2117210517241577021
- Last Price Increase: 2026-11-02
Metadata
Metadata
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
Krishna2323 commentedon Oct 30, 2026
@MelvinBot prepare a proposal
MelvinBot commentedon Oct 30, 2026
Proposal
Please re-state the problem that we are trying to solve in this issue.
When an admin searches the expense
Categorypicker and nothing matches, the picker shows onlyNo results found. It gives them no way to create the category they just typed.What is the root cause of that problem?
This is a new feature, not a bug.
CategoryPickerowns the search text, and on zero results it only sets a header message (getHeaderMessageForNonUserList). It has no row or callback that turns the search text into a new category. Creating a category is only possible through the separate+page (DynamicIOURequestStepCategoryCreate.tsx:138-198).What changes do you think we should make in order to solve the problem?
Add an opt-in prop to
CategoryPicker, for exampleonCreateCategory?: (name: string) => void.getCategoryNameError(policyCategories, name)returns nothing or a disabled category has the exact same name.Create "<name>" categorytranslation in every language file.No results foundstill shows above the row.onCreateCategoryinstead ofonSubmit.Pass the prop only where the
+shows today. Both places already checkcanCreateCategoryInSitu, so no new permission rule is needed:DynamicIOURequestStepCategory.tsx:103(create and edit)CategoryPickerModalwhenonAddCategoryis set (CategoryFieldDropdown.tsx:82)Every other
CategoryPickeruse stays unchanged: workspace rules, default category, search bulk edit, table cells and debug.Extract a shared hook, for example
useCreateCategoryAndApplyToTransaction, from the create page's logic. The create page and both pickers use the hook. On tap it:setWorkspaceCategoryEnabledif a disabled one with the same decoded name existscreatePolicyCategorywith the same onboarding and review-task data the create page passesNavigation.goBack(basePath)/ dismiss the modal)Both actions use
API.write, so this works offline the same way the+flow does.Tests: add unit tests for when the row shows. Cover a valid name, a reserved name, HTML, more than 255 characters, a partial match, a disabled duplicate, and a user who can't see the
+.Code references
+permission check:PolicyUtils/policy.ts:159-161(canCreateCategoryInSitu)CategoryPicker/index.tsx:101-178CategoryUtils.ts:176-203. It rejects empty, HTML, existing (enabled or disabled),###/Uncategorized, and names over 255 characters.Category.ts:782. Re-enable action:Category.ts:221useUpdateTransactionCategory.ts:62SelectionListEmptyStateinstead of the list, sofooterContentnever shows (BaseSelectionListWithSections.tsx:356-372). A list item also supports keyboard focus and Enter.searchInputThreshold). So the row can appear only on workspaces that large, which matches today's search behavior.What alternative solutions did you explore? (Optional)
listEmptyContent. It renders outside the list, so you can't reach it with the keyboard.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/105298)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
Krishna2323 commentedon Nov 1, 2026
@MelvinBot please update the proposal:
useUpdateTransactionCategoryinstead, for example with an optionalpolicyCategoriesargument onupdateCategoryso it sees the new category. The new hook should only create or re-enable the category, then callupdateCategory.updateCategoryinDynamicIOURequestStepCategory.tsx, including theCATEGORIZEbranch that goes forward to Confirmation. UsebackPath, notbasePath.en.tsonly. The other language files are generated.StringUtils.sanitizeNamefor the row text, the validity check and the created name.MelvinBot commentedon Nov 1, 2026
Proposal (updated)
Updated based on feedback from
Krishna2323.Please re-state the problem that we are trying to solve in this issue.
When an admin searches the expense
Categorypicker and nothing matches, the picker shows onlyNo results found. It gives them no way to create the category they just typed.What is the root cause of that problem?
This is a new feature, not a bug.
CategoryPickeronly sets aNo results foundheader when the search has no matches (CategoryPicker/index.tsx:163). Nothing turns the search text into a new category. Today, the only way to create one is the separate+page.What changes do you think we should make in order to solve the problem?
Extend
useUpdateTransactionCategory. Add an optional second argument:updateCategory(category, policyCategories?). When it's passed, the existing-expense branch sends it toupdateMoneyRequestCategoryinstead of the hook'spolicyCategories. Violations then see the new or re-enabled category. The split-draft and new-draft branches don't change. No other hook copies the three-way branch.Add a small hook, for example
useCreateCategoryFromSearch({policy, policyCategories, updateCategory}). It returnscreateAndApplyCategory(searchText), which:name = StringUtils.sanitizeName(searchText)setWorkspaceCategoryEnabledif a disabled one has the same decoded name. Otherwise it callscreatePolicyCategorywith the same onboarding and review-task data the create page passes.updateCategory(name, policyCategoriesWithCategory), where that map has the category marked enabledThe hook doesn't navigate.
Add an opt-in
onCreateCategory?: (name: string) => voidprop toCategoryPicker. UseStringUtils.sanitizeName(debouncedSearchValue)everywhere:Create “<name>” categorytranslation, added toen.tsonly. The other language files are generated bygenerateTranslations.yml.getCategoryNameError(policyCategories, name)returns nothing or a disabled category has the same name.onCreateCategory(name)instead ofonSubmit.The row is a one-item section, so
No results foundstill shows above it.Wire it up where the
+shows today (canCreateCategoryInSitu):DynamicIOURequestStepCategory.tsx:162-179): move the navigation at the end ofupdateCategoryinto a shared helper. Both the normal pick and the create row call it. That keeps theCATEGORIZEbranch that goes forward to Confirmation, and otherwise callsNavigation.goBack(backPath, {shouldSkipFocusRestore: true}). It usesbackPath, notbasePath.CategoryFieldDropdown.tsx:51-82): passonCreateCategorythroughCategoryPickerModalonly whencanAddCategoryis true. The modal closes after the tap, just as it does after a normal pick.Every other
CategoryPickeruse stays unchanged. The+create page also stays unchanged.Tests
Trainingcategory, searchTraining, and tap the row. Check thatTrainingis enabled again, no new category is created (noCreateWorkspaceCategorieswrite), and the expense's category isTraining. Add a second test where no category exists: one is created, enabled, and set on the expense.useUpdateTransactionCategory: an override passed toupdateCategoryreachesupdateMoneyRequestCategory. Without one, the hook'spolicyCategoriesis used.Uncategorized,###), HTML, more than 255 characters, a partial match, and a picker withoutonCreateCategory.Code references
useUpdateTransactionCategory.ts:92-129. Only the existing-expense branch takespolicyCategories(line 109).DynamicIOURequestStepCategoryCreate.tsx:157-165. It sanitizes withsanitizeNameat line 131.sanitizeName(replaces non-breaking spaces and trims):StringUtils/index.ts:25-27CategoryUtils.ts:158,CategoryUtils.ts:176-203Category.ts:221. Create action:Category.ts:782. Both useAPI.write, so they work offline like the+flow.+permission check:DynamicIOURequestStepCategory.tsx:103tests/unit/hooks/useUpdateTransactionCategory.test.tsandtests/unit/components/MoneyRequestConfirmationList/CategoryFieldDropdown.test.tsxWhat alternative solutions did you explore? (Optional)
listEmptyContent. It renders outside the list, so you can't reach it with the keyboard.Next Steps for Contributor+ team:
To accept:
@MelvinBot implement [this](https://github.com/Expensify/App/issues/105298)to create a draft PR.To refine:
@MelvinBot <your feedback>To reject: Explain why you are rejecting Melvin's proposal.
view run
Krishna2323 commentedon Nov 1, 2026
@MelvinBot implement this
24 remaining items
melvin-bot commentedon Nov 10, 2026
Triggered auto assignment to @mallenexpensify (
Awaiting Payment)melvin-bot commentedon Nov 10, 2026
Payment Summary
Resolving PRs:
Offer to create the searched-for category when a category search has no results #105575
Reviewer: @Krishna2323 owed $175 via NewDot
BugZero Checklist (@mallenexpensify)
mallenexpensify commentedon Nov 13, 2026
Claude posting on behalf of Matt:
Your call. Job price: $175 (standard, no Help Wanted, assigned 2026-10-28).
Deploy blocker #105809 came from #105575. Krishna2323 confirms it and asks for no penalty: comment. The ask is not in the increase template. Krishna2323 asked JS00001 to rule: comment. No ruling yet.
Next: confirm 50%, press Caps+Y, then pay.
Evidence
PAYPREP v1Krishna2323 commentedon Nov 13, 2026
@JS00001 please check this comment when you get a chance. Thanks!
mallenexpensify commentedon Nov 16, 2026
@JS00001 👀 above plz
Makes me think we might not want to account for the regression. Thx
JS00001 commentedon Nov 16, 2026
Yep, that sounds good to me, we can remove the regression
JmillsExpensify commentedon Nov 16, 2026
Agree.
mallenexpensify commentedon Nov 16, 2026
Payment Summary
Contributor+: @Krishna2323 due $175 via NewDot