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.
|
| {pageName: CONST.MISSING_PERSONAL_DETAILS.PAGE_NAME.CONFIRM, component: Confirmation}, | ||
| ]; | ||
|
|
||
| function findPageIndex(pages: typeof formPages, pageName?: string): number { |
There was a problem hiding this comment.
❌ CONSISTENCY-3 (docs)
The findPageIndex function is duplicated from src/hooks/useSubPage/index.tsx. This violates the DRY principle and increases maintenance overhead.
Remove this duplicated function and use the one from the hook file directly, or export it from a shared utility file:
// In src/hooks/useSubPage/utils.ts (new file)
export function findPageIndex<TProps extends SubPageProps>(pages: Array<PageConfig<TProps>>, pageName?: string): number {
if (!pageName) {
return 0;
}
const index = pages.findIndex((page) => page.pageName === pageName);
return index !== -1 ? index : 0;
}
// In MissingPersonalDetailsContent.tsx
import {findPageIndex} from @hooks/useSubPage/utils;There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 06ef42f187
ℹ️ 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".
| const handleBackButtonPress = () => { | ||
| if (isEditing) { | ||
| goToTheLastStep(); | ||
| ref.current?.moveTo(lastScreenIndex); | ||
|
|
||
| Navigation.goBack(); | ||
| return; |
There was a problem hiding this comment.
Add a fallback when backing out of edit mode
In edit mode the handler calls Navigation.goBack() with no fallback. If the user refreshes on a /missing-personal-details/<step>/edit URL (or lands there directly), the navigation state has no history, so goBack() becomes a no-op and the back arrow stops working, leaving the user stuck in edit mode unless they submit. Consider navigating to the confirmation page (or using goBack with a backToRoute) so the back button still works after refresh.
Useful? React with 👍 / 👎.
|
on it now |
| import variables from '@styles/variables'; | ||
| import CONST from '@src/CONST'; | ||
| import Icon from './Icon'; | ||
| import {Checkmark} from './Icon/Expensicons'; |
There was a problem hiding this comment.
Let's use useMemoizedLazyExpensifyIcons
src/hooks/useSubPage/index.tsx
Outdated
| } | ||
|
|
||
| const index = pages.findIndex((page) => page.pageName === pageName); | ||
| return index !== -1 ? index : 0; |
There was a problem hiding this comment.
Can the index be -1? In findLastPageIndex, the lastIndex can be -1
There was a problem hiding this comment.
Yes, it can if it won't find the page. Im not sure Im getting what you're hinting at here
There was a problem hiding this comment.
Sorry for this confusion, I mean findPageIndex can't return -1, but findLastPageIndex can -> this's an inconsistency
There was a problem hiding this comment.
Ok, I get it know. I'll update it to return 0 in such case too. It will be consistent with the other method.
| {pageName: CONST.MISSING_PERSONAL_DETAILS.PAGE_NAME.CONFIRM, component: Confirmation}, | ||
| ]; | ||
|
|
||
| function findPageIndex(pages: typeof formPages, pageName?: string): number { |
There was a problem hiding this comment.
Moved it to new util file
|
@MrMuzyk can you please take a look at these bot's comments? |
|
@dukenv0307 Yes, I wanted to fix everything after you complete your review too :) |
|
@MrMuzyk I tested your branch and didn't see any issues. Once you complete fixing the comments above, we're good to approve |
|
Ive addressed all the comments and its ready for review again |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppScreen.Recording.2026-01-22.at.12.08.30.movAndroid: mWeb ChromeScreen.Recording.2026-01-22.at.11.55.05.moviOS: HybridAppScreen.Recording.2026-01-22.at.12.09.58.moviOS: mWeb SafariScreen.Recording.2026-01-22.at.11.54.21.movMacOS: Chrome / SafariScreen.Recording.2026-01-22.at.11.52.27.mov |
arosiclair
left a comment
There was a problem hiding this comment.
Looks great just a small change
contributingGuides/NAVIGATION.md
Outdated
|
|
||
| ## Multi-step flows with URL synchronization | ||
|
|
||
| Multi-step flows (wizards, forms with multiple screens) should use URL-based navigation via the `useSubPage` hook. This approach ensures browser navigation works correctly and page refreshes preserve the current position. |
There was a problem hiding this comment.
| Multi-step flows (wizards, forms with multiple screens) should use URL-based navigation via the `useSubPage` hook. This approach ensures browser navigation works correctly and page refreshes preserve the current position. | |
| Multi-step flows (wizards, forms with multiple screens) should use URL-based navigation via the `useSubPage` hook or via basic navigation between plain static routes. This approach ensures browser navigation works correctly and page refreshes preserve the current position. |
I think it's better to mention the alternative earlier here
contributingGuides/NAVIGATION.md
Outdated
| - Form flows with multiple sections | ||
| - Settings configuration flows | ||
|
|
||
| **Usage of the hook is not an explicit requirement. Plain static routes with basic navigation between them is also an acceptable approach.** |
There was a problem hiding this comment.
| **Usage of the hook is not an explicit requirement. Plain static routes with basic navigation between them is also an acceptable approach.** |
|
✋ 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/arosiclair in version: 9.3.8-0 🚀
|
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.3.8-3 🚀
|
Explanation of Change
Fixed Issues
$ #79039
PROPOSAL:
Tests
Same as QA steps
Offline tests
QA Steps
Precondition:
Add shipping detailsPR 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.mp4
Android: mWeb Chrome
android-web.mp4
iOS: Native
ios.mp4
iOS: mWeb Safari
ios.web.mp4
MacOS: Chrome / Safari
web.mp4