Skip to content

Move Categories & Tags settings into the header More menu - #100293

Merged
JS00001 merged 38 commits into
Expensify:mainfrom
marufsharifi:categories-tags-header-menu
Oct 19, 2026
Merged

JS00001 merged 38 commits into
Expensify:mainfrom
marufsharifi:categories-tags-header-menu

Conversation

@marufsharifi

@marufsharifi marufsharifi commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

Moves the per-page settings on the workspace Categories and Tags editors from the Settings RHP into the header More menu, and removes the now-unused Settings pages.

  • Categories More menu: Auto-categorize new expenses toggle, Show GL codes when categorizing expenses toggle, divider, Import spreadsheet, Download CSV.
  • Tags More menu: Custom tag name (opens the existing RHP), Show GL codes when selecting a tag toggle, divider, Import spreadsheet, Download CSV.
  • Deletes the Categories/Tags Settings RHP pages and their routes (plus the now-orphaned SPEND_CATEGORY_SELECTOR); old deep links redirect to the Categories/Tags list page.

Fixed Issues

$ #99886
PROPOSAL:

Tests

Categories

  1. Go to Workspace → Categories → More. The menu should display:

    • Show GL codes when categorizing expenses — toggle
    • Divider
    • Import spreadsheet
    • Download CSV

    There should be no Settings option.

  2. Turn on or off Show GL codes when categorizing expenses.

    • The change is saved immediately.
    • The More menu remains open after toggling.

Tags

  1. Go to Workspace → Tags → More. The menu should display:

    • Custom tag name — current value with a chevron
    • Show GL codes when selecting a tag — toggle
    • Divider
    • Import spreadsheet
    • Download CSV

    There should be no Settings option.

  2. Tap Custom tag name.

    • The More menu closes.
    • The existing right-hand panel (RHP) opens.
    • Enter and save a new name.
    • After saving, return to Tags.
    • The Custom tag name row displays the newly saved value.
  3. Turn on or off Show GL codes when selecting a tag.

    • The change is saved immediately.
    • The More menu remains open after toggling.
  • Verify that no errors appear in the JS console

Offline tests

Same as Tests

QA Steps

Same as Tests

  • Verify that no errors appear in the JS console

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • If the PR adds or modifies the UI:
    • I asked an AI agent to review the changes for accessibility issues and addressed its findings.
    • I tested with a screen reader (VoiceOver on macOS) and verified all new/changed elements are reachable with a logical focus order.
    • I verified all new/changed elements have meaningful accessible names and roles.
    • I verified state changes are announced (e.g. checked/unchecked, expanded/collapsed, selected).
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native

Categories

Screen.Recording.2026-09-04.at.6.46.40.PM.mov

Tags

Screen.Recording.2026-09-04.at.6.47.05.PM.mov
Android: mWeb Chrome

Categories

Recording_20260904_184053.mp4

Tags

Recording_20260904_184137.mp4
iOS: Native

Categories

Screen.Recording.2026-09-04.at.6.55.52.PM.mov

Tags

Screen.Recording.2026-09-04.at.6.56.16.PM.mov
iOS: mWeb Safari

Categories

Screen.Recording.2026-09-04.at.6.57.17.PM.mov

Tags

Screen.Recording.2026-09-04.at.6.58.35.PM.mov
MacOS: Chrome / Safari

Categories

REC-20261001151941.mp4

Tags

REC-20261001152142.mp4

@codecov

codecov Bot commented Sep 3, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.

Files with missing lines Coverage Δ
src/ROUTES.ts 32.20% <ø> (+0.02%) ⬆️
src/SCREENS.ts 100.00% <ø> (ø)
src/components/MenuItem/MenuItem.tsx 91.88% <100.00%> (ø)
src/components/Switch.tsx 92.10% <100.00%> (ø)
...gation/AppNavigator/ModalStackNavigators/index.tsx 7.56% <ø> (+0.03%) ⬆️
src/libs/Navigation/linkingConfig/OldRoutes.ts 100.00% <ø> (ø)
...gation/linkingConfig/RELATIONS/WORKSPACE_TO_RHP.ts 100.00% <ø> (ø)
src/libs/Navigation/linkingConfig/config.ts 62.50% <ø> (ø)
src/pages/workspace/withPolicy.tsx 100.00% <ø> (ø)
src/components/ButtonWithDropdownMenu/index.tsx 83.94% <66.66%> (-0.27%) ⬇️
... and 3 more
... and 38 files with indirect coverage changes

