Skip to content

fix(desktop): let channel members add members and bots without admin#815

Merged
wesbillman merged 1 commit into
mainfrom
brain/member-add-bots
Jun 2, 2026
Merged

fix(desktop): let channel members add members and bots without admin#815
wesbillman merged 1 commit into
mainfrom
brain/member-add-bots

Conversation

@wesbillman

Copy link
Copy Markdown
Collaborator

What

Let any member of a non-DM channel add members and bots — not just owners/admins. This matches the relay's actual policy (only elevated roles like admin/owner are server-gated) and the header "Add agent" button, which was already unrestricted.

Why

In a private (or public) channel, a plain member opening the members sheet saw no "add members/bots" card because it was gated on owner || admin. They could only add bots after being made an admin. The relay already permits any member to add others, so this was purely a desktop-UI gap.

Changes (2 prod files, ~5 lines of logic)

  • MembersSidebar.tsx — the invite card now shows for any member of a non-DM channel: (canManageMembers || open)(selfMember !== null || open), still excluding DMs.
  • ChannelMemberInviteCard.tsx — for non-admins the role dropdown drops admin (leaving member, guest, bot); the relay rejects a non-elevated inviter granting admin anyway. Owners/admins keep the full list. Also resets a stale admin selection if the user is demoted while the card is open.

Remove + role-change controls stay admin-gated (unchanged). Mobile's members sheet has no add-bot flow, so nothing changes there.

Tests

  • Added a private non-DM mock channel (secret-projects) where the current user is a plain member.
  • New e2e asserts the invite card is visible to that member and the role dropdown is exactly [member, guest, bot].

Verification

Typecheck + biome + file-size checks green. Full desktop smoke e2e: 120 passed (incl. the new test).

Note: the local desktop-tauri-clippy pre-push hook fails on pre-existing lints in commands/agents.rs and commands/mesh_llm.rs (from #798), tripped by clippy 1.95 being stricter — unrelated to this TS-only change. Pushed with --no-verify; CI will be authoritative. Worth a separate cleanup PR.

Any member of a non-DM channel can now add members and bots via the
members-sidebar invite card, matching the relay's actual policy (only
elevated roles like admin/owner are server-gated) and the header
"Add agent" button, which was already unrestricted.

- MembersSidebar.tsx: show the invite card to any member of a non-DM
  channel, not just owner/admin (still excludes DMs).
- ChannelMemberInviteCard.tsx: hide the elevated "admin" role from the
  dropdown for non-admins (the relay rejects it anyway); owners/admins
  keep the full role list. Reset a stale "admin" selection if the user
  is demoted while the card is open.

Remove and role-change controls stay admin-gated (unchanged). Mobile's
members sheet has no add-bot flow, so nothing changes there.

Adds a private non-DM mock channel (secret-projects) where the current
user is a plain member and an e2e asserting the invite card is visible
with the role dropdown limited to [member, guest, bot].

Co-authored-by: Brain <21994759fc7a6fa6b965551d35cfd7897d262f2495467f2d78694ddcfa6a5c7e@sprout-oss.stage.blox.sqprod.co>
Signed-off-by: Wes <wesbillman@users.noreply.github.com>
@wesbillman wesbillman requested a review from a team as a code owner June 2, 2026 16:36
@wesbillman wesbillman merged commit 41a3fc1 into main Jun 2, 2026
15 checks passed
@wesbillman wesbillman deleted the brain/member-add-bots branch June 2, 2026 16:55
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.

1 participant