[Rules Revamp] Release 2: Move category-based creation into Rules; add Require fields and Flag for review#94696
Conversation
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>
|
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>
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>
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>
|
One minor issue: Repro step:
Screen.Recording.2026-07-01.at.8.03.03.PM.movSimilar issue (with the same root cause) happens on Flag for review Screen.Recording.2026-07-01.at.8.10.44.PM.mov |
There was a problem hiding this comment.
Both bugs share a root cause: on the "New" rule flow, the category picker doesn't reconcile the draft with the newly-selected category's existing rule.
-
Require fields — switching category leaks stale toggles and overwrites the new category's config.
RequireFieldsRuleCategoryPageBase.onSavebuilds{...form, category: B}and passes it throughgetEffectiveRequireFieldsRuleForm, whose precedence isdraft ?? category ?? false.
So if you pick Category A, toggle Description on, then reopen the picker and switch to Category B, A'srequireDescription: truebeats B's real value. B is then shown — and on Save persisted (setPolicyCategoryDescriptionRequired(B, true)) — with A's toggles, silently clobbering B's existing require-fields settings.
The Edit flow re-seeds from the category and locks the picker; the New flow never re-seeds. -
Flag for review — picking a category that already has a rule shows a blank amount and silently overwrites it.
FlagForReviewRuleCategoryPageBase.onSavewrites only{CATEGORY: value}— it never seedsMAX_EXPENSE_AMOUNT/EXPENSE_LIMIT_TYPEfrom the selected category, andFlagForReviewRulePageBase's New-flow init seeds an empty{}and returns early.
Existing-rule categories are still listed in the picker (per the PR's dedup requirement), so selecting one shows an empty amount field and Save overwrites the existing threshold with no indication a rule already existed.
This is asymmetric with the Require-fields picker (which does seed viagetEffectiveRequireFieldsRuleForm).
| {/* | ||
| * Rules Revamp R2: category-based rule creation moves to Workspace > Rules. | ||
| * When removing the RULES_REVAMP beta, delete this entire block (and the related useMemo | ||
| * values above) instead of keeping the legacy Category settings entry points. |
There was a problem hiding this comment.
Can we just add a link to the issue that’ll remove this block please?
|
🚧 luacmartins has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/luacmartins in version: 9.4.27-1 🚀
|
|
🤖 Reviewed this PR for Help site impact — yes, changes are needed, and I've opened a draft PR for them. What this PR changes (user-facing): It reorganizes the workspace Rules hub into tabs (General, Card restrictions, Expense defaults, Require fields, Flag for review), adds a + Rule → New rule creation flow with four options, introduces two new category-based rule types (Require fields and Flag for review), and moves category-based rule creation (Flag amounts / Require fields) out of individual category settings and into the Rules hub. Docs affected: Draft help site PR: #95297 — updates
@Krishna2323, please review the linked help site PR and confirm it reflects the current behavior. Then mark the linked help site PR |
|
Deploy Blocker #95305 was identified to be related to this PR. |
|
Deploy Blocker #95352 was identified to be related to this PR. |
|
Deploy Blocker #95353 was identified to be related to this PR. |
|
This PR failing because of the issue #95353 |
|
Deploy Blocker #95354 was identified to be related to this PR. |
|
Deploy Blocker #95357 was identified to be related to this PR. |
|
Deploy Blocker #95358 was identified to be related to this PR. |
|
🚀 Deployed to production by https://github.com/grgia in version: 9.4.27-2 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Fixed Issues
$ #92741
PROPOSAL:
Tests
Prerequisites
rulesRevampbeta on the test account.Onyx.merge('betas', ['rulesRevamp'])Rules hub — tabs & navigation
Maximum update depth exceeded/ FlashList crash (previously broken).+ Rule creation flow (4 options)
Require fields tab
Empty state
Create & table
Category is "<name>"Require description, always require receipt) — one row per categoryEdit
Create dedup (categories with existing rules)
Bulk delete
Search (if enough rows)
Flag for review tab
Empty state
Create & table
Category is "…" and amount above $X, Rule Flag for review.Create dedup
Edit & delete
Expense defaults — Merchant types
Category settings migration (
RULES_REVAMPbeta)Beta ON
Beta OFF (regression)
rulesRevampbeta → reload.Selection & bulk actions (table tabs)
Card restrictions — lock tooltip (web)
Regression (R1 still works)
Offline tests
QA Steps
Same as tests
Verify that no errors appear in the JS console
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