fix:blank page appears in validate code form page#55588
fix:blank page appears in validate code form page#55588dangrous merged 69 commits intoExpensify:mainfrom
Conversation
This comment was marked as off-topic.
This comment was marked as off-topic.
|
App/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx Lines 171 to 173 in 433778f This line makes this issue cc: @nkdengineer |
|
@hoangzinh 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] |
|
@jacobkim9881 is it reproducible if we click on "unverified" contact method in the 1st step? |
|
@hoangzinh It isn't reproducible if clicking 1st time so it isn't unrelated with the PR. Thanks for clarifying! |
|
|
||
| type ValidateCodeActionProps = ValidateCodeActionModalProps & ValidateCodeActionWithoutModalProps; | ||
|
|
||
| function ValidateCodeActionWithoutModal({ |
There was a problem hiding this comment.
Do you have any other names for this component? It seems is not a good name.
There was a problem hiding this comment.
I have updated it to ValidateCodeActionForm.
There was a problem hiding this comment.
Since it shares ValidateCodeActionModalProps, I think ValidateCodeAction should be included. It has the form element and has props to run actions. I think ValidateCodeActionForm can be properly used. Please to tell me if you have any idea though.
| <ScrollView keyboardShouldPersistTaps="handled"> | ||
| <ScrollView | ||
| keyboardShouldPersistTaps="handled" | ||
| contentContainerStyle={themeStyles.flex1} |
There was a problem hiding this comment.
can you elaborate why do we need this style?
There was a problem hiding this comment.
This style makes put "Verify" button to bottom. W/o the style the button will be placed beneath validate code form.
There was a problem hiding this comment.
The elements can fit the necessary space. The explain, form and button elements are placed in its position with this style.
| {!loginData?.validatedDate && ( | ||
| <ValidateCodeActionWithoutModal | ||
| hasMagicCodeBeenSent={hasMagicCodeBeenSent} | ||
| isVisible={isValidateCodeActionModalVisible && !loginData.validatedDate && !!loginData} |
There was a problem hiding this comment.
I think we should control the visibility of this component in line 323 instead of a prop. What do you think?
There was a problem hiding this comment.
Before it is controled with isVisible in <ValidateCodeActionModal>. I think it should be controlled in <ValidateCodeActionWithoutModal>.
There was a problem hiding this comment.
There was a problem hiding this comment.
Before it is controled with isVisible in
| )} | ||
|
|
||
| {!isValidateCodeActionModalVisible && getMenuItems()} | ||
| {!isValidateCodeActionModalVisible && !!loginData?.validatedDate && getMenuItems()} |
There was a problem hiding this comment.
Can you elaborate why do we need add an extra condition here?
There was a problem hiding this comment.
W/o it, trash can will show when navigating out on Android mWeb.
expensify-test19-2025-02-02_12.45.08.mp4
| useEffect( | ||
| () => () => { | ||
| firstRenderRef.current = true; | ||
| }, | ||
| [], | ||
| ); | ||
|
|
||
| useEffect(() => { | ||
| if (!firstRenderRef.current || !isVisible || hasMagicCodeBeenSent) { | ||
| return () => { | ||
| clearError(); | ||
| }; | ||
| } | ||
| firstRenderRef.current = false; | ||
| sendValidateCode(); | ||
| }, [isVisible, sendValidateCode, hasMagicCodeBeenSent, clearError]); |
There was a problem hiding this comment.
If it's not a modal. Do we need firstRenderRef or isVisible anymore?
There was a problem hiding this comment.
W/o it, it will send validate code in validated contact method or default method. It only sends validate code in validate code page only.
@jacobkim9881 can you check again testing steps? I think it should be "Verify that it shows a page to enter the code." |
|
@hoangzinh Thanks. I have updated the testing step. |
|
Hi! I'm starting to look into this now. Should be ready today or tomorrow |
|
Followup - I know this one's been going on for a long time and had a lot of changes to it. Are there any specific highlights/discussions that I should review while looking at the code? Thanks! |
|
@dangrous Hi! Let me brief shortly. #55588 (comment) #55588 (comment) https://github.com/Expensify/App/pull/55588/files#diff-83480a4b6a9a39b384509ec17b9f35136ce1a49805f968fd60cc1e8c5460a170R314-R316 #55588 (comment) #55588 (comment) |
|
@hoangzinh Please to add if there above is something I missed. |
|
Look good. I think you can review this PR normally @dangrous. @jacobkim9881 and I just tried to refine the code. The one thing you can check it out is focus trap |
dangrous
left a comment
There was a problem hiding this comment.
This looks good! Just a few minor comments but I think the decisions made throughout make sense to me, and it seems to test well.
| focusTrapOptions: isMobileSafari() | ||
| ? undefined |
There was a problem hiding this comment.
Yeah it looks like there are a number of issues with focus traps and mWeb Safari across the app (just search for isMobileSafari haha. I think this should be okay for now.
| return new Promise((resolve) => { | ||
| const interval = setInterval(() => { | ||
| const trapContainer = trapContainers.at(0); | ||
| if (!trapContainer || (trapContainer && getComputedStyle(trapContainer).visibility !== 'hidden')) { |
There was a problem hiding this comment.
| if (!trapContainer || (trapContainer && getComputedStyle(trapContainer).visibility !== 'hidden')) { | |
| if (!trapContainer || getComputedStyle(trapContainer).visibility !== 'hidden') { |
trapContainer has to exist in the second half of this
| focusTrapOptions: isMobileSafari() | ||
| ? undefined | ||
| : { | ||
| // It is added because input form's focusing bothers transition animation: |
There was a problem hiding this comment.
| // It is added because input form's focusing bothers transition animation: | |
| // We need to check this because focusing the input form interferes with the transition animation: |
| canDismissError | ||
| /> | ||
| )} | ||
| {isValidateCodeFormVisible && !loginData.validatedDate && !!loginData && ( |
There was a problem hiding this comment.
Should !!loginData come before !loginData.validatedDate?
There was a problem hiding this comment.
Yeah, loginData should exist before loginData.validatedDate.
dangrous
left a comment
There was a problem hiding this comment.
Great!! @hoangzinh do you want to take one last look/test or do you think we're ready to go?
|
bump @hoangzinh if you have a chance for a last test after the latest changes - thank you! |
hoangzinh
left a comment
There was a problem hiding this comment.
LGTM, tested again on Web/IOS safari/IOS/Android.
|
@dangrous sorry, I missed your message last week. |
|
all good! let's do this. |
|
✋ 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/dangrous in version: 9.1.9-0 🚀
|
|
🚀 Deployed to staging by https://github.com/dangrous in version: 9.1.9-0 🚀
|
|
🚀 Deployed to production by https://github.com/puneetlath in version: 9.1.9-8 🚀
|
Explanation of Change
This PR replaces
<ValidateCodeActionModal>with<ValidateCodeActionForm>inContactMethodDetailsPageas it creates<ValidateCodeActionForm>component. This component doesn't haveHeaderWithBackButtonorModalso it can be used in any page that needs validate code form but it can uses props for<ValidateCodeActionModal>.Fixed Issues
$ #53884
PROPOSAL:$ #53884 (comment)
Tests
Preparation
Test
Offline tests
Preparation
Test
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
Preparation
Test
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))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
expensify-test15-2025-01-29_05.23.39.mp4
Android: mWeb Chrome
expensify-test16-2025-01-29_05.28.07.mp4
iOS: Native
2025-01-29.5.18.03.mov
iOS: mWeb Safari
2025-01-29.5.19.48.mov
MacOS: Chrome / Safari
expensify-test14-2025-01-29_05.12.06.mp4
MacOS: Desktop
2025-01-29.5.30.16.mov