Repository navigation
Open restricted payment card flow over Subscription - #107023
Conversation
Co-authored-by: Joe Ph <gijoe0295@users.noreply.github.com>
|
|
|
🤖 Android test steps verification results: Verified workspace ownership and an active free trial on standalone Android NewDot. Tester permissions blocked offline/Onyx fixture setup, leaving restricted-subscription navigation unverified; no payment card was submitted.
|
|
🤖 Web test steps verification results: Testing on dev NewDot web was blocked by missing fixture and unsupported offline/Onyx controls. No payment card was submitted.
|
|
@MelvinBot please set the PR body to the content in the details section above DetailsExplanation of ChangePass Subscription as the explicit base route when opening Add payment card from the web Restricted screen. This prevents modal dismissal from making the underlying chat or Search page the card form's background. Keep the existing transition ordering and leave native navigation and other payment-card entry points unchanged. Add regression coverage for report and Search backgrounds, including waiting for modal dismissal before navigating. Branch ownershipThis draft uses an upstream branch because MelvinBot does not have push access to the requester's fork. To copy the branch into that fork: git remote add upstream https://github.com/Expensify/App.git
git fetch upstream claude-restrictedSubscription
git checkout -b claude-restrictedSubscription upstream/claude-restrictedSubscription
git push -u origin claude-restrictedSubscriptionYou can then close this draft and open a replacement from your fork if needed. AI Tests
Fixed Issues$ #105225 TestsPrecondition: Account has free trial
Offline testsPending human verification; the browser session blocker prevented establishing the issue's offline fixture. Same as Test QA StepsSame as Test
PR Author Checklist
Screenshots/VideosWeb verification blocker (not evidence of the corrected flow):
Android: NativeAndroid: mWeb ChromeScreen.Recording.2026-11-19.at.01.02.20.moviOS: NativeiOS: mWeb SafariScreen.Recording.2026-11-19.at.00.58.14.movMacOS: Chrome / SafariScreen.Recording.2026-11-19.at.00.56.42.mov |
|
Updated the PR body with the content from your details section, preserving the nested sections, checklist, and video links. |
|
@MelvinBot remove "Pending human verification; the browser session blocker prevented establishing the issue's offline fixture." from Test section on PR body |
|
Removed that sentence from the PR body’s “Offline tests” section. |
|
@MelvinBot mark PR ready for review |
|
@MelvinBot please make this change: When testing on web, the Restricted panel doesn't close smoothly: the card form opens the moment the close animation ends, before React has removed the closed screen, so the Restricted panel shows again for a frame. Please wait for the closed screen to unmount before opening the card form. In import runAfterClosingScreenUnmount from '@libs/Navigation/helpers/runAfterClosingScreenUnmount';
const addPaymentCard = () => {
Navigation.dismissModal({
// The transition ends a moment before React removes this screen. Opening the card form in that gap shows
// this screen again for a frame, so wait until it is gone.
afterTransition: () =>
runAfterClosingScreenUnmount(() => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path, ROUTES.SETTINGS_SUBSCRIPTION.route))),
});
}; |
|
Marked the PR as ready for review. |
|
@gijoe0295 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] |
Codex Review Summary: ✅ CompletedThis 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. |
|
@inimaga quick question on native. #107023 only fixes web. On native, the Restricted button is "Go to subscription" and only opens Subscription, and Subscription has no way to add a card (card actions are disabled on mobile). So native owners have to switch to web to add a card. Is that intended? If so, I'll mark native as not affected and keep this issue web-only. Screen.Recording.2026-11-19.at.01.55.01.mov |
Co-authored-by: Joe Ph <gijoe0295@users.noreply.github.com>
|
🤖 Web test steps verification results: ❌ fail Implemented and pushed the requested deferral, preserving native navigation; six focused tests passed. Browser verification was blocked by a suspended session, not a confirmed regression.
view run · no recording available |
| afterTransition: () => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path)), | ||
| // The transition ends a moment before React removes this screen. Opening the card form in that gap shows | ||
| // this screen again for a frame, so wait until it is gone. | ||
| afterTransition: () => runAfterClosingScreenUnmount(() => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path, ROUTES.SETTINGS_SUBSCRIPTION.route))), |
There was a problem hiding this comment.
On web, an owner can reach Restricted from Account → Profile by selecting Create report when their only eligible workspace is billing-restricted. Clicking Add payment card then opens the form over Profile because the navigator keeps the current page when Settings is already active. Navigation code
Could we switch to Subscription before opening the card form when the user is already on another Settings page?
There was a problem hiding this comment.
@MelvinBot please fix it by opening Subscription first when it isn't already the active page.
In src/pages/RestrictedAction/Workspace/WorkspaceOwnerRestrictedAction/index.tsx:
const openPaymentCardForm = () => Navigation.navigate(createDynamicRoute(DYNAMIC_ROUTES.ADD_PAYMENT_CARD.path, ROUTES.SETTINGS_SUBSCRIPTION.route));
const addPaymentCard = () => {
Navigation.dismissModal({
// The transition ends a moment before React removes this screen. Opening the card form in that gap shows
// this screen again for a frame, so wait until it is gone.
afterTransition: () =>
runAfterClosingScreenUnmount(() => {
if (Navigation.isActiveRoute(ROUTES.SETTINGS_SUBSCRIPTION.route)) {
openPaymentCardForm();
return;
}
// Opening the form only swaps the page underneath when it is in another tab. From another Settings
// page, such as Profile, that page would stay under the form, so open Subscription first.
Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION.route, {afterTransition: openPaymentCardForm});
}),
});
};The isActiveRoute check is needed because navigating to Subscription while it's already active does nothing, and its afterTransition would then wait up to 1s for a transition that never starts.
In tests/unit/pages/RestrictedAction/WorkspaceOwnerRestrictedActionTest.tsx:
- Add
isActiveRoute: (route: string) => mockGetActiveRoute() === routeto theNavigationmock. - Run the web test over
r/123,search?q=type:expenseandsettings/profile. For each, assert that the firstnavigatecall goes tosettings/subscription, and that running itsafterTransitionopenssettings/subscription/add-payment-card. - Add a case where the active route is
settings/subscription, asserting the form opens directly with a singlenavigatecall.
Please also add the Profile → + → Create report → Add payment card flow to the PR's QA steps.
There was a problem hiding this comment.
🤖 Web test steps verification results: ❌ fail
Implemented and pushed Subscription-first navigation, added Profile QA steps, and passed eight focused tests. Browser verification was blocked by a suspended session with no rendered UI; no card was submitted.
| Step | Status |
|---|---|
| ❌ | |
Profile, report, and Search open the form over Subscription without flashingBrowser verification blocked; regression unit tests passed. |
❌ |
Closing reveals Subscription; already-active Subscription avoids redundant delayBrowser verification blocked; direct-opening unit test passed. |
❌ |
view run · no recording available
|
Also, regarding your question on the native behaviour, yes, that is intentional. We switched to that button in #73257 so let’s keep this fix web-only. |
|
@gijoe0295 I sent you a Slack DM to connect GitHub. I will continue the original request once you are connected. |
|
@MelvinBot please send me a new request |
|
@gijoe0295 I sent you a Slack DM to connect GitHub. I will continue the original request once you are connected. |
|
The bot confirmed sending a fresh GitHub connection request. Please check your Slack DMs for the latest message. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppAndroid: mWeb ChromeScreen.Recording.2026-11-19.at.22.49.32.moviOS: HybridAppiOS: mWeb SafariScreen.Recording.2026-11-19.at.22.46.23.movMacOS: Chrome / SafariScreen.Recording.2026-11-19.at.22.42.48.mov |
Co-authored-by: Joe Ph <gijoe0295@users.noreply.github.com>
|
|
|
@inimaga withdraw approving, a problem need to check |
|
@inimaga tested. Profile is fixed, but opening Subscription first from the workspace chat (composer + → Create expense → Add payment card) makes the card form stutter. From another tab, |
|
@MelvinBot please make this change. In import getActiveTabName from '@libs/Navigation/helpers/getActiveTabName';
import getTopmostFullScreenRoute from '@libs/Navigation/helpers/getTopmostFullScreenRoute';
import NAVIGATORS from '@src/NAVIGATORS';and replace the body of the // Opening the form from another tab switches to Subscription underneath it on its own. Opening
// Subscription first from there would push a second tab navigator and make the form stutter.
// Only another Settings page, such as Profile, would stay under the form, so open Subscription first there.
const isOnSettingsTab = getActiveTabName(getTopmostFullScreenRoute()) === NAVIGATORS.SETTINGS_SPLIT_NAVIGATOR;
const shouldOpenSubscriptionFirst = isOnSettingsTab && !Navigation.isActiveRoute(ROUTES.SETTINGS_SUBSCRIPTION.route);
if (!shouldOpenSubscriptionFirst) {
openPaymentCardForm();
return;
}
Navigation.navigate(ROUTES.SETTINGS_SUBSCRIPTION.route, {afterTransition: openPaymentCardForm});In
In the QA steps, keep the Profile flow and add: narrow layout, Account tab → + → Create report → Add payment card, verify Subscription is underneath. |
Co-authored-by: Joe Ph <gijoe0295@users.noreply.github.com>
|
🤖 Web test steps verification results: ❌ fail Pushed the Settings-tab guard, updated the requested route tests, and added narrow Account QA steps while preserving Profile coverage. All 13 focused tests passed, but browser verification was blocked by a suspended, blank session.
view run · no recording available |
|
|
|
🚧 inimaga 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/inimaga in version: 9.5.52-1 🚀
|
|
No help site update needed — this PR only fixes navigation and transition behavior in an existing payment-card flow, without adding a feature or making any existing article sentence incorrect. |






