Split contexts to state and actions - Batch 3#82631
Conversation
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
@mkhutornyi 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] |
| @@ -0,0 +1,40 @@ | |||
| /* eslint-disable react/jsx-no-constructed-context-values */ | |||
There was a problem hiding this comment.
❌ CONSISTENCY-5 (docs)
This eslint-disable for react/jsx-no-constructed-context-values lacks an accompanying comment explaining why the rule is being disabled.
The sibling file LockedAccountModalProvider/index.tsx correctly includes a justification comment (// This component is compiled by the React Compiler) above its identical eslint-disable. Add the same justification here:
// This component is compiled by the React Compiler
/* eslint-disable react/jsx-no-constructed-context-values */Please rate this suggestion with 👍 or 👎 to help us improve! Reactions are used to monitor reviewer efficiency.
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeiOS: HybridAppiOS: mWeb SafariMacOS: Chrome / SafariScreen.Recording.2026-02-24.at.7.29.21.am.mov |
|
Please fix conflict |
|
The conflicts are fixed! |
|
There's still prettier issue |
|
Codex Review: Didn't find any major issues. Breezy! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
Bug: I am able to add copilot on new (unverified) locked account. Not reproducible on main this branch: Screen.Recording.2026-02-24.at.7.42.32.am.movmain: (add copilot page closes automatically after verifying magic code) Screen.Recording.2026-02-24.at.7.38.20.am.mov |
| const stateValue = useMemo(() => ({isFullScreenRef, lockedWindowDimensionsRef}), []); | ||
| const actionsValue = useMemo(() => ({lockWindowDimensions, unlockWindowDimensions}), [lockWindowDimensions, unlockWindowDimensions]); |
There was a problem hiding this comment.
This component is react compilable. No need useMemo
| const stateValue = useMemo<LoginStateContextType>(() => ({login}), [login]); | ||
| const actionsValue = useMemo<LoginActionsContextType>(() => ({setLogin}), [setLogin]); |
|
Looking into the bug! |
|
Hey @mkhutornyi! The bug was a good catch, but it seems like this is something that is unrelated to the PR, because I see exactly the same behaviour on staging: Screen.Recording.2026-02-25.at.09.55.58.movI'm not sure if it's something that is intentional, but somebody probably have changed some logic and the bug has already been introduced |
oh ok, not sure why I was seeing different behavior on main. |
|
🚧 @mountiny 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/mountiny in version: 9.3.26-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.3.26-8 🚀
|
Explanation of Change
Migration of the following contexts to follow state/actions split pattern:
Fixed Issues
$ #80271
PROPOSAL: N/A
Tests
Prerequisites:
Steps:
dev.new.expensify.comor stg onstaging.new.expensify.com)Offline tests
QA Steps
Prerequisites:
Steps:
dev.new.expensify.comor stg onstaging.new.expensify.com)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: mWeb Chrome
iOS: Native
Screen.Recording.2026-02-18.at.19.21.49.mov
iOS: mWeb Safari
MacOS: Chrome / Safari
Screen.Recording.2026-02-18.at.15.39.23.mov