Server admin 20: core-menu-rows (#687) #755

Closed
charles wants to merge 0 commits from serveradmin-20-core-menu-rows into serveradmin
Owner

What

The administration rows of the menus (spec §3.1 rows 36, 59–61, 63–68), each in the original's group and position, built in fluxer-core::menus:

  • Channel (ChannelMenuData.tsx:561-617): "Edit channel" (MANAGE_CHANNELS in the channel, or UPDATE_RTC_REGION on voice; only when perms::channel_tabs is not empty) and "Duplicate channel" (MANAGE_CHANNELS) as a group after the notification rows; "Delete channel" (red) after "Copy channel ID".
  • Category (CategoryMenuData.tsx:291-310 + CategoryContextMenu.tsx): "Edit category", "Delete category" (red) before "Copy category ID".
  • Guild (GuildMenuData.tsx:355-385): "Community settings ▸" after "Invite members": one row per perms::settings_tabs entry by its label (community-settings-<tab>), the row itself opening the first tab; absent when no tab is allowed.
  • Member (GuildMemberContextMenu.tsx): "Change nickname" leads group 2; "Transfer ownership", "Timeout"/"Remove timeout", "Kick member", "Ban member" form the group after "Block" (red, except "Remove timeout", danger={!isTimedOut}), all from perms::moderation_caps; "Roles ▸" becomes checkboxes from members::roles_menu with MANAGE_ROLES (#640), read-only list otherwise.
  • Voice participant (VoiceParticipantMenuData.tsx:1022-1335): "Change nickname" at the end of the participant actions (others only), "Timeout"/"Remove timeout", "Kick member", "Ban member" after "Disconnect device", taken from menus::user::{change_nickname, moderation_rows} and sending the same actions.
  • menus::with_shift(app, action, shift): "Duplicate channel" with Shift becomes ChannelAdminAction::Duplicate { name: <source's> } (no modal). Task 27 reads Shift in the UI and calls it.

Strings (fork): "Edit channel", "Duplicate channel", "Delete channel", "Edit category", "Delete category", "Community settings", "Change nickname", "Transfer ownership", "Timeout", "Remove timeout", "Kick member", "Ban member", "Roles".

Tests

  • New crates/fluxer-core/tests/menus_admin.rs: channel_menu_admin_rows (text, voice, category, forum × MANAGE_CHANNELS, UPDATE_RTC_REGION only, none, owner), duplicate_row_with_shift_skips_the_modal, guild_menu_settings_submenu, user_menu_moderation_rows (owner, moderator, member × self, owner, higher, lower, administrator, bot, timed out; plus timed-out self), roles_submenu_checkboxes_vs_read_only, rows_are_in_the_original_groups_and_order, existing_menu_rows_unchanged_without_permissions.
  • crates/fluxer-ui/tests/participant_menu.rs: participant_menu_rows_match_user_menu.
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally. No display-only (FLUXER_DESKTOP_TESTS) tests involved.

Deviations / for the reviewer

  • New MenuItemKind::DisabledToggle { checked } for a role checkbox the user may not toggle (disabled={!canToggle}); MenuItemKind::Disabled would lose the tick. The UI draws it as a faded row for now (two one-line arm additions in fluxer-ui screens/main/{menus/mod.rs,friends/mod.rs} to keep their matches exhaustive); Task 27 draws the checkbox submenu.
  • The read-only roles list keeps the id roles (Daily use's tests expect it); MenuItemId::ROLES_READ_ONLY stays unused.
  • Existing tests updated only where the user owns the guild and now sees the new rows: menus_channel_guild.rs, menus_user_dm.rs (the Daily use table filters admin rows; the roles assertion now expects checkboxes), fluxer-ui/tests/{participant_menu,stream_menu}.rs.
  • Goldens participant_menu and participant_menu_entrance_submenu redrawn with UPDATE_GOLDEN=1 (new rows; the owner sees them all); docs/screenshots/participant-menu.png updated.
  • The voice menu's "Change nickname" uses the member menu's rule (MANAGE_NICKNAMES and hierarchy); the original's voice menu checks MANAGE_NICKNAMES only (the server refuses the rest anyway).
  • "Duplicate channel" is shown only for types the client can create (forum/media only with threads active), so the row never does nothing.

Stacked on: serveradmin-13-core-member-moderation, serveradmin-16-core-channel-settings, serveradmin-19-core-sudo-delete-transfer (all already in serveradmin at 84aca2b4).

Closes #687

🤖 Generated with Claude Code

https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K

## What The administration rows of the menus (spec §3.1 rows 36, 59–61, 63–68), each in the original's group and position, built in `fluxer-core::menus`: - **Channel** (`ChannelMenuData.tsx:561-617`): "Edit channel" (MANAGE_CHANNELS in the channel, or UPDATE_RTC_REGION on voice; only when `perms::channel_tabs` is not empty) and "Duplicate channel" (MANAGE_CHANNELS) as a group after the notification rows; "Delete channel" (red) after "Copy channel ID". - **Category** (`CategoryMenuData.tsx:291-310` + `CategoryContextMenu.tsx`): "Edit category", "Delete category" (red) before "Copy category ID". - **Guild** (`GuildMenuData.tsx:355-385`): "Community settings ▸" after "Invite members": one row per `perms::settings_tabs` entry by its label (`community-settings-<tab>`), the row itself opening the first tab; absent when no tab is allowed. - **Member** (`GuildMemberContextMenu.tsx`): "Change nickname" leads group 2; "Transfer ownership", "Timeout"/"Remove timeout", "Kick member", "Ban member" form the group after "Block" (red, except "Remove timeout", `danger={!isTimedOut}`), all from `perms::moderation_caps`; "Roles ▸" becomes checkboxes from `members::roles_menu` with MANAGE_ROLES (#640), read-only list otherwise. - **Voice participant** (`VoiceParticipantMenuData.tsx:1022-1335`): "Change nickname" at the end of the participant actions (others only), "Timeout"/"Remove timeout", "Kick member", "Ban member" after "Disconnect device", taken from `menus::user::{change_nickname, moderation_rows}` and sending the same actions. - `menus::with_shift(app, action, shift)`: "Duplicate channel" with Shift becomes `ChannelAdminAction::Duplicate { name: <source's> }` (no modal). Task 27 reads Shift in the UI and calls it. Strings (fork): "Edit channel", "Duplicate channel", "Delete channel", "Edit category", "Delete category", "Community settings", "Change nickname", "Transfer ownership", "Timeout", "Remove timeout", "Kick member", "Ban member", "Roles". ## Tests - New `crates/fluxer-core/tests/menus_admin.rs`: `channel_menu_admin_rows` (text, voice, category, forum × MANAGE_CHANNELS, UPDATE_RTC_REGION only, none, owner), `duplicate_row_with_shift_skips_the_modal`, `guild_menu_settings_submenu`, `user_menu_moderation_rows` (owner, moderator, member × self, owner, higher, lower, administrator, bot, timed out; plus timed-out self), `roles_submenu_checkboxes_vs_read_only`, `rows_are_in_the_original_groups_and_order`, `existing_menu_rows_unchanged_without_permissions`. - `crates/fluxer-ui/tests/participant_menu.rs`: `participant_menu_rows_match_user_menu`. - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. No display-only (FLUXER_DESKTOP_TESTS) tests involved. ## Deviations / for the reviewer - New `MenuItemKind::DisabledToggle { checked }` for a role checkbox the user may not toggle (`disabled={!canToggle}`); `MenuItemKind::Disabled` would lose the tick. The UI draws it as a faded row for now (two one-line arm additions in `fluxer-ui` `screens/main/{menus/mod.rs,friends/mod.rs}` to keep their matches exhaustive); Task 27 draws the checkbox submenu. - The read-only roles list keeps the id `roles` (Daily use's tests expect it); `MenuItemId::ROLES_READ_ONLY` stays unused. - Existing tests updated only where the user owns the guild and now sees the new rows: `menus_channel_guild.rs`, `menus_user_dm.rs` (the Daily use table filters admin rows; the roles assertion now expects checkboxes), `fluxer-ui/tests/{participant_menu,stream_menu}.rs`. - Goldens `participant_menu` and `participant_menu_entrance_submenu` redrawn with `UPDATE_GOLDEN=1` (new rows; the owner sees them all); `docs/screenshots/participant-menu.png` updated. - The voice menu's "Change nickname" uses the member menu's rule (MANAGE_NICKNAMES **and** hierarchy); the original's voice menu checks MANAGE_NICKNAMES only (the server refuses the rest anyway). - "Duplicate channel" is shown only for types the client can create (forum/media only with threads active), so the row never does nothing. Stacked on: serveradmin-13-core-member-moderation, serveradmin-16-core-channel-settings, serveradmin-19-core-sudo-delete-transfer (all already in serveradmin at 84aca2b4). Closes #687 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Channel menu: "Edit channel", "Duplicate channel", "Delete channel";
category menu: "Edit category", "Delete category"; guild menu:
"Community settings" submenu of the allowed tabs; member menu: "Change
nickname", "Transfer ownership", "Timeout" / "Remove timeout", "Kick
member", "Ban member" and "Roles" as checkboxes with MANAGE_ROLES (#640);
the voice participant menu takes the nickname, timeout, kick and ban rows
from the member menu's builders. Participant menu goldens redrawn.

Refs #687

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Author
Owner

Independent review: Task 20 (core-menu-rows), commit a405b35d

I reviewed git diff 84aca2b4..origin/serveradmin-20-core-menu-rows.

Local gate: I ran FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree. Every step passed (EXIT=0), including the two regenerated participant_menu goldens.

What I checked

  • Plan tests. These exist with the tables the plan asks for: channel_menu_admin_rows (text/voice/category/forum × MANAGE_CHANNELS / UPDATE_RTC_REGION only / none, plus owner), guild_menu_settings_submenu (with an "absent when empty" case, and the tabs sub-project 10 builds give no row), user_menu_moderation_rows (owner/moderator/member × self/owner/higher/lower/admin/bot/timed out), roles_submenu_checkboxes_vs_read_only, rows_are_in_the_original_groups_and_order and participant_menu_rows_match_user_menu. Labels match the fork's descriptors.
  • Interfaces. These exist and are used by the participant menu: menus::user::{change_nickname, moderation_rows}, menus::with_shift, MenuItemKind::DisabledToggle and the MenuItemId constants. OpenGuildSettings { tab: None } resolves to the first permitted tab (admin/guild.rs:779).
  • Invariants. fluxer-core gains no new deps and does no I/O. All gating goes through perms::moderation_caps, settings_tabs and channel_tabs; no role positions are compared outside admin::perms. The test JSON is shaped like the server's (communication_disabled_until, decimal-string permissions). No secrets.
  • Parity spot-checks against ~/src/fluxer-soundboard:
    • ChannelMenuData.tsx:561-617: manage group after notifications, Delete (danger) after the copy group. Matches.
    • CategoryMenuData.tsx + CategoryContextMenu.tsx: mute moved last, Edit/Delete before Copy ID. Matches.
    • GuildMenuData.tsx:350-385: Community settings after Invite members, before Create channel; onTriggerSelect opens settings. Matches.
    • GuildMemberContextMenu.tsx and GuildModerationCapabilityUtils.ts: nickname leads group 2; group order transfer/timeout/kick/ban; danger={!isTimedOut}; no timeout on an administrator; no transfer to a bot. Matches.
    • VoiceParticipantMenuData.tsx:1022-1335: nickname for others only, after the local controls; timeout/kick/ban after Disconnect; no Transfer. Matches.
  • Review Focus 5. Rows and conditions follow §3.1 / §7. Nothing is shown to a member without the permission (existing_menu_rows_unchanged_without_permissions).

Findings

  1. minor: The voice participant menu's "Change nickname" also requires the hierarchy check. The original's voice menu checks MANAGE_NICKNAMES only (VoiceParticipantMenuData.tsx:1026). This is stricter than the original but matches its member menu, and the server enforces hierarchy anyway. Record it in the parity notes (Task 34).
  2. minor: "Duplicate channel" is hidden for types channel_create::channel_types cannot create (a forum while threads are inactive). The original shows it whenever canEditChannel && canManageChannels. This is a reasonable deviation, but it is undocumented in spec §13; record it in Task 34.
  3. minor: The plan's test name existing_menu_tests_untouched became existing_menu_rows_unchanged_without_permissions. Existing Daily use expectations were edited where the owner now sees admin rows: the daily_use_ids filter, and copy-channel-id is no longer asserted last. The intent holds.
  4. minor: The Shift flag is not a field on the action. It is menus::with_shift(app, action, shift), which rewrites OpenDuplicate to Duplicate { name }. This is consistent with Task 16's shift_duplicate_skips_modal; Task 27 must call with_shift on pick. MenuItemId::ROLES_READ_ONLY is unused (the read-only list keeps id roles); Task 27 should tell the two apart by the item kind.
  5. minor: The participant_menu goldens were regenerated on a hardware GPU, not lavapipe. They pass within tolerance here; watch the Linux runner.

Verdict: APPROVED. No blocking findings; local CI green.

## Independent review: Task 20 (core-menu-rows), commit a405b35d I reviewed `git diff 84aca2b4..origin/serveradmin-20-core-menu-rows`. **Local gate:** I ran `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree. Every step passed (EXIT=0), including the two regenerated participant_menu goldens. **What I checked** - **Plan tests.** These exist with the tables the plan asks for: `channel_menu_admin_rows` (text/voice/category/forum × MANAGE_CHANNELS / UPDATE_RTC_REGION only / none, plus owner), `guild_menu_settings_submenu` (with an "absent when empty" case, and the tabs sub-project 10 builds give no row), `user_menu_moderation_rows` (owner/moderator/member × self/owner/higher/lower/admin/bot/timed out), `roles_submenu_checkboxes_vs_read_only`, `rows_are_in_the_original_groups_and_order` and `participant_menu_rows_match_user_menu`. Labels match the fork's descriptors. - **Interfaces.** These exist and are used by the participant menu: `menus::user::{change_nickname, moderation_rows}`, `menus::with_shift`, `MenuItemKind::DisabledToggle` and the `MenuItemId` constants. `OpenGuildSettings { tab: None }` resolves to the first permitted tab (`admin/guild.rs:779`). - **Invariants.** fluxer-core gains no new deps and does no I/O. All gating goes through `perms::moderation_caps`, `settings_tabs` and `channel_tabs`; no role positions are compared outside `admin::perms`. The test JSON is shaped like the server's (`communication_disabled_until`, decimal-string permissions). No secrets. - **Parity spot-checks** against `~/src/fluxer-soundboard`: - `ChannelMenuData.tsx:561-617`: manage group after notifications, Delete (danger) after the copy group. Matches. - `CategoryMenuData.tsx` + `CategoryContextMenu.tsx`: mute moved last, Edit/Delete before Copy ID. Matches. - `GuildMenuData.tsx:350-385`: Community settings after Invite members, before Create channel; `onTriggerSelect` opens settings. Matches. - `GuildMemberContextMenu.tsx` and `GuildModerationCapabilityUtils.ts`: nickname leads group 2; group order transfer/timeout/kick/ban; `danger={!isTimedOut}`; no timeout on an administrator; no transfer to a bot. Matches. - `VoiceParticipantMenuData.tsx:1022-1335`: nickname for others only, after the local controls; timeout/kick/ban after Disconnect; no Transfer. Matches. - **Review Focus 5.** Rows and conditions follow §3.1 / §7. Nothing is shown to a member without the permission (`existing_menu_rows_unchanged_without_permissions`). **Findings** 1. **minor:** The voice participant menu's "Change nickname" also requires the hierarchy check. The original's voice menu checks MANAGE_NICKNAMES only (`VoiceParticipantMenuData.tsx:1026`). This is stricter than the original but matches its member menu, and the server enforces hierarchy anyway. Record it in the parity notes (Task 34). 2. **minor:** "Duplicate channel" is hidden for types `channel_create::channel_types` cannot create (a forum while threads are inactive). The original shows it whenever `canEditChannel && canManageChannels`. This is a reasonable deviation, but it is undocumented in spec §13; record it in Task 34. 3. **minor:** The plan's test name `existing_menu_tests_untouched` became `existing_menu_rows_unchanged_without_permissions`. Existing Daily use expectations were edited where the owner now sees admin rows: the `daily_use_ids` filter, and `copy-channel-id` is no longer asserted last. The intent holds. 4. **minor:** The Shift flag is not a field on the action. It is `menus::with_shift(app, action, shift)`, which rewrites `OpenDuplicate` to `Duplicate { name }`. This is consistent with Task 16's `shift_duplicate_skips_modal`; Task 27 must call `with_shift` on pick. `MenuItemId::ROLES_READ_ONLY` is unused (the read-only list keeps id `roles`); Task 27 should tell the two apart by the item kind. 5. **minor:** The participant_menu goldens were regenerated on a hardware GPU, not lavapipe. They pass within tolerance here; watch the Linux runner. **Verdict: APPROVED.** No blocking findings; local CI green.
Author
Owner

Merged into serveradmin by hand (the merge API returns 405); the commits are in the branch.

Merged into `serveradmin` by hand (the merge API returns 405); the commits are in the branch.
charles closed this pull request 2026-11-16 07:42:31 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.