Refactor subscription size page to use useSubPage hook#82340
Conversation
|
@dukenv0307 and @arosiclair will review this |
| } | ||
| if (privateSubscription?.type === CONST.SUBSCRIPTION.TYPE.ANNUAL && option === CONST.SUBSCRIPTION.TYPE.PAY_PER_USE && !account?.canDowngrade) { | ||
| Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_SIZE.getRoute(0)); | ||
| Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION_DOWNGRADE_BLOCKED.route); |
There was a problem hiding this comment.
The canChangeSize param is used to show the downgrade blocked view when trying to downgrade from an annual to a pay-per-use plan, so instead of conditionally rendering it based on the params that can be easily changed by the user, I navigate to the already existing downgrade blocked page.
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.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 7eff636d2e
ℹ️ 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".
| import ONYXKEYS from '@src/ONYXKEYS'; | ||
| import INPUT_IDS from '@src/types/form/SubscriptionSizeForm'; | ||
|
|
||
| type ConfirmationProps = SubStepProps; | ||
|
|
||
| function Confirmation({onNext, isEditing}: ConfirmationProps) { | ||
| function Confirmation({onNext}: ConfirmationProps) { |
There was a problem hiding this comment.
Reinstate downgrade guard on subscription size confirmation
Removing isEditing here also removed the account.canDowngrade check that previously blocked annual-plan seat decreases. In the current flow, users with canDowngrade === false can go through Subscription Size, enter a smaller member count, and still reach Save, which sends an updateSubscriptionSize request instead of showing the downgrade-blocked state. That is a behavior regression for restricted downgrade scenarios.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
We have checks in the UpdateSubscriptionSize command so this shouldn't be an issue even if a user links directly to this page.
|
@bernhardoj typescript checks are failing |
|
@lakchote fixed |
arosiclair
left a comment
There was a problem hiding this comment.
LGTM so far. Waiting for review from @dukenv0307
lakchote
left a comment
There was a problem hiding this comment.
LGTM, @dukenv0307 please review it
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeScreen.Recording.2026-02-18.at.21.00.08.moviOS: HybridAppiOS: mWeb SafariScreen.Recording.2026-02-18.at.20.59.03.movMacOS: Chrome / SafariScreen.Recording.2026-02-18.at.20.56.44.mov |
|
🎯 @dukenv0307, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #82806. |
|
All yours @lakchote |
|
@bernhardoj there's conflicts now @dukenv0307 there's flashing when you navigate in your Android mWeb video. Is that actually visible for you or is that a glitch in the video? |
@arosiclair, it is my simulator issue. I've tried to fix it but couldn't. I can confirm that this bug doesn't occur on other devices. |
|
Thanks, I tested on a physical Android device and it looks good 👍 |
|
@arosiclair done |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚧 @arosiclair 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! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/arosiclair in version: 9.3.23-2 🚀
|
|
🚀 Deployed to production by https://github.com/mountiny in version: 9.3.23-3 🚀
|
Explanation of Change
Fixed Issues
Part of #79043
PROPOSAL:
Tests
Same as QA Steps
Offline tests
Same as QA Steps
QA Steps
NOTE: No subscription size page in Android/iOS
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
android.mweb.mp4
iOS: Native
iOS: mWeb Safari
ios.mweb.mp4
MacOS: Chrome / Safari
web.mp4