Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

feat: Add Pagination to Members Page #87

Merged

Conversation

techno-disaster
Copy link
Contributor

@techno-disaster techno-disaster commented May 27, 2020

Description

Add Pagination to load the members list on members page

Fixes #85

Flutter Channel:

  • I have used the Flutter Beta channel on my local machine

Type of Change:

Delete irrelevant options.

  • Code

Code/Quality Assurance Only

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Physical Device.
Steps :
Go to members page and scroll down too see if pagination works as required.

ezgif com-video-to-gif

Checklist:

Delete irrelevant options.

  • My PR follows the style guidelines of this project
  • I have performed a self-review of my own code or materials
  • I have commented my code or provided relevant documentation, particularly in hard-to-understand areas

Code/Quality Assurance Only

  • My changes generate no new warnings

bartekpacia
bartekpacia previously approved these changes May 27, 2020
Copy link
Contributor

@bartekpacia bartekpacia left a comment

Choose a reason for hiding this comment

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

Wow, great!

@@ -6,6 +6,7 @@ part of 'auth_service.dart';
// ChopperGenerator
// **************************************************************************

// ignore_for_file: always_put_control_body_on_new_line, always_specify_types, prefer_const_declarations
Copy link
Contributor

Choose a reason for hiding this comment

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

Please don't include generated files under git.

Copy link
Contributor

Choose a reason for hiding this comment

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

I approved because it's a small change but please do not forget about it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We haven't made those changes in the documentation though. So I don't think we can remove it yet in case a new contributor comes...
What do you think @bartekpacia ?

Copy link
Member

Choose a reason for hiding this comment

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

@bartekpacia when you need a change request you might as well, request change. because once @techno-disaster changes, you review will be dismissed

@techno-disaster
Copy link
Contributor Author

Wow, great!

i did not expect a straight away approve lol, no need to change variable names or something? xd Thanks @bartekpacia 👍

@techno-disaster techno-disaster added Category: Coding Changes to code base or refactored code that doesn't fix a bug. Status: Needs Testing Work has been reviewed and needs the code tested by the quality assurance team. labels May 27, 2020
@techno-disaster
Copy link
Contributor Author

@anitab-org/qa-team can anyone test this?
Steps :
Go to members page and scroll down too see if pagination works as required.

@isabelcosta
Copy link
Member

@anitab-org/qa-team can anyone test this?
Steps :
Go to members page and scroll down too see if pagination works as required.

The steps you mention here can be mentioned on the how has this been tested section in your PR description.

@techno-disaster
Copy link
Contributor Author

@anitab-org/qa-team can anyone test this?
Steps :
Go to members page and scroll down too see if pagination works as required.

The steps you mention here can be mentioned on the how has this been tested section in your PR description.

ok. thanks

@Akanksha1212
Copy link
Contributor

Not from QA team just tested this out of curiosity. Works perfectly fine on my phone. Great Work! @techno-disaster
Pagination_test

@bartekpacia
Copy link
Contributor

@techno-disaster What about increasing the number of paged records? Currently it seems to have to be reloaded a bit too often.

@techno-disaster
Copy link
Contributor Author

@techno-disaster What about increasing the number of paged records? Currently it seems to have to be reloaded a bit too often.

you mean increasing the number of members we get on screen each load?

@bartekpacia
Copy link
Contributor

Exactly.

@techno-disaster
Copy link
Contributor Author

techno-disaster commented May 29, 2020

Exactly.

Thats just hardcoded to 10, are you saying we should increase it? 🤔

@techno-disaster
Copy link
Contributor Author

@isabelcosta what do you think about this? how many members should be loaded at once?

@isabelcosta
Copy link
Member

@techno-disaster I have no idea what the criteria should be for deciding this number. @bartekpacia any idea? If in doubt, we can ask for help. @annabauza mind to give your opinion here?

@techno-disaster
Copy link
Contributor Author

We could give the user the option, but considering what kind of app this is and what its purpose is, it feels a bit irrelevant also giving users technical options would confuse them i think

@techno-disaster
Copy link
Contributor Author

Loading more number of users would obviously need more time to load. and the app kinda already feels slow, IMHO 10 is a good number. 15 looks good too

@bartekpacia
Copy link
Contributor

I'd load 20-25. The app will get faster in the future as we'll improve it. Fetching just 10 users doesn't solve the problem of slowness.

@techno-disaster
Copy link
Contributor Author

Here's how 30 looks. IMO 30 looks a bit slow cc: @isabelcosta @bartekpacia @annabauza
ezgif com-video-to-gif(2)

@techno-disaster
Copy link
Contributor Author

techno-disaster commented Jun 1, 2020

@isabelcosta @bartekpacia @annabauza any updates? I attached a load 30 members per page video above for refrence

@isabelcosta
Copy link
Member

@bartekpacia @techno-disaster My vote goes to 20, its a middle between 10 (too fast) and 30 (too slow).
I don't know exactly what would be the best criteria here, but based on your points I believe that is a good choice.

@techno-disaster
Copy link
Contributor Author

techno-disaster commented Jun 2, 2020

@bartekpacia @techno-disaster My vote goes to 20, its a middle between 10 (too fast) and 30 (too slow).
I don't know exactly what would be the best criteria here, but based on your points I believe that is a good choice.

I am good with 20 too :) Waiting for one more opinion, will update PR then

@rpattath rpattath added Status: Needs Review PR needs an additional review or a maintainer's review. and removed Status: Needs Testing Work has been reviewed and needs the code tested by the quality assurance team. labels Jun 2, 2020
@techno-disaster
Copy link
Contributor Author

Small update, I was running this on the debug app version which is slower than the actual release apk. @bartekpacia what do you think we should go with?

@bartekpacia
Copy link
Contributor

Let's stick with 20 :)

@ksorv
Copy link

ksorv commented Jun 4, 2020

Hey I'd love to gove you guys some input on this, this is kinda wrong way to do it!

Why dont you guys do something like:

fetchUsers(query, limit, skip) {
    // Returns limit no of users, searched over the db with query and for next one call to fetchUsers, it skips the limit you provided cause the objects or whatever returned from db doesn't change that fast!

I've been using this, its a gud pattern i guess!

It lets me define different limits for different things, like when i want to search for people i put limit to null and Put data returned in an infinite scroll.

For when a user search in like a emailing box, it shows like 10-20 or so.

What you guys say?

@techno-disaster
Copy link
Contributor Author

Hey I'd love to gove you guys some input on this, this is kinda wrong way to do it!

Why dont you guys do something like:

fetchUsers(query, limit, skip) {
    // Returns limit no of users, searched over the db with query and for next one call to fetchUsers, it skips the limit you provided cause the objects or whatever returned from db doesn't change that fast!

I've been using this, its a gud pattern i guess!

It lets me define different limits for different things, like when i want to search for people i put limit to null and Put data returned in an infinite scroll.

For when a user search in like a emailing box, it shows like 10-20 or so.

What you guys say?

Currently we only have a /users/verified endpoint from which we get the list and don't need it anywhere else apart from the members page. Also the backend team plans to change this soon, they are planning to change how users are sent, I'm not sure though and this might change how we fetch user list on the app, so I think we can write this part after thats done. .Maybe @isabelcosta could help you with this. Thanks for your update thought 👍😀

@techno-disaster
Copy link
Contributor Author

techno-disaster commented Jun 4, 2020

Updated code, app now loads 20 members per page.

Copy link
Contributor

@bartekpacia bartekpacia 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 :)

@isabelcosta
Copy link
Member

isabelcosta commented Jun 10, 2020

@anitab-org/qa-team can anyone test this PR, so we can consider it "Ready to Merge" if all goes well :)

@bartekpacia
Copy link
Contributor

@isabelcosta I bet you meant test ;P

@isabelcosta
Copy link
Member

@bartekpacia you correct! I just edited this :P

@foongminwong foongminwong self-requested a review June 10, 2020 22:42
Copy link

@foongminwong foongminwong left a comment

Choose a reason for hiding this comment

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

The changes made in this PR were tested locally. Following are the results:

  1. Code review - Done

  2. All possible responses were tested as below:

    • Before PR 87
      Screenshot/gif/url:
      before-pr-87

    Expected Result: The Members list cannot be scrolled fully. It'll only show the first 10 users.
    Actual Result: Same as expected.

    • After PR 87
      after-pr-87

    Screenshot/gif/url:
    Expected Result: The Members list can be scrolled fully and we can navigate the whole list now.
    Actual Result: Same as expected.

  3. Additional testcases covered: N/A

  4. Additional Comments: N/A

  5. Status of PR Changed to: Changed from Needs Review to Ready to Merge

  6. Android Version: 9.0, Device: Android Emulator Pixel API 28

@foongminwong foongminwong added Status: Ready to Merge Work has been tested and needs a final review and merge from a repo maintainer. and removed Status: Needs Review PR needs an additional review or a maintainer's review. labels Jun 10, 2020
@techno-disaster
Copy link
Contributor Author

@isabelcosta looks like its ready to be merged 👀

@isabelcosta
Copy link
Member

Awesome @techno-disaster and @foongminwong 👏

Copy link
Member

@isabelcosta isabelcosta left a comment

Choose a reason for hiding this comment

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

Great contribution @techno-disaster 👏 🎉

@isabelcosta isabelcosta merged commit 2b3568d into anitab-org:develop Jun 11, 2020
@techno-disaster techno-disaster deleted the issue-85-add-pagination branch June 16, 2020 01:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Category: Coding Changes to code base or refactored code that doesn't fix a bug. Status: Ready to Merge Work has been tested and needs a final review and merge from a repo maintainer.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use pagination feature on Members screen
7 participants