block / block/buzz

Members dialog: People / Agents tabs with counts instead of one flat list

Open
#2,992 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

**Motivation**

The Channel members dialog renders people and agents as one flat list. In a large channel (400+ members) there's no way to tell how many agents are present or scan just the people: "Members · N" counts both together, and the sort interleaves agents with people (role `bot` ranks alongside ordinary members in `compareMembersForModal`).

Related friction: #2648 (duplicate agent identities "inflating channel membership"). And the mobile members sheet already groups "People — N" / "Bots — N" sections (`mobile/lib/features/channels/members_sheet.dart`), so desktop and mobile currently disagree on this.

**Proposed solution**

Tabs in the members dialog — **All · People · Agents** — with counts in the labels, defaulting to **All** (agents stay equal members of the channel; this is a lens, not a hierarchy).

- Visual pattern: the in-dialog underline tabs `ChannelBrowserDialog` already uses (All/Joined/Archived), same feature dir.
- Counts are already computed: `useClassifiedMembers` exposes `peopleCount`/`botCount`, currently unused.
- Agent rows keep the existing Bot-icon "agent" chip.
- Add-member search: on the Agents tab, scope results to `isAgent`; All behaves exactly as today.
- One classification question to settle: client-side `isBot()` checks `role === "bot"` plus the viewer's managed/relay agent lists, but ignores the backend's `member.isAgent` (NIP-OA owner check) — so an agent added by someone else with role `member` would land under People. I'd OR in `member.isAgent` so the tab split matches backend truth.

**Alternatives considered**

- Grouped section headers in one list — what mobile does today, and what this modal had before #1054 consolidated People/Bots into one list. Works, but more scrolling in large channels and no focused view.
- Filter chips instead of tabs — equivalent behavior; tabs match the existing in-dialog pattern.
- Two tabs without All — dropped: All preserves the current default and mental model.

**Additional context**

Prior art in-repo: #1054 (consolidated the earlier People/Bots sections into today's flat list), #291 (the old sidebar Bots section with lifecycle controls), #2404 (split "N agents" / "N teams" counts on channel template rows), #2531 (@agents/@people category mentions — the same people-vs-agents classification, in the composer).

Duplicate search: none found — closest is #2531, which is about mention categories rather than the members dialog.

Happy to implement — planning to follow up with a PR if the approach looks right.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.