Skip to content
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

login form layout for ipad #8752

Merged
merged 10 commits into from
May 20, 2022
Merged

login form layout for ipad #8752

merged 10 commits into from
May 20, 2022

Conversation

aneequeahmad
Copy link
Contributor

@aneequeahmad aneequeahmad commented Apr 22, 2022

Details

Fixed Issues

#8122

Tests

For ipad/tablets

  1. Open Expensify app on iPad/tablet (Signed out state).
  2. Verify that the login-form-layout is updated as per design.

For other platforms

  1. Open Expensify app
  2. Verify that due to these changes design is not effected for other platforms.
  • Verify that no errors appear in the JS console

PR Review Checklist

Contributor (PR Author) Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • I verified there are no console errors (if there’s a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained “why” the code was doing something instead of only explaining “what” the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named “index.js”. All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • Any functional components have the displayName property
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose and it is
  • If a new CSS style is added I verified that:
    • A similar style doesn’t already exist
    • The style can’t be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.

PR Reviewer Checklist

  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I verified tests pass on all platforms & I tested again on:
    • iOS / native
    • Android / native
    • iOS / Safari
    • Android / Chrome
    • MacOS / Chrome
    • MacOS / Desktop
  • I verified there are no console errors (if there’s a console error not related to the PR, report it or open an issue for it to be fixed)
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick).
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained “why” the code was doing something instead of only explaining “what” the code was doing.
    • I verified any copy / text shown in the product was added in all src/languages/* files
    • I verified any copy / text that was added to the app is correct English and approved by marketing by tagging the marketing team on the original GH to get the correct copy.
    • I verified proper file naming conventions were followed for any new files or renamed files. All non-platform specific files are named after what they export and are not named “index.js”. All platform-specific files are named for the platform the code supports as outlined in the README.
    • I verified the JSDocs style guidelines (in STYLE.md) were followed
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified all code is DRY (the PR doesn't include any logic written more than once, with the exception of tests)
  • I verified any variables that can be defined as constants (ie. in CONST.js or at the top of the file that uses the constant) are defined as such
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately and each prop has a /** comment above it */
    • Any functional components have the displayName property
    • The file is named correctly
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • The component has the minimum amount of code necessary for its purpose and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn’t already exist
    • The style can’t be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.

QA Steps

For ipad/tablets*

  1. Open Expensify app on iPad/tablet (Signed out state).
  2. Verify that the login-form-layout is updated as per design.

For other platforms

  1. Open Expensify app
  2. Verify that due to these changes design is not effected for other platforms.
  • Verify that no errors appear in the JS console

Screenshots

Web

Screen Shot 2022-04-22 at 11 55 09 PM

Desktop

Screen Shot 2022-04-23 at 12 13 38 AM

IOS

Screen Shot 2022-04-23 at 12 15 58 AM

Android

Android

Mweb

Mweb

IPad

Screen Shot 2022-04-22 at 10 55 02 PM

@aneequeahmad aneequeahmad requested a review from a team as a code owner April 22, 2022 18:33
@melvin-bot melvin-bot bot requested review from iwiznia and Santhosh-Sellavel and removed request for a team April 22, 2022 18:33
Copy link
Collaborator

@Santhosh-Sellavel Santhosh-Sellavel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add Screenshots/videos for other platforms too, so we can ensure everything else working fine.

resizeMode={props.isMediumScreenWidth ? 'contain' : 'cover'}
/>
</Pressable>
{graphicLayout(props.isMediumScreenWidth)}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why props.isMediumScreenWidth is passed here?

Comment on lines 40 to 58
const graphicLayout = () => (
<Pressable
style={[
styles.flex1,
StyleUtils.getBackgroundColorStyle(backgroundStyle.backgroundColor),
]}
onPress={() => {
Link.openExternalLink(backgroundStyle.redirectUri);
}}
disabled={!hasRedirect}
>
<SVGImage
width="100%"
height="100%"
src={backgroundStyle.backgroundImageUri}
resizeMode={props.isMediumScreenWidth ? 'contain' : 'cover'}
/>
</Pressable>
);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be an arrow function? I think it's not necessary

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Santhosh-Sellavel oh yes, you're right arrow function isn't necessary, also passing props.isMediumScreenWidth isn't necessary too as it is in the props so removing it where it is passed in props.

@aneequeahmad
Copy link
Contributor Author

@Santhosh-Sellavel please review pushed the changes

@Santhosh-Sellavel
Copy link
Collaborator

@iwiznia Can you initiate the workflow?
Screenshot 2022-04-25 at 11 37 42 PM

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Apr 25, 2022

@aneequeahmad Resized Desktop app is broken

Floating window

Screenshot 2022-04-26 at 12 53 13 AM

Split Window

Screenshot 2022-04-26 at 12 55 35 AM

cc: @iwiznia

Copy link
Collaborator

@Santhosh-Sellavel Santhosh-Sellavel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kindly fix this!
#8752 (comment)

@aneequeahmad
Copy link
Contributor Author

@Santhosh-Sellavel will be updating after pushing the commit. Thanks

@aneequeahmad
Copy link
Contributor Author

@Santhosh-Sellavel can't repro Resized desktop app broken issue.

@aneequeahmad
Copy link
Contributor Author

Oh reproduced and fixed the issues, screenshots attached after fix

Floating window

Screen Shot 2022-04-27 at 4 40 15 AM

Split Window
Screen Shot 2022-04-27 at 4 48 39 AM

