Skip to content

fix(desktop): a Members page owners and admins can find and use - #66

Merged
QuicksilverSlick merged 3 commits into
mainfrom
fix/members-management-for-admins
Oct 23, 2026
Merged

QuicksilverSlick merged 3 commits into
mainfrom
fix/members-management-for-admins

Conversation

@QuicksilverSlick

Copy link
Copy Markdown
Owner

What changes

Russell (owner/admin) couldn't find where to see, add or remove members. The member list existed, but it sat on a Settings page labelled "Invites" with a ticket icon. Adding by key was hidden inside the invite dialog, and if the role check ever failed, the entry vanished with no error.

  • Settings → Members: the page is renamed from "Invites", with a people icon. The section id stays the same, so routes and test ids don't change.
  • An "Add member" button: add by npub, hex or name search, as Member, or Admin for owners, using the existing AddMemberDialog. "Invite link" stays as a secondary action.
  • Removing a member asks for confirmation first (the existing ConfirmRemoveDialog). The list is sorted owners, then admins, then members.
  • Admin controls only for known admins:
    • a new relayMemberActions(viewerRole, memberRole, isSelf) helper gives no row actions unless the viewer is a known owner or admin;
    • the member list query runs only for them;
    • a failed refetch never shows the page to a non-admin.
  • No silent disappearance: if the role check fails, or the relay returns no member snapshot, the page shows a plain message with Retry instead of vanishing. The entry also stays visible while a retry runs, which fixes a bounce to Appearance found in testing.

Root cause, briefly

The nav entry and the page share one check: owner or admin in the relay's kind-13534 member snapshot. For Russell that check passes, because he sees the entry. So the list was there; the problems were the label and the hidden add flow. Block's upstream desktop has the same "Invites" label.

Tests

  • pnpm typecheck and pnpm check are clean.
  • pnpm test: all unit tests and jsdom tests pass, including after merging main with fix(desktop): push new members and profile edits to pickers live #65.
  • The new unit tests fail on origin/main (7 of 14 relayMembers cases).
  • Playwright, on a private port with --workers=1: invites-settings-screenshots (9/9), community-rail, sidebar, onboarding, deep-link-invite and identity-archive pass. invite-link-copy passes on its clipboard-granted origin.
  • Agent-reviewed: 7 findings, all fixed (role-gated row actions, data-first visibility, a11y focus after removal, cancel during removal, dialog naming).

Not exercised against the live hosted relay with a member key, because it needs an admitted test key. The logic is the same snapshot path that already works for Russell.

🤖 Generated with Claude Code

QuicksilverSlick and others added 3 commits October 21, 2026 22:26
Owners and admins manage people on the Settings page that was labelled
"Invites", so the member list was hard to find. Rename the entry and
its heading to "Members" (Users icon; the community-members id and
routes stay). The page now leads with "Add member", which opens the
existing Add member dialog (npub, hex or name search; owners can pick
Admin), with "Invite link" beside it. "Remove from community" asks for
confirmation first, and the list is sorted owners, admins, members.
The unused old CommunityMembersCard is deleted.

When the role check fails, or a membership relay sends no member list,
the entry used to vanish without saying why. It now stays, and the
page explains the problem and offers Retry. Add member and Invite link
stay usable because the relay still authorizes every admin event.

If the relay sends no member list, the role lookup also asks the
signed-in Builderlab account (never prompting; with no session the
native command rejects locally): an unarchived hosted community on the
same relay host whose owner_pubkey is the viewer's key makes the
viewer the owner, with roleSource "hosted-owner". A snapshot that
arrives always wins. Adds, removals and role changes already refresh
the member list and the role lookup when they settle.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fixes for the Members settings page.

- Row menus, Add member and Invite link need a known owner or admin
  role (relayMemberActions). An unknown role (failed check, no member
  list) shows only the warning and Retry, and the member list loads
  only for owners and admins.
- shouldShowCommunityMembersSettings decides from cached data when
  there is any, so a failed refetch no longer shows the entry to a
  known member or on an open relay. The entry also stays while a
  retry after a failure runs: before, opening the page or pressing
  Retry reset the query to pending and bounced the view to Appearance.
- Drop the Builderlab hosted-owner fallback. The Builderlab session
  is memory-only, so it never fired on a cold start, owner_pubkey in
  that response is unverified, and the made-up role leaked into the
  shared lookup (ban menus, guest detection).
- Invite link opens a link-only dialog; adding someone directly is
  Add member.
- Confirm remove: Cancel, Escape and the close button wait for an
  in-flight removal (closing reset the mutation and dropped its error
  toast), the title keeps the name while it animates out, and focus
  goes to the search field when it closes. Retry is disabled and
  reads "Retrying…" while it runs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@QuicksilverSlick QuicksilverSlick added the lane:ready Builder is done: green, agent-reviewed, exercised. The steward puts it in the next train. label Oct 22, 2026
This was referenced Oct 23, 2026
QuicksilverSlick added a commit that referenced this pull request Oct 23, 2026
@QuicksilverSlick
QuicksilverSlick merged commit cf9cfb5 into main Oct 23, 2026
56 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

lane:ready Builder is done: green, agent-reviewed, exercised. The steward puts it in the next train.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant