Repository navigation
[Payment due @Pujan92] MenuItem: migrate agent rule cards - #105748
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@Beamanator 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] |
|
No I intentionally did it that way because I don't want this to close those issues when deployed |
|
Hmm in that case I always do |
|
@madmax330 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] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb Safari |
|
🎯 @Pujan92, thanks for reviewing and testing this PR! 🎉 A payment issue will be created for your review once this PR is deployed to production. 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. |
|
@Pujan92 @Beamanator this is ready for another review |
Beamanator
left a comment
There was a problem hiding this comment.
Looks like knip ain't happy 😬
| import Navigation from '@libs/Navigation/Navigation'; | ||
|
|
||
| import {clearPolicyAgentRuleErrors} from '@userActions/Policy/Rules'; | ||
| import {callFunctionIfActionIsAllowed} from '@userActions/Session'; |
There was a problem hiding this comment.
| import {callFunctionIfActionIsAllowed} from '@userActions/Session'; | |
| import {callIfAuthenticated} from '@userActions/Session'; |
@roryabraham merge main as now this would be callIfAuthenticated
Use callIfAuthenticated(callback, session) to match the helper API on main.
|
@puneetlath 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] |
Hmmmmmmmmm |
|
🚀 Deployed to staging by https://github.com/roryabraham in version: 9.5.37-0 🚀
|
|
No help site update needed — this PR refactors existing components without adding a feature, changing documented workflows or labels, removing a beta, or making an existing article sentence incorrect. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.5.37-1 🚀
Bundle Size Analysis (Sentry): |

Explanation of Change
Updates agent-rule cards to use the compound
MenuItemcomponents. Preserves existing behavior.Fixed Issues
For #96202
For #100312
Tests
Require a receipt for meals over USD 50.and click Create rule.Require a receipt for meals over USD 50.in the prompt field.Require a receipt for taxi expenses over USD 25., and click Create rule. Wait until this second card finishes saving.Offline tests
Require a receipt for hotel expenses over USD 100., click Create rule, and wait for saving to finish. Open the new card, confirm the hotel prompt, and go back. This rule will be deleted in this check.QA Steps
Same as tests and offline tests.
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.AI Tests
Review follow-up (
def19bb): moved mixed custom-emoji rendering intoBaseMenuItemPrimaryText, added theMenuItem.Titlestyle override, and used a regular-weight title for agent rule cards.AgentRulesSectionTest,RulesAgentsTabTest,MenuItemPrimaryTextTest,MenuItemAccessibilityTest,MenuItemFieldTest, andMenuItemCopyTest, using the repository's Node 26.12.1. Existing Field/Copy suites emitted LocaleContextProvider act warnings; Jest also reported duplicate manual mock names.npm run lint-changed,npm run typecheck,npm run react-compiler-compliance-check check-changed,npm run spell-changed, and scopedoxfmt --checkpassed. The required coding-standards review reported no violations.Browser-tested commit:
02c8ebe66fa6463e53d2fa07f9cd724181c3936b.Mechanical component-file extraction:
f7d7143f5013c8bf1ee8bb74e19a63d1c0b6ea47. The card body, props and parent logic are unchanged; Oxlint, typecheck, React Compiler, spelling and scoped formatting passed. Browser/Jest flows were not repeated for this file move.npm test -- --runInBand --runTestsByPath tests/ui/AgentRulesSectionTest.tsx tests/ui/RulesAgentsTabTest.tsx tests/ui/components/MenuItem/MenuItemAccessibilityTest.tsx— 49 tests passed.npm run lint-changed,npm run typecheck,npm run react-compiler-compliance-check check-changed,npm run spell-changed, and scopedoxfmt --checkpassed.Screenshots/Videos
Android: Native
Not tested.
Android: mWeb Chrome
Not tested on Android. Responsive Chromium captures are below.
iOS: Native
Not tested.
iOS: mWeb Safari
Not tested.
MacOS: Chrome / Safari
Chromium only; Safari not tested. Narrow captures are responsive desktop Chromium, not native/mobile certification. Normal and read-only pairs use the same five-rule dataset before final destructive checks.
Pending/error crops have identical titles and widths but distinct paired synthetic IDs: baseline suffixes 0043/0059 versus final 0067/0071. Their full client lists contained 7/6 rules before versus 5/4 after; these are subject comparisons, not identical full-list claims. The current reconciled server dataset contains only the three persistent rules.
Short after-auth recording of real Rules/Agents navigation, hover and Edit/Back without Save (tested SHA above; no authentication recorded):
final-interaction-short.webm