Skip to content
This repository was archived by the owner on Feb 23, 2021. It is now read-only.

Conversation

@ghost
Copy link

@ghost ghost commented Sep 21, 2018

In this PR we:

  • make transactions, channels and notifications list headers sticky
  • upgrade react-native-web and its dependencies (react-art, react-dom, react-dom)

The upgrade for react-native-web was required because previously stickyHeaderIndices for ListView was buggy. It's worth noting that the new version also supports FlatList and SectionList which have lots of improvements over the ListView.

During the upgrade process, I verified that all the screens and components didn't visually change/break. The only change needed was for the Seed view because flexGrow property used in MainContent component now works according to the spec - it's assigning flexBasis to auto. I've included the necessary fix for Seed view.

In the future we could add visual regression tests to the storybook stories to make sure the views don't change when upgrading libraries etc.

Channels:
channels

Transactions:
transactions

Notifications:
notifications

Closes: #611

data: PropTypes.array.isRequired,
renderHeader: PropTypes.func,
renderItem: PropTypes.func.isRequired,
stickyHeaderIndices: PropTypes.array,
Copy link
Author

Choose a reason for hiding this comment

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

stickyHeaderIndices was added as a prop because I assumed we might not want to have sticky headers on all lists. If that's not the case we can hardcode stickyHeaderIndices={[0]} instead of line 53.

Copy link
Contributor

Choose a reason for hiding this comment

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

IMO we do always want sticky headers :)

Copy link
Author

Choose a reason for hiding this comment

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

Cool, I'll make the appropriate changes.

Copy link
Author

Choose a reason for hiding this comment

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

@valentinewallace updated - all lists now have sticky headers.

Copy link
Contributor

@valentinewallace valentinewallace left a comment

Choose a reason for hiding this comment

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

Looks great visually! Just one change really, I think we do always want sticky headers.

data: PropTypes.array.isRequired,
renderHeader: PropTypes.func,
renderItem: PropTypes.func.isRequired,
stickyHeaderIndices: PropTypes.array,
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO we do always want sticky headers :)

"react-art": "~16.3.2",
"react-dom": "~16.3.2",
"react-native-web": "^0.6.0",
"react": "^16.5.2",
Copy link
Contributor

Choose a reason for hiding this comment

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

Don't think these changes should be part of this PR?

Copy link
Author

Choose a reason for hiding this comment

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

Because stickyHeaderIndices for ListView were buggy I had to upgrade react-native-web and its dependencies react, react-art, react-dom. Should we make the upgrade in a separate PR and rebase this one once the upgrade PR is merged?

Copy link
Contributor

Choose a reason for hiding this comment

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

Don't think these changes should be part of this PR?

This is tricky. I've been putting off upgrading react/react-native-web since there was quite a bit of breakage in some views. @ERKarl have you tested all screens in the storybook to make sure there are no regressions? I remember ListViews not scrolling without a manual window resize after items were added dynamically by actions.

Copy link
Author

Choose a reason for hiding this comment

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

Good point - I'll make sure to test this when I make the other requested changes in this PR.

Copy link
Author

Choose a reason for hiding this comment

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

@tanx I tested the ListView scrolling by dynamically adding items - didn't see any issues.

As for testing the screens for visual regressions - I did test that when putting up the PR. The only regression I found was with the seed view which is fixed in this PR.

Please double test 🙏 .

Copy link
Contributor

Choose a reason for hiding this comment

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

I tested the new dependency version. Looks like it breaks the seed view in storybook.

Copy link
Author

Choose a reason for hiding this comment

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

This the output I'm getting in erkarl:sticky-list-headers branch:
asdf

Can you elaborate on what's broken here?

Copy link
Contributor

Choose a reason for hiding this comment

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

This is on my machine after installing the versions in the package.json

bildschirmfoto 2018-10-04 um 15 37 43

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok I upgrade react/react-native-web in a separate PR and merged to master. @ERKarl would you kindly rebase this PR on top of the master? thanks

@ghost
Copy link
Author

ghost commented Oct 4, 2018

@tanx rebased. Should we also squash the commits?

Copy link
Contributor

@tanx tanx left a comment

Choose a reason for hiding this comment

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

LGTM... just one minor nit.

ref={component => (this.list = component)}
dataSource={this.dataSource}
renderHeader={this.props.renderHeader}
stickyHeaderIndices={[0]}
Copy link
Contributor

Choose a reason for hiding this comment

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

Since we're setting this globally for all List instances, we'll also need to add style={{ backgroundColor: color.white }} to the ListHeader in list-story in storybook.

Copy link
Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@tanx tanx left a comment

Choose a reason for hiding this comment

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

Awesome! Thanks @ERKarl

@tanx tanx merged commit 659d257 into lightninglabs:master Oct 4, 2018
@ghost ghost deleted the sticky-list-headers branch October 8, 2018 13:37
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keep column titles at the top of the page on scroll down

2 participants