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

Use PaginationTrigger to avoid loading all org members #65

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jwatzman
Copy link
Contributor

We can use this handy component to auto-paginate the members modal,
improving #63. A bit of plumbing to hand the entire OrgMembersData
down.

It does say "More messages available", not "users", but can fix that up
at some point later.

Test Plan:
Load #what-the-quack. See 10+ users. Click to open modal. Opens,
more users paginate in. Modify the PaginationTrigger to not auto-load
on visible, see button, click to see more users.

Created using spr 1.3.5-beta.1
Copy link
Contributor Author

@jwatzman jwatzman left a comment

Choose a reason for hiding this comment

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

I actually just messaged @flooey about this component, so cc you as fyi :)

<UserCount>{users.length}</UserCount>
<UserCount>
{orgMembers.orgMembers.length}
{orgMembers.hasMore ? '+' : ''}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@yeo-yeo this is IMO an omission in the new API -- we should send a total count so you know how many before you paginate through. @maylynn-ng is working on the first API we have now which combines paginated and non-paginated data, so we should follow the pattern there.

@jwatzman jwatzman marked this pull request as ready for review September 27, 2023 14:47
@yeo-yeo
Copy link
Contributor

yeo-yeo commented Sep 29, 2023

Having accepted, I've also just commented on https://github.com/getcord/clack/pull/67/files#r1341231319 that this might cause problems in that diff

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

2 participants