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

Fixed : One of the popup modal options is highlighted by default #8581

Merged
merged 5 commits into from
May 3, 2022

Conversation

metehanozyurt
Copy link
Contributor

@metehanozyurt metehanozyurt commented Apr 10, 2022

Details

One of the popup modal options is highlighted by default, issue fixed

Fixed Issues

$ #8133

Tests

1-) Open Expensify App.
2-) Go to any user chat click on ➕ ,
3-) Go to any user chat click call button (up right on screen) ,
4-) When two users online request money to another one and click pay button and click arrow button like in this picture below,
5-) Go to Settings -> Profile -> Click on camera icon
6-) Go to Settings -> Workspace -> General Settings -> Click on camera icon to change picture
7-) Go to Settings -> Workspace -> Click tree dots button (up right on screen)
8-) Should not any item highlighted when open popover menu

pay button:
WhatsApp Image 2022-04-12 at 09 13 26

  • 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

1-) Open Expensify App.
2-) Go to any user chat click on ➕ ,
3-) Go to any user chat click call button (up right on screen) ,
4-) When two users online request money to another one and click pay button and click arrow button like in this picture below,
5-) Go to Settings -> Profile -> Click on camera icon
6-) Go to Settings -> Workspace -> General Settings -> Click on camera icon to change picture
7-) Go to Settings -> Workspace -> Click tree dots button (up right on screen)
8-) Should not any item highlighted when open popover menu

pay button:
WhatsApp Image 2022-04-12 at 09 13 26

  • Verify that no errors appear in the JS console

Screenshots

Web

web-2022-04-30.mp4

Mobile Web

ios-web-2022-04-30.mp4
android-Web-2022-04-30.mp4

Desktop

desktop-2022-04-30.mp4

iOS

ios-Native-2022-04-30.mp4

Android

android-native-2022-04-30.mp4

@metehanozyurt metehanozyurt requested a review from a team as a code owner April 10, 2022 06:21
@melvin-bot melvin-bot bot requested review from roryabraham and Santhosh-Sellavel and removed request for a team April 10, 2022 06:21
@Santhosh-Sellavel
Copy link
Collaborator

@metehanozyurt Please add video recordings.

@metehanozyurt
Copy link
Contributor Author

Of course , I do it immediately . I would have a few questions.
I added it as a test video for the web version. Would it be enough for me to shoot videos for web and desktop, would you like me to shoot for mobile versions as well? I can also do it in slow motion if you want @Santhosh-Sellavel .

@metehanozyurt
Copy link
Contributor Author

add video records all platform and for web and desktop make slow motion records too. Thank you @Santhosh-Sellavel for guiding me with your comments 🙏.

@Santhosh-Sellavel
Copy link
Collaborator

@metehanozyurt
Add QA Steps, also include all the areas (Chat, Profile Picture change, Workspace Image change, Workspace more etc) where we should verify changes. if possible update screen recordings to cover all these.

@metehanozyurt
Copy link
Contributor Author

I upload new videos and wrote all steps @Santhosh-Sellavel thank you 🙏 .
I think i have one issue i validate on stage version too. I am writing here because it is an important detail that you will encounter while checking. This issue like this .
Sometimes this button not look like this
WhatsApp Image 2022-04-12 at 09 13 26

fullscreen versions :

when user online request money comes :
WhatsApp Image 2022-04-12 at 09 22 39

logout and login
WhatsApp Image 2022-04-12 at 09 23 21

I would like to report this situation on the Slack channel, if you have permission. Thank you.

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Apr 12, 2022

@metehanozyurt you can report it on slack, if you are not on slack.

To request an invite to the channel, just email contributors@expensify.com with the subject Slack Channel Invite and include a link to your Upwork profile. 

@metehanozyurt
Copy link
Contributor Author

Thank you @Santhosh-Sellavel . I also tested this button, you can see it in the videos. Kind regards.

@Santhosh-Sellavel
Copy link
Collaborator

@metehanozyurt
Thanks for all your efforts. Reviewing this now.

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Apr 12, 2022

@metehanozyurt
This is still broken:

Screen.Recording.2022-04-13.at.1.42.40.AM.mov

From PR attachments:
Screenshot 2022-04-13 at 1 44 52 AM

@metehanozyurt
Copy link
Contributor Author

@Santhosh-Sellavel i am so sorry . I guess my eyes couldn't distinguish because these buttons are colored. I'm looking into the cause right now.

@metehanozyurt
Copy link
Contributor Author

metehanozyurt commented Apr 12, 2022

this file cause problem for call icons.
Popover/index.js can i change this file.

animationIn={props.isSmallScreenWidth ? undefined : props.animationIn}
animationOut={props.isSmallScreenWidth ? undefined : props.animationOut}

to like this

            animationIn={props.isSmallScreenWidth ? undefined : 'fadeIn'}
            animationOut={props.isSmallScreenWidth ? undefined : 'fadeOut'}

I would like to research if any other components uses it before I change it, if you see fit.

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Apr 12, 2022

I would like to research if any other components uses it before I change it, if you see fit.

Yes, please check!

@metehanozyurt
Copy link
Contributor Author

I done my research. my results is as follows. Popover/index.js used by many components.

Popover/index.js uses by this components

animationIn animationOut
no no BasePaymentsPage.js
...props ...props BasePopoverMenu.js
yes yes VideoChatButtonAndMenu.js
...props ...props PopoverWithMeasuredContent.js
no no PasswordPopover.js
no no ConfirmPopover.js

PopoverWithMeasuredContent.js uses by this components

