fix: user table to load on scroll (#29593)

* fix: load more users on table scroll

Signed-off-by: Chayan Das <[email protected]>

* refactor: move user listing logic to UserRepository

Add a dedicated listUsers method with search and cursor pagination support.

Add repository tests covering filtering and pagination.

Ensure user listing metadata remains consistent with the returned results.

Signed-off-by: Chayan Das <[email protected]>

---------

Signed-off-by: Chayan Das <[email protected]>
This commit is contained in:
Chayan Das authored and GitHub committed 2026-06-18 18:09:12 +00:00
1 parent 561cf889ab
commit 4e529cbad1
4 files changed
+250 -75

No files matched your search

@@ -109,16 +109,22 @@ export function UsersTable() {
}, [fetchMoreOnBottomReached]);
return (
<div>
<div className="flex flex-col gap-3">
<TextField
placeholder="username or email"
label={t("search")}
onChange={(e) => setSearchTerm(e.target.value)}
/>
<p className="text-subtle text-sm">
{isFetching && totalFetched === 0
? t("loading")
: `${t("showing_x_of_y", { x: totalFetched, y: totalRowCount })}`}
</p>
<div
className="border-subtle rounded-md border"
ref={tableContainerRef}
onScroll={() => fetchMoreOnBottomReached()}
onScroll={() => fetchMoreOnBottomReached(tableContainerRef.current)}
style={{
height: "calc(100vh - 30vh)",
overflow: "auto",