Explanation of Change
Pass Subscription as the explicit base route when opening Add payment card from the web Restricted screen. This prevents modal dismissal from making the underlying chat or Search page the card form's background. Keep the existing transition ordering and leave native navigation and other payment-card entry points unchanged.
Add regression coverage for report and Search backgrounds, including waiting for modal dismissal before navigating.
Open Subscription explicitly before the card form only when another Settings page is active, including Profile and the narrow Account list. From other tabs, open the form directly so navigation switches its background without pushing an extra tab navigator. If Subscription is already active, also open the form directly to avoid waiting for a transition that never starts. Keep the existing closing-screen deferral and native behavior unchanged.
Branch ownership
This draft uses an upstream branch because MelvinBot does not have push access to the requester's fork. To copy the branch into that fork:
You can then close this draft and open a replacement from your fork if needed.
AI Tests
Follow-up: Settings-only Subscription navigation (2026-11-20)
prettierscript does not exist; Oxfmt passed on both changed files.Follow-up: Subscription-first navigation (2026-11-19)
prettierscript does not exist; the repository's Oxfmt commit hook passed.Follow-up: closing-screen deferral (2026-11-18)
prettierscript does not exist in this checkout; the repository's Oxfmt commit hook passed on both changed files.Original implementation
npm run lint,npm run lint-changed,npm run typecheck,npm run spell-changed, Storybook smoke tests, and the focused React Compiler check.prettierscript no longer exists in this checkout.origin/). The direct component compiler check passed.Fixed Issues
$ #105225
PROPOSAL: #105225 (comment)
Tests
Precondition: Account has free trial
E.g: if today's date is 8/26/2024 it would look like: Onyx.merge('nvp_private_lastDayFreeTrial', '2024-08-26 01:01:00');
Offline tests
Same as Test
QA Steps
Web: Profile background regression
Same as Test
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)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.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Settings-only navigation verification blocker (not evidence of the corrected flow):
Subscription-first verification blocker (not evidence of the corrected flow):
Follow-up browser verification blocker (not evidence of the corrected flow):
Web verification blocker (not evidence of the corrected flow):
Android: Native
Android: mWeb Chrome
Screen.Recording.2026-11-19.at.01.02.20.mov
iOS: Native
iOS: mWeb Safari
Screen.Recording.2026-11-19.at.00.58.14.mov
MacOS: Chrome / Safari
Screen.Recording.2026-11-19.at.00.56.42.mov