@melvin-bot
melvin-bot Bot requested review from huult and removed request for a team September 4, 2026 14:39
@melvin-bot

melvin-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

@huult 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]

@melvin-bot
melvin-bot Bot requested review from heyjennahay and removed request for a team September 4, 2026 14:39
menuItems.push({
text: translate('workspace.categories.showCategoryGLCodes'),
value: CONST.POLICY.SECONDARY_ACTIONS.SETTINGS,
// The row itself is inert; only the Switch handles the toggle so the menu stays open.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

❌ CONSISTENCY-16 (docs)

This comment joins two independent clauses with a semicolon. Comments should read as plain sentences, using two separate sentences instead of a semicolon.

Split it into two sentences:

// The row itself is inert. Only the Switch handles the toggle so the menu stays open.

Reviewed at: 4927c16 | Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.

@huult

huult commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

@marufsharifi Could you check the comments above?

@marufsharifi

Copy link
Copy Markdown
Contributor Author

@huult The feedbacks have been resolved, thanks

containerStyles={containerStyles}
menuItems={options.map((item, index) => ({
...item,
// Build the Switch here from typed data so callers pass `switchProps` instead of threading JSX through the option config.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marufsharifi Do we need a comment here? I think the code is clear enough to understand without it, so we can remove it.

Comment thread src/components/PopoverMenu/index.tsx Outdated
onFocus={() => {
if (!shouldUpdateFocusedIndex) {
// Inert rows (e.g. an inline toggle row whose only control is a Switch) shouldn't become the
// focused/highlighted item. Otherwise focus bubbling from the inner control leaves the row highlighted.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marufsharifi Do we need a comment here? I think the code is clear enough to understand without it, so we can remove it.

// Under the revamp the other settings moved to Rules, so this is only worth showing for the GL codes toggle.
if (canWriteCategories && (!isRulesRevampEnabled || !!policy?.glCodes)) {
// Under the revamp the Settings page is gone, so its remaining GL codes toggle is surfaced directly in this
// menu instead of behind a dedicated Settings page.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marufsharifi Do we need a comment here? I think the code is clear enough to understand without it, so we can remove it.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@huult This comment already existed on main — I only updated its wording for the new placement. I'd keep it for context, but can remove if you prefer. thanks

const menuItems = [];
if (shouldShowTagsSettings) {
// Under the revamp the Settings page is gone, so its remaining rows (custom tag name and the GL codes toggle)
// are surfaced directly in this menu using the same visibility rules the Settings page used.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@marufsharifi Do we need a comment here? I think the code is clear enough to understand without it, so we can remove it.

@huult

huult commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Auto-categorize new expenses is a brand new toggle that just hit. We'll get the mock updated, as it's now in scope.

Screenshot 2026-09-06 at 16 00 59

BUG: The "Auto-categorize new expenses" toggle is completely missing from Categories.

@huult

huult commented Sep 6, 2026

Copy link
Copy Markdown
Contributor

Removing the Settings page

@marufsharifi I didn't see you remove anything. Is this missing, or has it still not been removed?

@huult

huult commented Sep 6, 2026 •

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-09-06.at.16.04.44.mov
Screen.Recording.2026-09-06.at.16.06.07.mov

BUG: The error message is not displayed, and the toggle silently reverts when simulating a network failure. (tags and categories)

@huult

huult commented Sep 6, 2026

Copy link
Copy Markdown
Contributor
Screenshot 2026-09-06 at 16 14 30 Screenshot 2026-09-06 at 16 15 00

Bug: the switch sits pinned to the top of the row instead of centered against the wrapped text.

@huult

huult commented Sep 6, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-09-06.at.16.16.16.mov

BUG: When I press Enter on the toggle and it redirects to edit the tag name, the toggle value should still switch.

@huult

huult commented Sep 6, 2026

Copy link
Copy Markdown
Contributor
Screen.Recording.2026-09-06.at.16.18.50.mov

BUG: When I press Enter on a toggle without any action

@marufsharifi

Copy link
Copy Markdown
Contributor Author

Auto-categorize new expenses is a brand new toggle that just hit. We'll get the mock updated, as it's now in scope.

@huult
The Auto-categorize new expenses setting (from #98030) was reverted in #100217, so autoCategorizeNewExpenses / setPolicyAutoCategorizeNewExpenses don't exist on main

@dannymcclain

dannymcclain commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

@dubielzyk-expensify Good point about the link!

Agree - great shout. I imagine we just wouldn't link that in the situation I posted above (and it would all be plain text).

@dannymcclain For the tooltip text, our toggle is disabled because of a dependency (Categories turned off, or no enabled categories), not a plan lock. Could you please suggest the wording you'd like to use here?

Would love to get @trjExpensify or @JmillsExpensify 's take here because I'm not really sure how we should communicate this. "To enable/disable, edit your category settings"? 🤷

Copy link
Copy Markdown
Contributor

A user wouldn't be able to see this toggle if categories are turned off right?

Copy link
Copy Markdown
Contributor

So I think it's only the case when a user has deleted all their categories.

@trjExpensify

Copy link
Copy Markdown
Contributor

Yeah, which we don't allow you to when categories are required.

image

@marufsharifi

Copy link
Copy Markdown
Contributor Author

Thanks for digging into this! Your understanding is correct, I checked the code, and this toggle is only disabled in one narrow case: when categories are not required and the user has deleted or disabled all their categories. If categories are required, we don’t allow removing the last one, and if the Categories feature is turned off, the page (and this toggle) isn’t visible at all.

So it’s a pretty rare edge case. I’m happy to add the tooltip once you land on the final wording — or if you feel it’s not worth it for such a rare case, that works too.

cc @trjExpensify @JmillsExpensify — could you please let me know what you’d prefer here? Thanks

@trjExpensify

Copy link
Copy Markdown
Contributor

Your understanding is correct, I checked the code, and this toggle is only disabled in one narrow case: when categories are not required and the user has deleted or disabled all their categories.

Sorry, I'm still not following you. Why in the case you outlined above would "Auto categorize new expenses" be enabled and locked on?

Also, where has the separate setting to require categories gone? 😕

image

@marufsharifi

Copy link
Copy Markdown
Contributor Author

@trjExpensify Thanks for the questions, let me clarify both!

On the "require categories" setting: It hasn't gone anywhere — it was never part of the Categories settings. The "Members must categorize all expenses" toggle lives under Workspace → Rules (requiresCategory), and this PR doesn't touch it. The old Categories Settings page we moved only ever had two rows: "Auto-categorize new expenses" and "Show GL codes when categorizing expenses."

On the "on + locked" state: This behavior isn't something this PR introduced. I copied the exact same logic from the old Settings page:

  • isActive = policy.autoCategorizeNewExpenses ?? true → defaults to ON
  • disabled = !areCategoriesEnabled || !hasEnabledCategories

So the old page showed the same "ON + locked" state when all categories were deleted. This PR only moves these rows into the header More menu — the on/disabled logic is unchanged.

So the "why is it ON while locked?" question is really about the existing behavior, not this change. Given that, would you prefer we keep this PR focused on just moving the settings, and handle the tooltip (and any rethink of the on+locked logic) in a separate follow-up? Happy to go either way. Thanks

@trjExpensify

Copy link
Copy Markdown
Contributor

On the "require categories" setting: It hasn't gone anywhere — it was never part of the Categories settings. The "Members must categorize all expenses" toggle lives under Workspace → Rules (requiresCategory), and this PR doesn't touch it.

Oh, it must have been moved with the rulesRevamp. Got it.

Okay, so focusing on this "Auto-categorise new expenses" setting:

So the old page showed the same "ON + locked" state when all categories were deleted.

The steps to reproduce this bug are:

  1. Create a workspace
  2. Enable Rules
  3. Disable "Require categories"
  4. Go to Categories
  5. Delete all of the categories
  6. Open the Settings
  7. Observe the "Auto-categorise new expenses" toggle is enabled and locked. 🐛

Basically the conditions are:

  1. Categories not required
  2. Has disabled or deleted all categories

I don't think there's a case where the toggle should ever be enabled and locked. We can fix it in a separate PR to be locked and disabled under those conditions, that's fine, including adding a tooltip: "Please enable at least one category."

@marufsharifi

marufsharifi commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor Author

We can fix it in a separate PR to be locked and disabled under those conditions, that's fine, including adding a tooltip: "Please enable at least one category."

@trjExpensify Thanks for the confirmation! we'll keep this PR focused on moving the settings into the More menu, and handle the "ON + locked" state along with the tooltip ("Please enable at least one category.") in a separate issue and PR.

@marufsharifi

Copy link
Copy Markdown
Contributor Author

@huult While testing, I found a keyboard-focus issue on the toggle rows and I'd like your confirmation before fixing it, because the fix has a trade-off.

What I found

On a toggle row in the More menu, if you click the row text (not the switch) and then use the keyboard:

  • Enter does nothing.
  • Arrow Down jumps back to the first row instead of moving to the next row.

Root cause

When you select a "stay-open" item (like our inline toggles), selectItem in PopoverMenu resets the focused index to -1. So after a mouse click there is no focused row, which is why Enter and Arrow Down don't continue from the clicked toggle.

Possible fix + trade-off

I can make the toggle keep focus after a click so Enter/Arrow work. But then the focus highlight stays visible on the row after a mouse click on Safari . This is actually what the existing code intentionally avoids — there's a past fix ("immediately defocus on safari too") that clears focus after selecting a stay-open item so the highlight doesn't linger on mouse interaction. I tested keeping focus and confirmed the highlight remains after clicking.

So the two behaviors conflict:

  • Keep focus after click → Enter and Arrow Down work from the toggle, but the highlight lingers after a mouse click.
  • Clear focus after click (current) → no lingering highlight, but Enter/Arrow Down don't continue from the clicked toggle.

Could you confirm whether this is worth fixing, and which behavior you'd prefer? Another option is to keep focus only for keyboard interactions and let mouse clicks clear focus as they do now. I'll follow your guidance. Thanks!

Screencast.From.2026-10-14.19-55-44.webm

@huult

huult commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

@marufsharifi I think we should create a separate issue to track this, since it's existing behavior in PopoverMenu that affects all stay-open items, not just these toggle rows.

@huult huult left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@melvin-bot

melvin-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown

We did not find an internal engineer to review this PR, trying to assign a random engineer to #99886 as well as to this PR... Please reach out for help on Slack if no one gets assigned!

@melvin-bot
melvin-bot Bot requested a review from JS00001 October 15, 2026 03:28
Comment thread src/components/Switch.tsx Resolved
@huult

huult commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

@marufsharifi could you take a look at the comment above?

@JS00001
JS00001 merged commit c18c6f3 into Expensify:main Oct 19, 2026
38 of 43 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 JS00001 has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/JS00001 in version: 9.5.14-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

Help site update needed. I opened a draft PR: Docs updates for E/A#100293 Remove Settings step from Categories and Tags articles

This PR removed Settings from the More menu on the Categories and Tags pages. Four article sentences still told admins to select Settings:

Each edit removes the Settings step so the toggle is enabled straight from More. The labels match en.ts and the merged code. Nothing here is beta-gated.

@marufsharifi, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR Ready for review


view run

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/grgia in version: 9.5.14-3 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants