-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix:blank page appears in validate code form page #55588
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you have any other names for this component? It seems is not a good name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have updated it to ValidateCodeActionForm
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you elaborate why do we need this style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ping @jacobkim9881 again ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before it is controled with isVisible
in <ValidateCodeActionModal>
. I think it should be controlled in <ValidateCodeActionWithoutModal>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Before it is controled with isVisible in
isVisible={isVisible} |
|
||
{!isValidateCodeActionModalVisible && getMenuItems()} | ||
{!isValidateCodeActionModalVisible && !!loginData?.validatedDate && getMenuItems()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you elaborate why do we need add an extra condition here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it's not a modal. Do we need firstRenderRef
or isVisible
anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
…code input screen with small screen devices" This reverts commit 7bfcb5d.
…ut screen with small screen devices
Reviewer Checklist
Screenshots/VideosAndroid: NativeScreen.Recording.2025-02-22.at.22.10.17.android.movAndroid: mWeb ChromeScreen.Recording.2025-02-22.at.00.28.51.android.chrome.moviOS: NativeScreen.Recording.2025-02-22.at.22.34.50.moviOS: mWeb SafariScreen.Recording.2025-02-22.at.00.25.32.ios.safari.movMacOS: Chrome / SafariScreen.Recording.2025-02-21.at.22.37.57.web.movMacOS: DesktopScreen.Recording.2025-02-22.at.00.21.23.desktop.mov |
@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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (!trapContainer || (trapContainer && getComputedStyle(trapContainer).visibility !== 'hidden')) { | |
if (!trapContainer || getComputedStyle(trapContainer).visibility !== 'hidden') { |
trapContainer
has to exist in the second half of this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
focusTrapOptions: isMobileSafari() | ||
? undefined | ||
: { | ||
// It is added because input form's focusing bothers transition animation: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// 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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
@@ -291,33 +327,21 @@ function ContactMethodDetailsPage({route}: ContactMethodDetailsPageProps) { | |||
canDismissError | |||
/> | |||
)} | |||
{isValidateCodeFormVisible && !loginData.validatedDate && !!loginData && ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should !!loginData
come before !loginData.validatedDate
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, loginData
should exist before loginData.validatedDate
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 🚀
|
Explanation of Change
This PR replaces
<ValidateCodeActionModal>
with<ValidateCodeActionForm>
inContactMethodDetailsPage
as it creates<ValidateCodeActionForm>
component. This component doesn't haveHeaderWithBackButton
orModal
so 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 Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
files and using the translation methodSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)Design
label and/or tagged@Expensify/design
so the design team can review the changes.ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.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