Skip to content

fix(space-members): seed popover/dialog count from SSR to avoid 0-flash - #1751

Closed
jwalkingjew wants to merge 1 commit into
masterfrom
worktree-fix-popover-count-flash
Closed

jwalkingjew wants to merge 1 commit into
masterfrom
worktree-fix-popover-count-flash

Conversation

@jwalkingjew

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #1749. The members/editors popovers (and the Manage… dialogs) briefly rendered "0 members" / "0 editors" on open before the first paginated API page resolved, even though the chip already had the correct number from SSR.

The chip reads space.totalMembers / space.totalEditors server-side (added in #1733). This change threads those same numbers into the popover/dialog as initialTotalMembers / initialTotalEditors, and the shared useSpaceParticipantsInfinite hook uses them as the fallback until the live API count arrives.

const totalCount = query.data?.pages[0]?.totalCount ?? initialTotalCount ?? 0;

So the count is correct on first paint and only ever "refreshes" if the SSR value and the live API value disagree (which they shouldn't — both come from the same GraphQL totalCount).

Test plan

  • Open the AI space members popover: footer reads 231 members immediately, no flash to 0.
  • Open "Manage members" on the AI space: heading reads 231 members immediately.
  • Same for editors popover and "Manage editors".
  • Smaller space (≤100 members): no regressions.

The members and editors popovers (and their Manage… dialogs) were starting
from `totalCount = 0` until the first paginated API page resolved, so the
footer/header briefly read "0 members" before snapping to the real value.

Pass `space.totalMembers` / `space.totalEditors` from the server-rendered
parent (already present on the Space DTO) into the client components, and
use it as the initial fallback inside `useSpaceParticipantsInfinite`. The
live API count overrides it as soon as the first page lands.
@vercel

vercel Bot commented May 1, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
geogenesis Ready Ready Preview May 1, 2026 9:44pm

Request Review

@ohohoreilly

Copy link
Copy Markdown
Contributor

Closing as part of a sweep of the open-PR queue. Not a judgement on the work — reopen if you still want it and I will help get it current.

Opened 2026-05-01 and now conflicting with master. At this distance a rebase is usually more work than redoing the change against current code, and the surrounding code has moved a long way underneath "fix(space-members): seed popover/dialog count from SSR to avoid 0-flash".

@jwalkingjew — if the idea still stands but the branch does not, a fresh PR or a ticket is probably a better route than reviving this one.

Nothing is discarded: the branch and its history remain, and reopening costs a click.

Context: 74 PRs were open, 25 older than two months, the oldest from February. The point is to make the queue mean something so genuinely ready work is visible rather than buried — #2449 sat ready for three days this week partly because of the noise. Only non-draft, conflicting PRs are in scope; drafts and anything still mergeable are being left alone.

This branch was successfully deployed

1 active deployment
Preview — 736d8e46 Deployed May 1, 2026 by vercel[bot]
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.

2 participants