Skip to content

Paging project list#1048

Merged
wonder-sk merged 6 commits intomasterfrom
paging_project_list
Jan 8, 2021
Merged

Paging project list#1048
wonder-sk merged 6 commits intomasterfrom
paging_project_list

Conversation

@sklencar
Copy link
Contributor

@sklencar sklencar commented Dec 3, 2020

Listing all projects has been replaced with listing with paging functionality.

Note: NonProjectItem project status has been introduced to easily distinguish real project items and fetch button item in a model (and view). This approach of introducing an extra item in the list has been agreed before the implementation.

UPDATED:

  • fixed sorting by name
  • fixed jumping at the beginning after fetching new project items
  • partially fixed searching

Known issues:

  • Inconsistent project list when a content of a page has been changed on server in a meanwhile of browsing - user already fetched a batch of projects, a project has been deleted on Mergin and therefore another project is lost since order of project has been changed. Reloading the whole page resolves the issue. (Overwritten project list [handling parallel requests] #1050)
  • Search functionality for explore has been updated to be able search project by name (for time-being, see Allow search by workspace name and project name #1080). Currently filtering of my and shared projects are done on client side by the project model. Therefore search functionality is performed only on those projects which have been already fetched and stored in the model.

Screenshot 2020-12-03 at 12 23 17

closes #1043

@sklencar sklencar requested a review from wonder-sk December 3, 2020 11:25
@inputapp-bot
Copy link
Collaborator

win-apk: x86_64 (SDK: win-10)

@sklencar sklencar force-pushed the paging_project_list branch from 2810867 to 5ff313d Compare December 9, 2020 08:49
@inputapp-bot
Copy link
Collaborator

win-apk: x86_64 (SDK: win-10)

@wonder-sk wonder-sk requested a review from tomasMizera December 9, 2020 14:03
Copy link
Collaborator

@tomasMizera tomasMizera left a comment

Choose a reason for hiding this comment

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

Good job. I like how simple you edited the model 👍

While testing this PR on my device I came across some bugs:

  • Search is not working in explore

  • When more projects are fetched, application jumps visually to the first project of the list. This is a big problem on Android because scrolling is slow, especially if this is like a 10th page loaded and you need to scroll all 10 pages in order to opt for 11th (and then scroll again for 12th, ..... )

  • Projects are no longer sorted alphabetically (my, shared nor explore). This is not that big of a problem when user has just a few projects, it only make finding my/shared project less user friendly. On the other hand, this issue together with previous ones makes explore basically unusable. Lets say I want to find project lutraconsulting/test_forms. Since projects are not sorted, I have no clue where it could be, so I am just stuck with scrolling and checking each project if it is not the one I am looking for. Search is not working and scrolling is slow.
    Solution to this problem probably needs a help from Mergin, to return projects sorted alphabetically.

In the future, I think the best solution would be not using Fetch more button at all but pre-fetch projects when user is almost in the end of the list.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it not possible to just stick a button on the end of the listview? Clicking on the button would fetch new entries and fill a model with them. We would then not need a new project status nor any other reserved projects name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Of course, there are multiple ways how to implement such button. Some of the ideas were discussed with Martin and we agreed on introducing an extra item which seems to be the easiest and fastest solution.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, for me it seems as two different things and joining them can make some troubles in future (like checking on many places if the project in list is actually a project not some other button). But if you guys are ok with that, I am too :))

@tomasMizera
Copy link
Collaborator

I have looked at Mergin API and I think that we do not need any change in Mergin in order to get sorted list of (public) projects. What if we simply add sorting into query, possibly with search string. Would it be too slow?

@sklencar sklencar force-pushed the paging_project_list branch from 5ff313d to 8d3f6a8 Compare January 4, 2021 13:31
@inputapp-bot
Copy link
Collaborator

win-apk: x86_64 (SDK: win-10)

@inputapp-bot
Copy link
Collaborator

win-apk: x86_64 (SDK: win-10)

Copy link
Collaborator

@tomasMizera tomasMizera left a comment

Choose a reason for hiding this comment

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

Search in Explore works nice now, good job.

I will approve just let me know if the expectedProjectCount is or is not used

Update:
Maybe we could add some scenario to manual tests

Copy link
Collaborator

Choose a reason for hiding this comment

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

Well, for me it seems as two different things and joining them can make some troubles in future (like checking on many places if the project in list is actually a project not some other button). But if you guys are ok with that, I am too :))

@inputapp-bot
Copy link
Collaborator

win-apk: x86_64 (SDK: win-10)

@sklencar
Copy link
Contributor Author

sklencar commented Jan 6, 2021

Manual tests have been modified accordingly.

@tomasMizera tomasMizera self-requested a review January 6, 2021 13:09
vsklencar added 6 commits January 8, 2021 09:46
some improvements
added timer for search
remove unused member mExpectedProjectCount
@sklencar sklencar force-pushed the paging_project_list branch from 25f96cb to 9c79abd Compare January 8, 2021 08:46
@inputapp-bot
Copy link
Collaborator

win-apk: x86_64 (SDK: win-10)

@wonder-sk wonder-sk merged commit d094b89 into master Jan 8, 2021
@PeterPetrik PeterPetrik deleted the paging_project_list branch February 1, 2021 09:40
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.

Use paginated endpoint to list projects

4 participants