Skip to content

[Payment due @situchan] fix: agree on how a category tax rule's rate is displayed - #100586

Merged
JS00001 merged 10 commits into
Expensify:mainfrom
Krishna2323:krishna2323/fix/category-tax-rate-display
Sep 10, 2026
Merged

JS00001 merged 10 commits into
Expensify:mainfrom
Krishna2323:krishna2323/fix/category-tax-rate-display

Conversation

@Krishna2323

@Krishna2323 Krishna2323 commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

$ #100504
$ #100532
$ #100530
$ #100536
$ #100546
PROPOSAL:

Tests

Prereqs: Control workspace, rulesRevamp beta on, Taxes and Rules enabled, at least two tax
rates besides the default (e.g. 5% and 10%).

Selected rate stays listed once disabled (#100504)

  1. Go to Workspace settings > Rules > Add rule > Apply expense defaults > Category.
  2. Select a category and the 5% tax rate, then Save rule.
  3. Go to Workspace settings > Taxes and disable the 5% rate.
  4. Go to Rules > Expense defaults and open the rule from Step 2.
  5. Verify the Tax field still reads "5%".
  6. Click the Tax field. Verify 5% is listed and shown as selected, and that no other disabled rate appears in the list.

Selected rate stays listed once it becomes the workspace default (#100532)

  1. Create another category tax default with the 10% rate and save it.
  2. Go to Workspace settings > Taxes > Settings and set both Workspace default and Foreign default to 10%.
  3. Go to Rules > Expense defaults and verify the rule's row still reads "10%".
  4. Open the rule. Verify the Tax field reads "10%" rather than being empty.
  5. Click the Tax field. Verify 10% is listed and shown as selected.

Deleted rate reads blank, never as an ID (#100530)

  1. Create a category tax default with the 5% rate and save it.
  2. Go to Workspace settings > More features and disable Taxes.
  3. Go to Account > Troubleshoot > Clear cache and restart > Reset and refresh.
  4. Go to Workspace settings > Rules > Expense defaults.
  5. Verify the rule's row shows no tax rate and does NOT show a raw ID like id_TAX_RATE_1.
  6. Open the rule and verify the Tax field is empty, matching the row.
  7. Re-enable Taxes under More features and verify the row and the Tax field name the rate again.

Choosing a rate is unchanged (regression)

  1. Go to Rules > Add rule > Apply expense defaults > Category, pick a category, then click Tax.
  2. Verify the workspace default rate is NOT offered, and no disabled rate is offered.
  3. Select a non-default rate, save, and verify the rule appears in the table with that rate.
  4. Open a merchant rule (not a category one) and click Tax. Verify the workspace default rate IS offered there, since a merchant rule can set it.

Search

  1. In Expense defaults, search the tax rate name of a rule from Step 2 and verify the row is found.
  2. For the rule from Step 16 (rate gone), search its raw tax ID and verify nothing matches.

Category is locked when no rate a category rule can use is left (#100536)

  1. Go to Workspace settings > Taxes and note which rate is the workspace default
    (Settings > Workspace default).
  2. Delete every rate except the workspace default.
  3. Go to Rules > Add rule > Apply expense defaults.
  4. Verify the Category option shows a lock icon.
  5. Click Category. Verify a modal reads "Add a tax rate first" / "Category rules set a
    default tax rate. Add a tax rate other than your workspace default to use them.",
    and that dismissing it leaves you on Apply expense defaults.
  6. Verify the Merchant option is NOT locked and still opens the editor.
  7. Go to Taxes, add a 5% rate, then return to Rules > Add rule > Apply expense defaults.
  8. Verify Category is no longer locked and opens the rule editor.
  9. Click Tax and verify 5% is offered, confirming the lock and the picker agree.

Locked for a disabled rate too (#100536)

  1. Go to Taxes and disable the 5% rate, leaving only it and the workspace default.
  2. Go to Rules > Add rule > Apply expense defaults. Verify Category is locked again and
    shows the "Add a tax rate first" modal.
  3. Re-enable the 5% rate and verify Category unlocks.

Taxes off keeps its own explainer (regression)

  1. Go to Workspace settings > More features and disable Taxes.
  2. Go to Rules > Add rule > Apply expense defaults. Verify Category is locked and the
    modal reads "Turn on taxes first" / "Category rules set a default tax rate. Turn on
    taxes in your workspace settings to use them.", NOT the add-a-rate copy.
  3. Re-enable Taxes.

Category settings no longer sets a tax default under the revamp (#100546)

  1. Go to Workspace settings > Categories and open any category.
  2. Verify there is NO "Default tax rate" row on the page.
  3. Verify the other category rules rows are unaffected: Description hint and Approver are
    still listed and still open.
  4. Go to Rules > Expense defaults and verify a category tax default can still be created
    and edited there.
  5. Turn the rulesRevamp beta off, reopen the category from Step 40, and verify the
    "Default tax rate" row IS still there, so nothing changes for production.
  • Verify that no errors appear in the JS console

Offline tests

  1. With the 5% rate as the only non-default rate, go offline.
  2. Go to Taxes, select the 5% rate and delete it. It stays listed, greyed as pending.
  3. Go to Rules > Add rule > Apply expense defaults. Verify Category is locked and shows the "Add a tax rate first" modal, since a rate on its way out is not selectable.
  4. Go back online, let the delete land, and verify Category stays locked.

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
    • MacOS: Desktop
  • 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 verified there are no new alerts related to the canBeMissing param for useOnyx
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • 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 shown in the product is localized by adding it to src/languages/* files and using the translation method
      • If any non-english text was added/modified, I used JaimeGPT to get English > Spanish translation. I then posted it in #expensify-open-source and it was approved by an internal Expensify engineer. Link to Slack message:
    • I verified all numbers, amounts, dates and phone numbers shown in the product are using the localization methods
    • 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)
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named "index.js". All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • 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)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.ts or at the top of the file that uses the constant) are defined as such
  • I verified that if a function's arguments changed that all usages have also been updated correctly
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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 a new page is added, I verified it's using the ScrollView component to make it scrollable when more elements are added to the page.
  • 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
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari
Monosnap.screencast.2026-09-09.19-56-53.1.mp4

The table, the rule editor and the tax picker each treated a rate that
is disabled, has become the workspace default, or has left the
workspace differently, so a rule could name a rate the picker refused
to offer, or read as unset while the table showed its raw ID.

The rate a rule holds is now always shown. The picker keeps the
selected rate whatever state it is in; the editor only ignores the
workspace default on a new rule, since a saved rule's rate can become
the default later and is still what that rule applies; and the table
shares the editor's check so an unresolvable rate reads blank instead
of as an ID.

Fixes Expensify#100504
Fixes Expensify#100532
Fixes Expensify#100530

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
@codecov

codecov Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ Changes either increased or maintained existing code coverage, great job!

Files with missing lines Coverage Δ
src/libs/CategoryTaxRulesUtils.ts 67.21% <100.00%> (+61.75%) ⬆️
...ages/workspace/categories/CategorySettingsPage.tsx 0.00% <ø> (ø)
...pages/workspace/rules/MerchantRules/AddTaxPage.tsx 0.00% <0.00%> (ø)
...ace/rules/MerchantRules/ExpenseDefaultTypePage.tsx 0.00% <0.00%> (ø)
...space/rules/MerchantRules/MerchantRulePageBase.tsx 0.00% <0.00%> (ø)
... and 13 files with indirect coverage changes

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
@Krishna2323

Krishna2323 commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor Author

@JmillsExpensify Please confirm the translations, three new strings:

  • Shown when Category is locked in Apply expense defaults, which now happens whenever no rate a category rule could use is left (all disabled, or only the workspace default), since writing the workspace default is what deletes a rule.

    • addTaxRateFirstTitle: "Add a tax rate first"
    • addTaxRateFirstPrompt: "Category rules set a default tax rate. Add a tax rate other than your workspace default to use them."
  • Shown when moving a saved rule whose rate has since become the workspace default. Saving it unchanged is fine and just closes, but a move needs a write and that write would delete the rule instead.

    • confirmErrorCategoryTaxMoveIsWorkspaceDefault: "The selected tax rate is now your workspace default, so this rule can't move to another category. Choose a different tax rate."

@Krishna2323
Krishna2323 marked this pull request as ready for review September 9, 2026 14:36
@Krishna2323
Krishna2323 requested review from a team as code owners September 9, 2026 14:36
@melvin-bot
melvin-bot Bot requested review from chiragsalian and garrettmknight and removed request for a team September 9, 2026 14:36
@melvin-bot

melvin-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

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

Comment thread src/libs/CategoryTaxRulesUtils.ts Resolved
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
@melvin-bot

melvin-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

Hey, I noticed you changed src/languages/en.ts in a PR from a fork. For security reasons, translations are not generated automatically for PRs from forks.

If you want to automatically generate translations for other locales, an Expensify employee will have to:

  1. Look at the code and make sure there are no malicious changes.
  2. Run the Generate static translations GitHub workflow. If you have write access and the K2 extension, you can simply click: [this button]

Alternatively, if you are an external contributor, you can run the translation script locally with your own OpenAI API key. To learn more, try running:

npx bun ./scripts/generateTranslations.ts --help

Typically, you'd want to translate only what you changed by running npx bun ./scripts/generateTranslations.ts --compare-ref main

@situchan

situchan commented Sep 9, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible 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 checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • 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 verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • 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 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.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this 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.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
100504.mov
100530.mov
100532.mov
100536-1.mov
100536-2.mov
100546.mov

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a0776b6e68

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
@JmillsExpensify
JmillsExpensify requested review from JmillsExpensify and removed request for garrettmknight September 9, 2026 17:09
@JmillsExpensify

Copy link
Copy Markdown
Contributor

@JmillsExpensify Please confirm the translations, three new strings:

  • Shown when Category is locked in Apply expense defaults, which now happens whenever no rate a category rule could use is left (all disabled, or only the workspace default), since writing the workspace default is what deletes a rule.

    • addTaxRateFirstTitle: "Add a tax rate first"
    • addTaxRateFirstPrompt: "Category rules set a default tax rate. Add a tax rate other than your workspace default to use them."
  • Shown when moving a saved rule whose rate has since become the workspace default. Saving it unchanged is fine and just closes, but a move needs a write and that write would delete the rule instead.

    • confirmErrorCategoryTaxMoveIsWorkspaceDefault: "The selected tax rate is now your workspace default, so this rule can't move to another category. Choose a different tax rate."

Looks good overall. I'd slightly change the strings for the third one though. For instance:

"The selected tax rate is now your workspace default, so this rule is no longer valid. Choose a different tax rate."

@situchan

situchan commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Please fix conflict

…egory-tax-rate-display

Signed-off-by: krishna2323 <belivethatkg@gmail.com>

# Conflicts:
#	src/pages/workspace/categories/CategorySettingsPage.tsx
@Krishna2323

Copy link
Copy Markdown
Contributor Author

@situchan resolved

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
@Krishna2323

Copy link
Copy Markdown
Contributor Author

@JS00001 please run translations script when you get a chance. Thanks!

@situchan

situchan commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

#100530: it's expected to show Update tax to "" in the table row, right?

@situchan situchan 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

NAB comments and just waiting for translations

@melvin-bot melvin-bot Bot changed the title fix: agree on how a category tax rule's rate is displayed [Payment due @situchan] fix: agree on how a category tax rule's rate is displayed Sep 9, 2026
@melvin-bot

melvin-bot Bot commented Sep 9, 2026

Copy link
Copy Markdown

🎯 @situchan, thanks for reviewing and testing this PR! 🎉

A payment issue will be created for your review once this PR is deployed to production.
E/E issue linked to the PR - no internal issue.

If payment is not needed (e.g., regression PR review fix etc), react with 👎 to this comment to prevent the payment issue from being created.

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
@Krishna2323 Krishna2323 mentioned this pull request Sep 10, 2026
54 tasks done
@OSBotify

Copy link
Copy Markdown
Contributor

🦜 Polyglot Parrot! 🦜

Squawk! Looks like you added some shiny new English strings. Allow me to parrot them back to you in other tongues:

View the translation diff
diff --git a/src/languages/de.ts b/src/languages/de.ts
index 15f3f73d..7deeaabb 100644
--- a/src/languages/de.ts
+++ b/src/languages/de.ts
@@ -8053,6 +8053,11 @@ Fordern Sie Spesendetails wie Belege und Beschreibungen an, legen Sie Limits und
                 turnOnTaxesFirstPrompt: 'Kategorienregeln legen einen Standardsteuersatz fest. Aktivieren Sie Steuern in Ihren Workspace-Einstellungen, um sie zu verwenden.',
                 categoryRulesApplyGoingForwardTitle: 'Kategorienregeln gelten ab jetzt',
                 categoryRulesApplyGoingForwardPrompt: 'Ein Standardsatz für Steuern gilt für neue Ausgaben in dieser Kategorie. Bereits vorhandene Ausgaben werden nicht geändert.',
+                confirmErrorCategoryTaxMoveIsWorkspaceDefault:
+                    'Der ausgewählte Steuersatz ist jetzt die Voreinstellung für Ihren Workspace, daher ist diese Regel nicht mehr gültig. Wählen Sie einen anderen Steuersatz.',
+                addTaxRateFirstTitle: 'Fügen Sie zuerst einen Steuersatz hinzu',
+                addTaxRateFirstPrompt:
+                    'Kategorienregeln legen einen standardmäßigen Steuersatz fest. Fügen Sie einen anderen Steuersatz als den Standard Ihres Arbeitsbereichs hinzu, um sie zu verwenden.',
             },
             categoryRules: {
                 title: 'Kategorienregeln',
diff --git a/src/languages/el.ts b/src/languages/el.ts
index 8f3ffb09..4d085bed 100644
--- a/src/languages/el.ts
+++ b/src/languages/el.ts
@@ -8381,6 +8381,11 @@ ${reportName}`,
                 categoryRulesApplyGoingForwardTitle: 'Οι κανόνες κατηγορίας ισχύουν από εδώ και στο εξής',
                 categoryRulesApplyGoingForwardPrompt:
                     'Ένας προεπιλεγμένος φορολογικός συντελεστής εφαρμόζεται σε νέες δαπάνες σε αυτή την κατηγορία. Οι δαπάνες που υπάρχουν ήδη δεν θα αλλάξουν.',
+                confirmErrorCategoryTaxMoveIsWorkspaceDefault:
+                    'Ο επιλεγμένος φορολογικός συντελεστής είναι πλέον η προεπιλογή για τον χώρο εργασίας σας, επομένως αυτός ο κανόνας δεν είναι πλέον έγκυρος. Επιλέξτε έναν διαφορετικό φορολογικό συντελεστή.',
+                addTaxRateFirstTitle: 'Προσθέστε πρώτα έναν φορολογικό συντελεστή',
+                addTaxRateFirstPrompt:
+                    'Οι κανόνες κατηγορίας ορίζουν έναν προεπιλεγμένο φορολογικό συντελεστή. Προσθέστε έναν φορολογικό συντελεστή διαφορετικό από την προεπιλογή του χώρου εργασίας σας για να τους χρησιμοποιήσετε.',
             },
             newRule: {
                 title: 'Νέος κανόνας',
diff --git a/src/languages/es.ts b/src/languages/es.ts
index 5a7b4058..f4e56be8 100644
--- a/src/languages/es.ts
+++ b/src/languages/es.ts
@@ -8052,6 +8052,11 @@ ${reportName}`,
                     'Las reglas de categoría establecen una tasa de impuesto predeterminada. Activa los impuestos en la configuración de tu espacio de trabajo para usarlos.',
                 categoryRulesApplyGoingForwardTitle: 'Las reglas de categoría se aplican de ahora en adelante',
                 categoryRulesApplyGoingForwardPrompt: 'Se aplica una tasa de impuesto predeterminada a los nuevos gastos de esta categoría. Los gastos que ya existen no cambiarán.',
+                confirmErrorCategoryTaxMoveIsWorkspaceDefault:
+                    'El tipo impositivo seleccionado es ahora el predeterminado de tu espacio de trabajo, por lo que esta regla ya no es válida. Elige un tipo impositivo diferente.',
+                addTaxRateFirstTitle: 'Añade primero una tasa de impuesto',
+                addTaxRateFirstPrompt:
+                    'Las reglas de categoría establecen una tasa de impuestos predeterminada. Añade una tasa de impuestos distinta de la predeterminada de tu espacio de trabajo para poder usarlas.',
             },
             categoryRules: {
                 title: 'Reglas de categoría',
diff --git a/src/languages/fr.ts b/src/languages/fr.ts
index bdf279a0..d38b4b69 100644
--- a/src/languages/fr.ts
+++ b/src/languages/fr.ts
@@ -8076,6 +8076,11 @@ Rendez obligatoires des informations de dépense comme les reçus et les descrip
                 categoryRulesApplyGoingForwardTitle: 'Les règles de catégorie s’appliquent à partir de maintenant',
                 categoryRulesApplyGoingForwardPrompt:
                     'Un taux de taxe par défaut s’applique aux nouvelles dépenses de cette catégorie. Les dépenses déjà existantes ne seront pas modifiées.',
+                confirmErrorCategoryTaxMoveIsWorkspaceDefault:
+                    'Le taux de taxe sélectionné est désormais le taux par défaut de votre espace de travail, cette règle n’est donc plus valide. Choisissez un autre taux de taxe.',
+                addTaxRateFirstTitle: 'Ajoutez d’abord un taux de taxe',
+                addTaxRateFirstPrompt:
+                    'Les règles de catégorie définissent un taux de taxe par défaut. Ajoutez un taux de taxe autre que le taux par défaut de votre espace de travail pour les utiliser.',
             },
             categoryRules: {
                 title: 'Règles de catégorie',
diff --git a/src/languages/it.ts b/src/languages/it.ts
index b7a0dfeb..6affb234 100644
--- a/src/languages/it.ts
+++ b/src/languages/it.ts
@@ -8012,6 +8012,11 @@ Richiedi dettagli sulle spese come ricevute e descrizioni, imposta limiti e valo
                 turnOnTaxesFirstPrompt: 'Le regole di categoria impostano un’aliquota fiscale predefinita. Attiva le imposte nelle impostazioni dello spazio di lavoro per usarle.',
                 categoryRulesApplyGoingForwardTitle: 'Le regole di categoria si applicano da ora in poi',
                 categoryRulesApplyGoingForwardPrompt: 'Un’aliquota fiscale predefinita viene applicata alle nuove spese in questa categoria. Le spese già esistenti non verranno modificate.',
+                confirmErrorCategoryTaxMoveIsWorkspaceDefault:
+                    'L’aliquota fiscale selezionata è ora quella predefinita del tuo workspace, quindi questa regola non è più valida. Scegli un’altra aliquota fiscale.',
+                addTaxRateFirstTitle: "Aggiungi prima un'aliquota fiscale",
+                addTaxRateFirstPrompt:
+                    'Le regole di categoria impostano un’aliquota fiscale predefinita. Aggiungi un’aliquota diversa da quella predefinita dello spazio di lavoro per poterle usare.',
             },
             categoryRules: {
                 title: 'Regole di categoria',
diff --git a/src/languages/ja.ts b/src/languages/ja.ts
index f03f8b24..415243b4 100644
--- a/src/languages/ja.ts
+++ b/src/languages/ja.ts
@@ -7909,6 +7909,9 @@ ${reportName}`,
                 turnOnTaxesFirstPrompt: 'カテゴリルールでは、デフォルトの税率を設定できます。利用するには、ワークスペース設定で税金を有効にしてください。',
                 categoryRulesApplyGoingForwardTitle: 'カテゴリルールは今後に適用されます',
                 categoryRulesApplyGoingForwardPrompt: 'このカテゴリーの新しい経費には、デフォルトの税率が適用されます。既存の経費は変更されません。',
+                confirmErrorCategoryTaxMoveIsWorkspaceDefault: '選択した税率がワークスペースのデフォルトになっているため、このルールは無効になりました。別の税率を選択してください。',
+                addTaxRateFirstTitle: '先に税率を追加してください',
+                addTaxRateFirstPrompt: 'カテゴリルールではデフォルトの税率が設定されます。ワークスペースのデフォルト以外の税率を追加してから、カテゴリルールを使用してください。',
             },
             categoryRules: {
                 title: 'カテゴリルール',
diff --git a/src/languages/nl.ts b/src/languages/nl.ts
index 03f90048..6f40888a 100644
--- a/src/languages/nl.ts
+++ b/src/languages/nl.ts
@@ -7988,6 +7988,10 @@ Vereis onkostendetails zoals bonnen en beschrijvingen, stel limieten en standaar
                 turnOnTaxesFirstPrompt: 'Categorischregels stellen een standaardbelastingtarief in. Schakel belastingen in bij de instellingen van je workspace om ze te gebruiken.',
                 categoryRulesApplyGoingForwardTitle: 'Categoriegregels gelden vanaf nu',
                 categoryRulesApplyGoingForwardPrompt: 'Een standaardbelastingtarief is van toepassing op nieuwe uitgaven in deze categorie. Bestaande uitgaven veranderen niet.',
+                confirmErrorCategoryTaxMoveIsWorkspaceDefault:
+                    'Het geselecteerde belastingtarief is nu de standaard voor je werkruimte, waardoor deze regel niet meer geldig is. Kies een ander belastingtarief.',
+                addTaxRateFirstTitle: 'Voeg eerst een belastingtarief toe',
+                addTaxRateFirstPrompt: 'Categorielimieten stellen een standaardbelastingtarief in. Voeg een ander belastingtarief toe dan de standaard van je werkruimte om ze te gebruiken.',
             },
             categoryRules: {
                 title: 'Categorisatieregels',
diff --git a/src/languages/pl.ts b/src/languages/pl.ts
index 9c5b5ee5..29e3c858 100644
--- a/src/languages/pl.ts
+++ b/src/languages/pl.ts
@@ -8013,6 +8013,10 @@ Wymagaj szczegółów wydatków, takich jak paragony i opisy, ustawiaj limity i
                 turnOnTaxesFirstPrompt: 'Reguły kategorii ustawiają domyślną stawkę podatku. Włącz podatki w ustawieniach swojego workspace, aby z nich korzystać.',
                 categoryRulesApplyGoingForwardTitle: 'Reguły kategorii będą stosowane od teraz',
                 categoryRulesApplyGoingForwardPrompt: 'Domyślna stawka podatku będzie stosowana do nowych wydatków w tej kategorii. Istniejące wydatki nie zostaną zmienione.',
+                confirmErrorCategoryTaxMoveIsWorkspaceDefault:
+                    'Wybrana stawka podatku jest teraz domyślną stawką w twoim zespole, więc ta reguła nie jest już prawidłowa. Wybierz inną stawkę podatku.',
+                addTaxRateFirstTitle: 'Najpierw dodaj stawkę podatku',
+                addTaxRateFirstPrompt: 'Reguły kategorii ustawiają domyślną stawkę podatku. Dodaj stawkę podatku inną niż domyślna w twoim obszarze roboczym, żeby z nich korzystać.',
             },
             categoryRules: {
                 title: 'Reguły kategorii',
diff --git a/src/languages/pt-BR.ts b/src/languages/pt-BR.ts
index 1bae84e6..e09db721 100644
--- a/src/languages/pt-BR.ts
+++ b/src/languages/pt-BR.ts
@@ -7996,6 +7996,10 @@ Exija dados de despesas como recibos e descrições, defina limites e padrões e
                 turnOnTaxesFirstPrompt: 'As regras de categoria definem uma alíquota de imposto padrão. Ative os impostos nas configurações do seu workspace para usá-los.',
                 categoryRulesApplyGoingForwardTitle: 'As regras de categoria se aplicam daqui em diante',
                 categoryRulesApplyGoingForwardPrompt: 'Uma taxa de imposto padrão se aplica às novas despesas desta categoria. As despesas que já existem não serão alteradas.',
+                confirmErrorCategoryTaxMoveIsWorkspaceDefault:
+                    'A alíquota de imposto selecionada agora é o padrão do seu workspace, então esta regra não é mais válida. Escolha uma alíquota de imposto diferente.',
+                addTaxRateFirstTitle: 'Adicione uma alíquota de imposto primeiro',
+                addTaxRateFirstPrompt: 'As regras de categoria definem uma taxa de imposto padrão. Adicione uma taxa diferente da padrão do seu espaço de trabalho para usá-las.',
             },
             categoryRules: {
                 title: 'Regras de categoria',
diff --git a/src/languages/zh-hans.ts b/src/languages/zh-hans.ts
index 7de11143..dd5e32ac 100644
--- a/src/languages/zh-hans.ts
+++ b/src/languages/zh-hans.ts
@@ -7713,6 +7713,9 @@ ${reportName}`,
                 turnOnTaxesFirstPrompt: '类别规则会设置默认税率。请在工作区设置中启用税费以使用此功能。',
                 categoryRulesApplyGoingForwardTitle: '类别规则将从现在起生效',
                 categoryRulesApplyGoingForwardPrompt: '此类别中的新报销将应用默认税率,已存在的报销不会改变。',
+                confirmErrorCategoryTaxMoveIsWorkspaceDefault: '所选税率现在已成为您的工作区默认税率,因此此规则不再有效。请选择其他税率。',
+                addTaxRateFirstTitle: '请先添加税率',
+                addTaxRateFirstPrompt: '类别规则会设置一个默认税率。请添加一个不同于工作区默认值的税率以使用类别规则。',
             },
             categoryRules: {
                 title: '类别规则',

Note

You can apply these changes to your branch by copying the patch to your clipboard, then running pbpaste | git apply 😉

View workflow run

Comment thread src/libs/CategoryTaxRulesUtils.ts Resolved
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
…egory-tax-rate-display

Signed-off-by: krishna2323 <belivethatkg@gmail.com>
@Krishna2323
Krishna2323 requested a review from JS00001 September 10, 2026 13:50
@JS00001
JS00001 merged commit 706f299 into Expensify:main Sep 10, 2026
35 of 36 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.4.76-0 🚀

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

@MelvinBot

MelvinBot commented Sep 10, 2026 •

Copy link
Copy Markdown
Contributor

🤖 No help site changes are required for this PR, so I did not create a docs PR.

Every admin-visible change here is gated behind the rulesRevamp beta, which is not live. I verified against the running app: the Rules page has no Expense defaults tab, and Categories > [category] still shows the Default tax rate row — exactly what the help site documents today.

Workspace Rules page with no Expense defaults tab

Category page still showing Default tax rate row

Why each change is beta-only
  • CategorySettingsPage.tsx — the removed Default tax rate row was only removed from the revamp branch. The legacy branch at src/pages/workspace/categories/CategorySettingsPage.tsx:452 is guarded by !isRulesRevampEnabled and still renders it, which matches what I saw in the app.
  • ExpenseDefaultTypePage.tsx — the new lock and the "Add a tax rate first" modal live on the Apply expense defaults page, which is behind the beta at ExpenseDefaultTypePage.tsx:44.
  • CategoryTaxRulesUtils.ts / MerchantRulePageBase.tsx — the blank-instead-of-raw-ID and workspace-default handling all run behind isCategoryRuleDraft, and category rules only exist in the revamp flow.
  • New src/languages/* strings (addTaxRateFirstTitle, addTaxRateFirstPrompt, confirmErrorCategoryTaxMoveIsWorkspaceDefault) are used only by those beta-gated pages.
  • AddTaxPage.tsx is the one file reachable from the live Merchant rules flow. Its change at AddTaxPage.tsx:47 keeps the rate a rule already holds listed and marked selected even after that rate is disabled. That is a correctness fix to a picker the help site never describes, so no article asserts the old behavior.
What will need updating when rulesRevamp ships

Three articles document setting a category's tax rate under Categories, which the revamp moves to Rules > Expense defaults. They are accurate today and should be updated as part of the beta rollout, not this PR:

That rollout should also document the new constraint this PR surfaces: a category expense default needs at least one tax rate other than the Workspace currency default, otherwise the Category option is locked.


@Krishna2323, there is no linked help site PR to review, because I concluded no article is inaccurate while the change is behind the beta. Please confirm you agree with that read. If you'd rather document the revamp behavior now, reply with @MelvinBot create the docs PR anyway and I'll open the draft PR against the three articles above.


view run · no recording available

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/mountiny in version: 9.4.76-1 🚀

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

Bundle Size Analysis (Sentry):

@melvin-bot

melvin-bot Bot commented Sep 11, 2026

Copy link
Copy Markdown

🤖 Payment issue created: #100997

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.

6 participants