@@ -27,6 +27,7 @@ module.exports = (env = {}) => {
devServer: {
contentBase: path.join(__dirname, '../../dist'),
hot: true,
host: '0.0.0.0',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this, it doesn’t need to be committed!

You can pass host to the webpack by just adding --host 0.0.0.0 to the yarn web command.

@aneequeahmad
Copy link
Contributor Author

@Santhosh-Sellavel oh yes this shouldn't be pushed. Removed this line

@chiragsalian
Copy link
Contributor

Update - i initiated the GH workflow as requested by this comment to get it moving along.

@Santhosh-Sellavel
Copy link
Collaborator

@aneequeahmad
Still, some style issues here, let's consult with the design team before making any further changes.

Screen.Recording.2022-04-29.at.6.40.53.AM.mov

@Santhosh-Sellavel
Copy link
Collaborator

@iwiznia
The solution tests well and looks good on all platforms.

We have one edge case here, I am trying to resize the web/desktop app. Which causes this issue -> #8752 (comment)

Let's check with the design what to do for this view.

There is not enough height available, we should consider both height & width ratios to decide on the layout.
Can we loop in the design team here thanks!

cc: @megankelso Since gave the wireframe here -> #8122 (comment)

@iwiznia
Copy link
Contributor

iwiznia commented May 2, 2022

@Expensify/design can you take a look at the above please?

@shawnborton
Copy link
Contributor

This side looks broken:
image

Notice how the orange background extends over top of the bottom controls of the gray half.

@michelle-thompson
Copy link
Contributor

Should we do away with the graphic completely? Even when the graphic isn't overextending as @shawnborton mentioned, it still feels a little awkward and broken to me.

@shawnborton
Copy link
Contributor

That's a good point - maybe we want to have a minimum height requirement here and if it's not met, don't show the bottom graphic? I think the original goal of this issue was that for iPad screens in vertical mode, the screen is super tall so we had plenty of space for both the login form and the graphic. In the case that's mocked up above that I pointed out, the screen height isn't actually that tall and thus it all feels a bit squished.

@Santhosh-Sellavel
Copy link
Collaborator

maybe we want to have a minimum height requirement here and if it's not met, don't show the bottom graphic

Sounds good to me!

@aneequeahmad
Copy link
Contributor Author

@Santhosh- I think we can limit this UI implemented for a specific range of screen sizes(tablets and ipads). Should we do these design changes in this PR ?

@Santhosh-Sellavel
Copy link
Collaborator

Yeah, it would be good if we do that.

@aneequeahmad
Copy link
Contributor Author

@Santhosh-Sellavel Pushed the changes as requested. Thanks

cc: @iwiznia (Great finding thanks)

@@ -55,7 +55,8 @@ const SignInPageContent = props => (
<LoginKeyboardAvoidingView
behavior="position"
contentContainerStyle={[
props.isSmallScreenWidth ? styles.signInPageNarrowContentMargin : styles.signInPageWideLeftContentMargin,
props.isSmallScreenWidth ? styles.signInPageNarrowContentMargin : {},
!props.isMediumScreenWidth && styles.signInPageWideLeftContentMargin,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment I left for the line above also applied to this one

@aneequeahmad
Copy link
Contributor Author

@iwiznia Done.

@aneequeahmad aneequeahmad requested a review from iwiznia May 19, 2022 15:19
Copy link
Collaborator

@Santhosh-Sellavel Santhosh-Sellavel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, and tests well!

@iwiznia

@Santhosh-Sellavel
Copy link
Collaborator

@iwiznia Let's merge this one!!

@iwiznia iwiznia merged commit 02fb4e9 into Expensify:main May 20, 2022
@OSBotify
Copy link
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@mvtglobally
Copy link

@aneequeahmad Can you update QA steps for this one? Do we need to test it?
CC: @iwiznia @Santhosh-Sellavel

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented May 20, 2022

Oh crap, I'm not sure how did I miss that.

@mvtglobally H
QA is needed here.

Here are the steps.

  1. Open the Expensify app on tablets
  2. Ensure Tablet Layouts match the mock given here for large-screen tablets -> [Payment due May 31] [$2000] iPad - Login form position should be a little lower in tablets - reported by @thesahindia #8122 (comment)

ipad-signin

@OSBotify
Copy link
Contributor

🚀 Deployed to staging by @iwiznia in version: 1.1.65-0 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

@aneequeahmad
Copy link
Contributor Author

@mvtglobally Updated the steps.

@Julesssss
Copy link
Contributor

Hey @Expensify/applause, could we get this one tested please using these steps. Thanks!

@mvtglobally
Copy link

@Julesssss Can you confirm the build we should use for validation?

@Julesssss
Copy link
Contributor

Julesssss commented May 23, 2022

Hi @mvtglobally, could you please test against1.1.65-0

Update: sorry @mvtglobally I see now that the same test is going to fail. I'll let you know when we're ready for further testing.

@Julesssss
Copy link
Contributor

Morning @Expensify/applauseleads, this one is ready for retesting now. Build 1.1.65-6

@mvtglobally
Copy link

@Julesssss Here are the screens. Let us know if this is pass or fail as team is not fully sure
2 devices are Apple iPad Air 2 & Apple iPad Air 4
Image from iOS (15)
Image from iOS (14)
IMG_D9F902A121CB-1
IMG_0128 (1)

@Julesssss
Copy link
Contributor

Julesssss commented May 24, 2022

Hi @mvtglobally, thanks! We should expect medium-sized tablets to not show the horizontal divider. So that seems good to me 👍

If we decide that the hardcoded cutoff height needs to change, that should be treated as a separate, non-deploy blocking issue.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @Julesssss in version: 1.1.65-6 🚀

platform result
🤖 android 🤖 success ✅
🖥 desktop 🖥 success ✅
🍎 iOS 🍎 success ✅
🕸 web 🕸 success ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants