[Rules Revamp R1] Add tabbed Rules page layout and restructure General tab#93185
[Rules Revamp R1] Add tabbed Rules page layout and restructure General tab#93185Krishna2323 wants to merge 102 commits into
Conversation
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
Hey, I noticed you changed If you want to automatically generate translations for other locales, an Expensify employee will have to:
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 ts-node ./scripts/generateTranslations.ts --helpTypically, you'd want to translate only what you changed by running |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
… subtitle color Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
…eceiptsPage Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
…d beta gate Signed-off-by: krishna2323 <belivethatkg@gmail.com>
…r default spend rule Signed-off-by: krishna2323 <belivethatkg@gmail.com>
…th layout Signed-off-by: krishna2323 <belivethatkg@gmail.com>
…tion, responsive sizing, full-width layout, and fix tab icon Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
…ault rule press Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
All issues are fixed |
|
@Expensify/design I agree with @situchan , this doesn't look right. Should/can we update it? |
|
Cant save a merchant rule: Screen.Recording.2026-06-19.at.8.17.24.AM.mov |
|
Pemitted currencies is not selectable, again, also because this needs to be merged out from the PR above |
|
IDK how, but I'm getting an infinite loop of requests: Screen.Recording.2026-06-19.at.8.26.01.AM.mov |
|
@Krishna2323 (and @Expensify/design), I talked with @shawnborton , and we decided to keep the empty state consistent with every other table:
Lets update it to match this. @Krishna2323 lets also remove the extra params from the table header that we needed to create the previous empty state |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
Did we remove the 'Company Card Required' toggle? we should probably add that rule back |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Ref: #92739 (comment) |
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
Signed-off-by: krishna2323 <belivethatkg@gmail.com>
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 16bcde2e4b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically 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 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| const headerButtons = getHeaderContent(); | ||
|
|
||
| const handleGetExpensifyCardPress = useCallback(() => { | ||
| enableExpensifyCard(policyID, true, true); |
There was a problem hiding this comment.
Gate the Expensify Card upsell by write access
In the revamp, this page is accessible with read access to Rules, but the card-rules empty state calls enableExpensifyCard for any viewer. On a workspace where Expensify Cards are disabled and the user can read rules but cannot change workspace features, pressing “Get the card” optimistically flips areExpensifyCardsEnabled and navigates before the backend rejects it. Please gate this CTA with the appropriate write access/read-only modal, as other Expensify Card promotion entry points do.
Useful? React with 👍 / 👎.
| const [receiptEnabled, setReceiptEnabled] = useState(initialReceiptEnabled); | ||
| const [itemizedEnabled, setItemizedEnabled] = useState(initialItemizedEnabled); |
There was a problem hiding this comment.
Sync receipt toggles after policy data loads
When this new RHP is opened from a cold/deep link, AccessOrNotFoundWrapper shows a loading screen after these hooks have already run with policy undefined, so receiptEnabled and itemizedEnabled stay false even after openWorkspace loads existing receipt thresholds. The UI then shows both requirements off, and pressing Save sends empty strings to setPolicyMaxExpenseAmountNoReceipt/NoItemizedReceipt, disabling the existing rules. Please initialize or resync this draft state only after the policy values are available.
Useful? React with 👍 / 👎.
| const [categoryRequired, setCategoryRequired] = useState(initialCategoryRequired); | ||
| const [tagRequired, setTagRequired] = useState(initialTagRequired); |
There was a problem hiding this comment.
Sync required-field toggles after policy data loads
These local states are initialized only once, before the wrapper has finished loading the policy on a cold/deep link. If the workspace already requires category or tag, the loaded initial*Required values update to true but categoryRequired/tagRequired remain false, so the page displays the rules as disabled and Save calls the setters to turn them off. Please resync the draft toggles when the policy loads or defer rendering the editable state until it is available.
Useful? React with 👍 / 👎.
| const initialProhibitedExpenses = useMemo(() => getProhibitedExpensesState(policy?.prohibitedExpenses), [policy?.prohibitedExpenses]); | ||
| const [draftProhibitedExpenses, setDraftProhibitedExpenses] = useState(initialProhibitedExpenses); |
There was a problem hiding this comment.
Sync prohibited expense draft after policy data loads
For the revamp flow, this draft is captured from initialProhibitedExpenses only on the first render. On a direct load the policy is still undefined while the wrapper fetches it, so the draft starts with all prohibited expenses false and never picks up the loaded policy values; Save then persists that all-false draft and clears any existing prohibited expense flags. Please update the draft when the policy values arrive or avoid creating it from the empty policy state.
Useful? React with 👍 / 👎.





Explanation of Change
Fixed Issues
$ #92739
PROPOSAL:
Tests
Same as QA Steps
Verify that no errors appear in the JS console
Offline tests
QA Steps
Prerequisites
rulesRevampbeta.Beta gate
General tab
Flag receipt line items
Require receipts
Require fields / Cash / Billable
Card restrictions & Expense defaults tabs
+ Rule flows
Regression
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
android_hybrid.mp4
Android: mWeb Chrome
android_mWeb.mp4
iOS: Native
ios_hybrid.mp4
iOS: mWeb Safari
ios_mWeb.mp4
MacOS: Chrome / Safari
web_chrome.mp4