Reduce invite history page size from 20 to 5

The invite screen now shows only 5 invites before requiring "View more"
to load additional pages, making the initial view more compact.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-04-13 16:12:03 -05:00
1 parent fe6efaad03
commit 04782f17ab
2 files changed
+12 -12

No files matched your search

+11 -11
View File
@@ -137,8 +137,8 @@ describe("CompanyInvites", () => {
expect(container.textContent).toContain("Create invite");
expect(container.textContent).toContain("Invite history");
expect(container.textContent).toContain("Board User 25");
expect(container.textContent).toContain("Board User 6");
expect(container.textContent).not.toContain("Board User 5");
expect(container.textContent).toContain("Board User 21");
expect(container.textContent).not.toContain("Board User 20");
expect(container.textContent).toContain("Review request");
expect(container.textContent).toContain("View more");
expect(container.textContent).not.toContain("Human or agent");
@@ -153,7 +153,7 @@ describe("CompanyInvites", () => {
expect(container.textContent).toContain("Each invite link is single-use.");
expect(container.textContent).toContain("Can create agents, invite users, assign tasks, and approve join requests.");
expect(container.textContent).toContain("Everything in Admin, plus managing members and permission grants.");
expect(listInvitesMock).toHaveBeenCalledWith("company-1", { limit: 20, offset: 0 });
expect(listInvitesMock).toHaveBeenCalledWith("company-1", { limit: 5, offset: 0 });
const viewMoreButton = Array.from(container.querySelectorAll("button")).find(
(button) => button.textContent === "View more",
@@ -165,10 +165,10 @@ describe("CompanyInvites", () => {
await flushReact();
await flushReact();
expect(listInvitesMock).toHaveBeenCalledWith("company-1", { limit: 20, offset: 20 });
expect(container.textContent).toContain("Board User 5");
expect(container.textContent).toContain("Board User 1");
expect(container.textContent).not.toContain("View more");
expect(listInvitesMock).toHaveBeenCalledWith("company-1", { limit: 5, offset: 5 });
expect(container.textContent).toContain("Board User 20");
expect(container.textContent).toContain("Board User 16");
expect(container.textContent).toContain("View more");
await act(async () => {
const viewerRadio = container.querySelector('input[type="radio"][value="viewer"]') as HTMLInputElement | null;
@@ -249,13 +249,13 @@ describe("CompanyInvites", () => {
await flushReact();
expect(container.textContent).toContain("Board User 25");
expect(container.textContent).not.toContain("Board User 5");
expect(listInvitesMock).toHaveBeenCalledWith("company-1", { limit: 20, offset: 0 });
expect(queryClient.getQueryData(queryKeys.access.invites("company-1", "all", 20))).toMatchObject({
expect(container.textContent).not.toContain("Board User 20");
expect(listInvitesMock).toHaveBeenCalledWith("company-1", { limit: 5, offset: 0 });
expect(queryClient.getQueryData(queryKeys.access.invites("company-1", "all", 5))).toMatchObject({
pages: [
{
invites: expect.any(Array),
nextOffset: 20,
nextOffset: 5,
},
],
});
+1 -1
View File
@@ -37,7 +37,7 @@ const inviteRoleOptions = [
},
] as const;
const INVITE_HISTORY_PAGE_SIZE = 20;
const INVITE_HISTORY_PAGE_SIZE = 5;
function isInviteHistoryRow(value: unknown): value is Awaited<ReturnType<typeof accessApi.listInvites>>["invites"][number] {
if (!value || typeof value !== "object") return false;