animationIn animationOut
no no EmojiPicker/index.js
yes(fadeIn) no PopoverReportActionContextMenu.js

BasePopoverMenu.js uses by this components

animationIn animationOut
yes(fadeIn) yes(fadeOut) PopoverMenu/index.js (on my commits)
...props ...props PopoverMenu/index.native.js

Conclusion

I think it will increase the complexity of the sample code I suggested above. Instead, I think we should give the fadeIn and fadeOut parameters on the VideoChatButtonAndMenu.js file.

In the code fragments below, you can see that these parameters are not set on small screens.

animationIn={props.isSmallScreenWidth ? undefined : props.animationIn}
animationOut={props.isSmallScreenWidth ? undefined : props.animationOut}

And
animationIn={props.isSmallScreenWidth ? undefined : props.animationIn}
animationOut={props.isSmallScreenWidth ? undefined : props.animationOut}

I had to expand the solution method that I mentioned in my proposal. Because this was an issue I encountered while shooting screen videos.

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Apr 18, 2022

I think it will increase the complexity of the #8581 (comment) suggested above. Instead, I think we should give the fadeIn and fadeOut parameters on the VideoChatButtonAndMenu.js file.

I am fine with both the above solution or this solution

I think it will increase the complexity

@metehanozyurt What's the complexity here?

@metehanozyurt
Copy link
Contributor Author

That's why I think of it as complexity. It is already ignored on small screens. We also set it for big screens. That's why I was wondering if it should be given directly on the page. I was worried that the developer who would look at the code next to me would think that it would make more sense to change it on the page.

According to the decision of you managers, I can act in that way @Santhosh-Sellavel 🙏 . I am very happy with what I have learned from you 🙏 .

@metehanozyurt
Copy link
Contributor Author

I made a change on the page for the reason I mentioned above. If you don't see fit, I'd be happy to change it. Thank you @Santhosh-Sellavel .

Video records all platforms after this changed:
Desktop-Web:

call-button-web-desktop.mp4

ios native and mWeb:

ios-and-ios-mweb.mp4

android native and mWeb:

call-button-android-mweb.mp4

@Santhosh-Sellavel
Copy link
Collaborator

@roryabraham

What's your thought on this #8581 (comment)

@roryabraham
Copy link
Contributor

What's your thought on this #8581 (comment)

Well, I'm not sure the context. Why do we need to add a default animation? Can we just pass the animationIn and animationOut props in the instances where we need to?

If it makes sense to add these default animations, we should inject them as default props rather than inline in the component.

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Apr 27, 2022

If it makes sense to add these default animations, we should inject them as default props rather than inline in the component.

@metehanozyurt Can we do this?

@metehanozyurt
Copy link
Contributor Author

metehanozyurt commented Apr 27, 2022

Of course i will do it like this way @Santhosh-Sellavel . I just want to make sure I understand correctly. I don't want to make angry anyone.
I can commit immediately.

I will remove these lines:

animationIn="fadeInDown"
animationOut="fadeOutUp"

animationIn="fadeInDown"
animationOut="fadeOutUp"

animationIn="fadeInDown"
animationOut="fadeOutUp"

animationIn="fadeInUp"
animationOut="fadeOutDown"

animationIn="fadeInUp"
animationOut="fadeOutDown"

animationIn={props.isSmallScreenWidth ? undefined : props.animationIn}
animationOut={props.isSmallScreenWidth ? undefined : props.animationOut}

animationIn={props.isSmallScreenWidth ? undefined : props.animationIn}
animationOut={props.isSmallScreenWidth ? undefined : props.animationOut}

This one stay like this revert my change:

return <BasePopoverMenu {...props} onItemSelected={selectItem} />;

Already fadeIn and fadeOut default props in here so i will not do anything this for this file:

animationIn: 'fadeIn',
animationOut: 'fadeOut',

I will change this file like this:

const defaultProps = {
...(_.omit(defaultModalProps, ['type', 'popoverAnchorPosition'])),
// Anchor position is optional only because it is not relevant on mobile
anchorPosition: {},
};

const defaultProps = {
    ...(_.omit(defaultModalProps, ['type', 'popoverAnchorPosition'])),

    animationIn: 'fadeIn',
    animationOut: 'fadeOut',

    // Anchor position is optional only because it is not relevant on mobile
    anchorPosition: {},
    disableAnimation: true,
};

@Santhosh-Sellavel
Copy link
Collaborator

@metehanozyurt Looks good, please verify that it doesn’t break any existing behavior, Thanks!

@Santhosh-Sellavel
Copy link
Collaborator

@metehanozyurt Test's well. update the video in the PR.

@Santhosh-Sellavel
Copy link
Collaborator

Santhosh-Sellavel commented Apr 29, 2022

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.

@metehanozyurt
Copy link
Contributor Author

Updated all platform videos on PR @Santhosh-Sellavel . Thanks.

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.

LGTM Tests well!

@roryabraham

@roryabraham roryabraham merged commit 3fc95c6 into Expensify:main May 3, 2022
@OSBotify
Copy link
Contributor

OSBotify commented May 3, 2022

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

@OSBotify
Copy link
Contributor

OSBotify commented May 9, 2022

🚀 Cherry-picked to staging by @sketchydroide in version: 1.1.57-8 🚀

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

@Expensify/applauseleads please QA this PR and check it off on the deploy checklist if it passes.

@OSBotify
Copy link
Contributor

🚀 Deployed to production by @chiragsalian in version: 1.1.57-17 🚀

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.

4 participants