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

Fix scrolling problem for LHN #2406

Merged
merged 4 commits into from
Apr 16, 2021

Conversation

barun1997
Copy link
Contributor

@barun1997 barun1997 commented Apr 15, 2021

<If necessary, assign reviewers that know the area or changes well. Feel free to tag any additional reviewers you see fit.>

Details

I originally added flexGrow0 to the OptionsList because the view for IOUConfirmationList wasn’t showing the components as per the design. But flexGrow0 caused a regression in LHN because it stopped it from growing beyond its fixed height and width, and therefore, affected scrolling.

This solution solves the issue by using flexGrow0 only when it is passed as a prop. So components that need flex1 as a style in OptionsList have no regression.

Fixed Issues

The PR fixes the issue mentioned by the following comment:

#2120 (comment)

Tests

  1. Go to IOUSplit page and continue until you reach IOUConfirm
  2. Verify if all the rows and comments are shown.
  3. Go to LHN, and verify you can scroll down the list

QA Steps

Same as Tests.

Tested On

  • Web
  • Mobile Web
  • iOS
  • Android

Screenshots

Web

Mobile Web

Desktop

iOS

Android

@barun1997
Copy link
Contributor Author

@Julesssss @marcaaron I resolved the regression passing a prop to the OptionsList, but I'm ideally looking for a better solution here. The problem, I think, is that - when you give flex: 1 to the OptionsList, it tries to take up all the available space, and thus, other children can't take available space. I tried different configurations to no avail. Maybe, I'm just not doing right, and my Flex knowledge is lagging me behind here! I'm open to any suggestions :)

Screenshot 2021-04-15 at 16 56 57

@marcaaron
Copy link
Contributor

I don't think this solution is working? I pulled down this branch and all the lists are still stuck and unable to move.

@@ -77,6 +80,7 @@ const defaultProps = {
optionBackgroundColor: undefined,
optionHoveredStyle: undefined,
contentContainerStyles: [],
listContainerStyles: [],
Copy link
Contributor

Choose a reason for hiding this comment

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

Oh I see the issue now, if you give this a default value of undefined the solution will work because below you are checking:

this.props.listContainerStyles ? this.props.listContainerStyles : [styles.flex1]

and empty array will be truthy value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ahh my bad 😅

@marcaaron
Copy link
Contributor

I think this is a fine solution as long as it causes no regressions and solves the original issue 🤷

@marcaaron
Copy link
Contributor

Can you please add a link to the comment where the regression was discovered in the PR description?

Change the default value for listContainerStyles
@github-actions
Copy link
Contributor

github-actions bot commented Apr 15, 2021

CLA Assistant Lite bot All contributors have signed the CLA ✍️ ✅

@barun1997
Copy link
Contributor Author

I have read the CLA Document and I hereby sign the CLA

@barun1997
Copy link
Contributor Author

recheck

@barun1997 barun1997 marked this pull request as ready for review April 15, 2021 19:13
@barun1997 barun1997 requested a review from a team as a code owner April 15, 2021 19:13
@MelvinBot MelvinBot requested review from TomatoToaster and removed request for a team April 15, 2021 19:13
@barun1997
Copy link
Contributor Author

Hi, @marcaaron! I made the change and also added the Comment in the PR description. :)

Copy link
Contributor

@TomatoToaster TomatoToaster left a comment

Choose a reason for hiding this comment

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

Hey I had one change requested. Let me know what you think!

@@ -196,7 +200,7 @@ class OptionsList extends Component {

render() {
return (
<View style={[styles.flexGrow0]}>
<View style={[...(this.props.listContainerStyles ? this.props.listContainerStyles : [styles.flex1])]}>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can be rewritten as

Suggested change
<View style={[...(this.props.listContainerStyles ? this.props.listContainerStyles : [styles.flex1])]}>
<View style={[...(this.props.listContainerStyles || [styles.flex1])]}>

Copy link
Contributor

@TomatoToaster TomatoToaster Apr 15, 2021

Choose a reason for hiding this comment

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

Though I'm a little unsure about the use of spread syntax here. Wouldn't [...(x)] be equal to just x?

I think this can be further simplified to:

Suggested change
<View style={[...(this.props.listContainerStyles ? this.props.listContainerStyles : [styles.flex1])]}>
<View style={this.props.listContainerStyles || [styles.flex1]}>

Is there a specific reason you'd want to have the syntax in my comment above instead?

Copy link
Contributor

Choose a reason for hiding this comment

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

yeah if we want to make this super clean we can just do this

const defaultProps = {
    listContainerStyles: [styles.flex1],
};

...
<View style={this.props.listContainerStyles}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@marcaaron I love this clean solution! Will implement it and push it. Thank you!

Julesssss
Julesssss previously approved these changes Apr 16, 2021
@barun1997
Copy link
Contributor Author

@Julesssss Made a slight change based on Marc's suggestion. Please feel free to review it any time! :)

Julesssss
Julesssss previously approved these changes Apr 16, 2021
Copy link
Contributor

@Julesssss Julesssss left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@marcaaron marcaaron left a comment

Choose a reason for hiding this comment

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

Looks like we are passing a 2D array now

@@ -196,7 +200,7 @@ class OptionsList extends Component {

render() {
return (
<View style={[styles.flexGrow0]}>
<View style={[this.props.listContainerStyles]}>
Copy link
Contributor

Choose a reason for hiding this comment

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

You're talking about this line right @marcaaron?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@TomatoToaster @marcaaron Damn, I am really sorry for the silly mistakes in this PR, guys. Looks like the festive season here has taken a toll on me! 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you so much for your patience and the time to review this as well! :)

Copy link
Contributor

@TomatoToaster TomatoToaster left a comment

Choose a reason for hiding this comment

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

Thanks for fixing it promptly, LGTM.

@marcaaron marcaaron merged commit 593b7d1 into Expensify:main Apr 16, 2021
@isagoico
Copy link

@marcaaron I see there are no QA steps. Do they need to be added or is this PR no qa?

@Julesssss
Copy link
Contributor

The steps are currently testable internally (for simplicity). I'll run them now.

@Julesssss
Copy link
Contributor

@barun1997 one thing that I've only just noticed is that you can't scroll the bill split contacts on the IOU Confirm page if they extend beyond the screen height. Was that always the case, or did that change with this PR? Thanks!

@marcaaron
Copy link
Contributor

can't scroll the bill split contacts on the IOU Confirm page if they extend beyond the screen height

Sounds like what we were trying to fix with this PR 😅

@OSBotify
Copy link
Contributor

🚀 [Deployed](https://github.com/Expensify/Expensify.cash
/actions/runs/765130740) 🚀 to
staging on Mon Apr 19 2021 at 22:41:56 GMT+0000 (Coordinated Universal Time)

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

@roryabraham
Copy link
Contributor

@Julesssss Can we repeat QA for this tomorrow and get a more definitive answer? Please either:

  1. Check it off on the deploy checklist, or
  2. Label it as DeployBlockerCash and work towards a solution, or
  3. Revert it and confirm that the QA issue is no longer present.

Thanks!

@marcaaron
Copy link
Contributor

The LHN thing definitely was a blocker but that's resolved now so we can probably check this off.

@Julesssss
Copy link
Contributor

Julesssss commented Apr 23, 2021

Yeah, looks like someone has checked it off already. Thanks!

The remaining issue is in no way a blocker.

@barun1997
Copy link
Contributor Author

I will work on the non-scrolling issue over the weekend if it's okay? I have asked for help in the slack channel as well. In any case, will work extensively on it on Sunday!

@barun1997
Copy link
Contributor Author

@Jag96 I sent out an update here

@Jag96
Copy link
Contributor

Jag96 commented Apr 26, 2021

Sounds good @barun1997, please let us know what progress you've made or what you're stuck on so we can help out. I suggest updating the slack thread with the latest progress and asking again in expensify-open-source for another look to get more eyes on it.

@OSBotify
Copy link
Contributor

OSBotify commented May 8, 2021

🚀 Deployed to production in version: 1.0.39-5🚀

platform result
🤖 android 🤖 failure ❌
🖥 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.

8 participants