Refactor: ConfirmModal to useConfirmModal | Batch 2#84405
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
@ZhenjaHorbach 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] |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ca52d8c10e
ℹ️ 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".
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
|
@mohammadjafarinejad |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-07-20.12.20.45.mov2026-07-20.12.22.53.mov2026-07-20.12.24.02.movAndroid: mWeb Chrome2026-07-20.12.29.15.mov2026-07-20.12.29.46.mov2026-07-20.12.30.34.moviOS: HybridApp2026-07-20.12.20.45.mov2026-07-20.12.22.53.mov2026-07-20.12.24.02.moviOS: mWeb Safari2026-07-20.12.29.15.mov2026-07-20.12.29.46.mov2026-07-20.12.30.34.movMacOS: Chrome / Safari2026-07-20.12.07.50.mov2026-07-20.12.09.47.mov2026-07-20.12.11.25.mov2026-07-20.12.14.01.mov |
@mohammadjafarinejad |
|
@mohammadjafarinejad |
|
Sorry for the delay, I'll update PRs tomorrow |
|
@ZhenjaHorbach PR is Ready for re-review. |
|
Sorry for the delay |
|
@mohammadjafarinejad |
|
@mohammadjafarinejad |
|
@mohammadjafarinejad |
@mohammadjafarinejad And about the second requirement |
|
@mohammadjafarinejad |
|
A lot of pipeline issues |
|
@ZhenjaHorbach Yes, I’m working on it. I’ll have two PRs ready for review today and will ping you. |
|
Hopefully, we can close the issue this week. I also noticed that there are still multiple places in the codebase using the |
|
@ZhenjaHorbach PR is ready for re-review. |
|
Will recheck today |
| * time as a visibility/foreground change) into a single call, instead of invoking `callback` once per trigger. | ||
| */ | ||
| function usePolling(callback: () => void | Promise<void>, interval: number, enabled = true, debounceWait?: number): void { | ||
| const callbackRef = useRef(callback); |
There was a problem hiding this comment.
Do we need this ref-shadowing? Why not just include the callback in the main useEffect dependency array?
|
🚧 roryabraham 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/roryabraham in version: 9.4.41-0 🚀
|
Help site review — no changes requiredI reviewed the changes in this PR against the help site articles under Conclusion: No help site updates are needed. This PR is a purely internal code refactor — it migrates
Since the help site documents user-facing product behavior and none of that changed here, there's nothing to update. No draft PR was created. |
|
🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.4.41-4 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Refactor
ConfirmModalusage touseConfirmModalin the following files:Fixed Issues
$ #76696
PROPOSAL:
Tests
1. Delegate "Not Allowed" modal (
DelegateNoAccessModalProvider)Setup:
Steps:
2. Location Permission modal — Web (index.tsx)
Prerequisite — Reset Chrome location permission & clear the app cache
Scenario A — Permission not yet granted (first-time prompt):
Scenario B — Permission blocked (already denied):
Scenario C — Grant permission externally while the modal is open:
onGrantis called exactly once (no duplicate navigation).3. Location Permission modal — Android (
LocationPermissionModal/index.android.tsx)Scenario A — First-time prompt:
Scenario B — Permission blocked:
Offline tests
Same as tests.
QA Steps
Same as tests.
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
Android: Native
Android_LocationPermission_Test1.mp4
Android_LocationPermission_Test2.mp4
Android: mWeb Chrome
AndroidWeb_LocationPermission_Test1.mp4
iOS: Native
_IOS_LocationPermission_Test1.mp4
iOS: mWeb Safari
IOSWeb_LocationPermission_Test1.mp4
MacOS: Chrome / Safari
WEB_.SupportalPermissionDeniedModalProvider.mp4
WEB_DelegateNoAccessModalProvider.mp4
Web_LocationPermission_Test1.mp4
Web_LocationPermission_Test2.mp4
Web_LocationPermission_Test3.mp4