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

Backer dash header #154

Merged
merged 14 commits into from
Jun 5, 2017
Merged

Backer dash header #154

merged 14 commits into from
Jun 5, 2017

Conversation

theginbin
Copy link
Contributor

WHAT

Some improvements to the Backer Dashboard, including collapsible header, swiping between tabs, and bug fixes.

profile-collapse-swipe

self.setSelectedButton = Signal.merge(
self.backedButtonTitleText.skip(first: 1).mapConst(.backed),
self.backedButtonTitleText.skip(first: 1).mapConst(.backed).take(first: 1),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

For clarity, let me explain this line:
We prefix the user fetch with the current user, which doesn't contain the number of backed projects (hi graphql!), so we have to skip the first emission and wait for the api to return with the full user data. I am adding the .take(first: 1) because when the user leaves this screen, we want to keep their place. In the current version, this is a bug - it resets the tab and indicator view to always select "backed".

@justinswart
Copy link
Contributor

This looks cool! Did you consider a UITableView with a header view and a section header view for the tabs? You'd get the pinning at the top for free and wouldn't need any pan gesture or animation code.

@theginbin
Copy link
Contributor Author

@justinswart not sure i understand how you could switch between table views that way? If you use the same table view and just refresh the data, then you wouldn't be able to save your place after scrolling in the different sections. Know what I mean?

@justinswart
Copy link
Contributor

@theginbin aah, good point! I guess it wouldn't work in this scenario.

Copy link
Contributor

@mbrandonw mbrandonw left a comment

Choose a reason for hiding this comment

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

I think this is all good! I just have one question...

self.vm.inputs.viewWillAppear(false)
self.isRefreshing.assertValues([true, false, true])
self.vm.inputs.viewWillAppear(true)
self.isRefreshing.assertValues([true, false, true], "Projects refresh after swipe animation.")
Copy link
Contributor

Choose a reason for hiding this comment

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

will this reset you back to the first page? like if I paginate a few times, swipe left and then swipe back to the right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It does keep your place after paginating and swiping between tabs (i've also tested swiping with paginating through the project navigator and all seems well), but I will doublecheck paginating several times with swipes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@mbrandonw so you're right, it jumps back anywhere from 1 to 6 cells back after reloading OR paginating. I didn't see it because I had DiscoveryParams.lens.perPage set to 20 for our test account with fewer backed projects. The higher I set this value, the better it seems. Thoughts on how to keep the positioning other than loading more projects up front?

@theginbin theginbin merged commit b3d78d8 into master Jun 5, 2017
@justinswart justinswart deleted the backer-dash-header branch August 13, 2019 18:18
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.

None yet

3 participants