-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
feat: people infinite scroll #11326
feat: people infinite scroll #11326
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the pagination not being optional this is a breaking change, correct? Besides, that, the code looks really good! You're on a rollllll
@IsInt() | ||
@Min(1) | ||
@Max(1000) | ||
@Type(() => Number) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you need the type annotation, do you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The conversion is necessary because implicit conversions are disabled. Pagination is optional with the same defaults as before, so there shouldn't be any breaking changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah ok cool!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We only do because it is a query param so it would be a string otherwise.
This means the person page is no longer ordered by how many photos there are of a person, right? |
No, the current order is kept. If you have multiple unnamed people with the same photo count the order would previously be undefined which is a problem for pagination. Now it additionally sorts by |
The only thing with this is that it will scan and sort all the faces in the table to count them, then do that again for the next page. But that’s still much better than not being able to see the next page at all. |
Adds pagination for people to the server and infinite scroll to the people page on web for viewing more then 500 people.
person.createdAt
to have results in the same order every timehasNextPage
is optional to keep backwards compatibility with the mobile app