From d29b79398797243e36c5bd0a346132458f873e62 Mon Sep 17 00:00:00 2001 From: krishna2323 Date: Fri, 7 Aug 2026 23:27:59 +0530 Subject: [PATCH 1/4] Show the More option on every Rules tab Signed-off-by: krishna2323 --- .../ImportedMerchantRulesPage.tsx | 4 ++++ .../workspace/rules/PolicyRulesPageRevamp.tsx | 22 ++++++++----------- .../rules/getImportMerchantRulesOption.ts | 10 +++++++++ 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/pages/workspace/rules/MerchantRules/ImportedMerchantRulesPage.tsx b/src/pages/workspace/rules/MerchantRules/ImportedMerchantRulesPage.tsx index 0413700c0b37..9a28ca5606c2 100644 --- a/src/pages/workspace/rules/MerchantRules/ImportedMerchantRulesPage.tsx +++ b/src/pages/workspace/rules/MerchantRules/ImportedMerchantRulesPage.tsx @@ -13,6 +13,7 @@ import usePolicy from '@hooks/usePolicy'; import {openPolicyCategoriesPage} from '@libs/actions/Policy/Category'; import type {ImportedMerchantRule} from '@libs/actions/Policy/Rules'; import {importMerchantRulesSpreadsheet} from '@libs/actions/Policy/Rules'; +import Tab from '@libs/actions/Tab'; import {getDecodedCategoryName} from '@libs/CategoryUtils'; import {findDuplicate, generateColumnNames} from '@libs/importSpreadsheetUtils'; import Navigation from '@libs/Navigation/Navigation'; @@ -193,6 +194,9 @@ function ImportedMerchantRulesPage({route}: ImportedMerchantRulesPageProps) { const closeImportPageAndModal = () => { setIsClosing(true); setIsImportingRules(false); + // Imported merchant rules live on the Expense defaults tab, and the Rules page restores whichever tab was + // last active. Import can now be started from any tab, so point it at the tab holding the new rules. + Tab.setSelectedTab(CONST.TAB.RULES_TAB_TYPE, CONST.TAB.RULES.EXPENSE_DEFAULTS); Navigation.goBack(ROUTES.WORKSPACE_RULES.getRoute(policyID)); }; diff --git a/src/pages/workspace/rules/PolicyRulesPageRevamp.tsx b/src/pages/workspace/rules/PolicyRulesPageRevamp.tsx index 6b1029a696ad..992b69ae8e58 100644 --- a/src/pages/workspace/rules/PolicyRulesPageRevamp.tsx +++ b/src/pages/workspace/rules/PolicyRulesPageRevamp.tsx @@ -291,20 +291,16 @@ function PolicyRulesPageRevamp({route}: PolicyRulesPageRevampProps) { return null; } - if (activeTab !== RULES_TAB.EXPENSE_DEFAULTS) { - return ( -