Add offline visual feedback for spend rules#87822
Conversation
Add pendingAction to ExpensifyCardRule type and set it in optimistic data for setExpensifyCardRule and deleteExpensifyCardRule. Wrap spend rule MenuItems in OfflineWithFeedback in SpendRulesSection to show grayed-out styling when created offline and strikethrough when deleted offline. Co-authored-by: Carlos Martins <luacmartins@users.noreply.github.com>
|
The only failing check is PR Author Checklist, which flags unchecked boxes in the PR template — it's not a code failure. All code checks (ESLint, Prettier, typecheck, spellcheck, unused styles, etc.) are passing, and test/typecheck jobs are still running but no failures so far. No code fix is needed here. |
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
All checks are now passing ✅ The latest run on commit |
|
All checks are currently passing on this PR — there are no failing checks to fix. ✅ |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppCleanShot.2026-04-15.at.19.45.51.4.mp4Android: mWeb ChromeCleanShot.2026-04-15.at.19.47.03.5.mp4iOS: HybridAppCleanShot.2026-04-15.at.19.42.02.2.mp4iOS: mWeb SafariCleanShot.2026-04-15.at.19.43.33.3.mp4MacOS: Chrome / SafariCleanShot.2026-04-15.at.19.39.12.1.mp4 |
|
🚧 @JS00001 has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/JS00001 in version: 9.3.60-0 🚀
Bundle Size Analysis (Sentry): |
|
No help site changes are required for this PR. The changes add offline visual feedback (grayed-out/strikethrough styling) for spend rules — this is a UI behavior improvement, not a new feature or workflow change. The existing Workspace Rules article doesn't document offline behavior patterns and doesn't need to be updated. |
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.60-22 🚀
|
Explanation of Change
Spend rule rows in Workspace > Rules were missing offline visual feedback — they weren't grayed out when created offline and didn't show strikethrough when deleted offline. This adds the standard
OfflineWithFeedback+pendingActionpattern (matchingMerchantRulesSection) to spend rules:ExpensifyCardRuletype withOnyxValueWithOfflineFeedbackto supportpendingActionpendingActionin optimistic data forsetExpensifyCardRule(ADD/UPDATE) anddeleteExpensifyCardRule(DELETE), with success data to clear itMenuItemitems inOfflineWithFeedbackinSpendRulesSection, filtering pending-delete rules when onlineFixed Issues
$ #87802
$ #87799
PROPOSAL: #87802 (comment)
Tests
Offline tests
QA Steps
Same as tests
AI Tests
npx prettier --writeon all 3 changed files: passed (no changes needed)npx eslint --max-warnings=0on all 3 changed files: passednpm run typecheck-tsgo: passednpm test -- --silent: running (CI will validate)PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand 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
Screen.Recording.2026-04-14.at.9.26.52.AM.mov
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari