Server admin 31: ui-channel-permissions (#699) #772

Closed
charles wants to merge 0 commits from serveradmin-31-ui-channel-permissions into serveradmin
Owner

What this builds

The channel settings' Permissions tab (spec §3.7, §7, §8), over the store's admin::overwrites model (Task 17), with Task 26's permission_list and Task 8's tri-state buttons:

  • entity_settings/channel/permissions.rs: the override list in the shell's sidebar_override (ChannelPermissionsSidebar.tsx, OverwriteItem.tsx): "Back to settings", "ACCESS OVERRIDES", "Add override", one row per override (role colour dot, member's 12 px avatar, else the users glyph; @everyone last; selection; right press opens overwrites::row_menu); "Back to overrides" above the tabs once the list is left (DesktopChannelSettingsView.tsx). The page: the sync banner (SyncWithParentBanner.tsx: green "synced", amber "not synced" with "Sync with category"), the editor (PermissionEditorPanel.tsx): "Edit access for {name}" with its subtitle, "Remove override" (not for @everyone), the set-all row, "Search permissions…", the groups of Deny / Neutral / Allow rows with each disabled row's reason as tooltip, "No permissions found". The view-only state (MANAGE_ROLES without MANAGE_CHANNELS): everything drawn, nothing pressable but the list and the search. A refused save/sync shows ChannelPermissionsUpdateFailedModal ("Couldn't update channel permissions" / "Try again in a moment." / Close).
  • entity_settings/channel/add_override.rs: the popout (AddOverridePopout.{tsx,module.css}, SearchableListPopout.module.css) under "Add override", as wide as its wrapper (bottom-start, offset 8), search focused on open, "ROLES" / "MEMBERS" sections, "No matches".
  • channel/mod.rs: State, view_with/update_with/escape_with (the old view/update/escape delegate with no state, so Tasks 29/30's tests are untouched); app.rs keeps Local::channel_settings and focuses the popout's search.

Strings (all from the fork's English source): "Back to settings", "Back to overrides", "Access overrides", "Add override", "Remove override", "Use these buttons to quickly set all permissions.", "Search permissions…", "No permissions found", "Search roles or members…", "Roles", "Members", "No matches", "This channel is (not) synced with the parent category {name}.", "Sync with category", "Configure base access for this channel" / "…overrides for this role" / "…overrides for this member", "Delete role" / "Delete user", "Couldn't update channel permissions", "Try again in a moment.".

How it was tested

  • crates/fluxer-ui/tests/channel_permissions.rs (headless, written first and seen failing): list_rows_and_selection, add_override_popout_search_and_pick, tri_state_emits_set, set_all_row, disabled_reason_tooltip, sync_banner_states, remove_not_shown_for_everyone, view_only_disables_controls.
  • Goldens (fixtures/golden/, docs/screenshots/channel-permissions*.png, rows in docs/screenshots/README.md): channel_permissions, channel_permissions_add_override, channel_permissions_synced, channel_permissions_not_synced, channel_permissions_moderator_disabled, channel_permissions_voice. The overrides the goldens add go through a CHANNEL_UPDATE shaped as ChannelOverwriteResponse (packages/schema/src/domains/channel/ChannelSchemas.ts:13).
  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci green locally. No FLUXER_DESKTOP_TESTS=1 test was run (none added). No side-by-side with the Electron app: no Electron instance against the devserver here; the goldens are in docs/screenshots/.

Deviations / notes for the reviewer

  • Small changes outside the Files list, all in fluxer-ui: guild/roles.rs makes sidebar_button, row_style, rgb pub(crate) (reused, not copied); permission_list.rs gains search_with_id (the popout's autofocus); widgets/tri_state.rs gains view_any(Option<TriState>, …) (the set-all row has no active button when the rows differ, as currentState undefined) and now fades the icons of disabled buttons too (.stateButtonDisabled { opacity: 0.5 }: the icon tint ignores alpha, so it was drawn at full strength); app.rs holds the new state.
  • "Searching..." (the fork's Searching... string) replaces "No matches" in the popout while the server search is on its way, as the plan's interface asks; the original shows "No matches" then.
  • The "Add override" button sits inside popout::trigger (which needs the press), so it has no on_press of its own; it keeps the enabled look but has no hover highlight.
  • Left out as the role editor (spec §13): the dense/two-column layout toggle and the mobile list.

Closes #699

🤖 Generated with Claude Code

https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K

## What this builds The channel settings' **Permissions** tab (spec §3.7, §7, §8), over the store's `admin::overwrites` model (Task 17), with Task 26's `permission_list` and Task 8's tri-state buttons: - `entity_settings/channel/permissions.rs`: the override list in the shell's `sidebar_override` (`ChannelPermissionsSidebar.tsx`, `OverwriteItem.tsx`): "Back to settings", "ACCESS OVERRIDES", "Add override", one row per override (role colour dot, member's 12 px avatar, else the users glyph; @everyone last; selection; right press opens `overwrites::row_menu`); "Back to overrides" above the tabs once the list is left (`DesktopChannelSettingsView.tsx`). The page: the sync banner (`SyncWithParentBanner.tsx`: green "synced", amber "not synced" with "Sync with category"), the editor (`PermissionEditorPanel.tsx`): "Edit access for {name}" with its subtitle, "Remove override" (not for @everyone), the set-all row, "Search permissions…", the groups of Deny / Neutral / Allow rows with each disabled row's reason as tooltip, "No permissions found". The view-only state (MANAGE_ROLES without MANAGE_CHANNELS): everything drawn, nothing pressable but the list and the search. A refused save/sync shows `ChannelPermissionsUpdateFailedModal` ("Couldn't update channel permissions" / "Try again in a moment." / Close). - `entity_settings/channel/add_override.rs`: the popout (`AddOverridePopout.{tsx,module.css}`, `SearchableListPopout.module.css`) under "Add override", as wide as its wrapper (`bottom-start`, offset 8), search focused on open, "ROLES" / "MEMBERS" sections, "No matches". - `channel/mod.rs`: `State`, `view_with`/`update_with`/`escape_with` (the old `view`/`update`/`escape` delegate with no state, so Tasks 29/30's tests are untouched); `app.rs` keeps `Local::channel_settings` and focuses the popout's search. Strings (all from the fork's English source): "Back to settings", "Back to overrides", "Access overrides", "Add override", "Remove override", "Use these buttons to quickly set all permissions.", "Search permissions…", "No permissions found", "Search roles or members…", "Roles", "Members", "No matches", "This channel is (not) synced with the parent category **{name}**.", "Sync with category", "Configure base access for this channel" / "…overrides for this role" / "…overrides for this member", "Delete role" / "Delete user", "Couldn't update channel permissions", "Try again in a moment.". ## How it was tested - `crates/fluxer-ui/tests/channel_permissions.rs` (headless, written first and seen failing): `list_rows_and_selection`, `add_override_popout_search_and_pick`, `tri_state_emits_set`, `set_all_row`, `disabled_reason_tooltip`, `sync_banner_states`, `remove_not_shown_for_everyone`, `view_only_disables_controls`. - Goldens (`fixtures/golden/`, `docs/screenshots/channel-permissions*.png`, rows in `docs/screenshots/README.md`): `channel_permissions`, `channel_permissions_add_override`, `channel_permissions_synced`, `channel_permissions_not_synced`, `channel_permissions_moderator_disabled`, `channel_permissions_voice`. The overrides the goldens add go through a `CHANNEL_UPDATE` shaped as `ChannelOverwriteResponse` (`packages/schema/src/domains/channel/ChannelSchemas.ts:13`). - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` green locally. No `FLUXER_DESKTOP_TESTS=1` test was run (none added). No side-by-side with the Electron app: no Electron instance against the devserver here; the goldens are in `docs/screenshots/`. ## Deviations / notes for the reviewer - Small changes outside the Files list, all in `fluxer-ui`: `guild/roles.rs` makes `sidebar_button`, `row_style`, `rgb` `pub(crate)` (reused, not copied); `permission_list.rs` gains `search_with_id` (the popout's autofocus); `widgets/tri_state.rs` gains `view_any(Option<TriState>, …)` (the set-all row has no active button when the rows differ, as `currentState` undefined) and now fades the icons of disabled buttons too (`.stateButtonDisabled { opacity: 0.5 }`: the icon tint ignores alpha, so it was drawn at full strength); `app.rs` holds the new state. - "Searching..." (the fork's `Searching...` string) replaces "No matches" in the popout while the server search is on its way, as the plan's interface asks; the original shows "No matches" then. - The "Add override" button sits inside `popout::trigger` (which needs the press), so it has no `on_press` of its own; it keeps the enabled look but has no hover highlight. - Left out as the role editor (spec §13): the dense/two-column layout toggle and the mobile list. Closes #699 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
The channel settings' Permissions tab (CT/ChannelPermissionsTab.tsx,
CT/channel_permissions_tab/*, DLG/shared/AddOverridePopout.tsx) over the
store's overwrites model: the override list in the settings sidebar, the
sync banner, the editor with the set-all row, the search and the
tri-state permission rows through permission_list, the add popout, the
row menu, the refused-save alert, the view-only state.

The goldens' CHANNEL_UPDATE overrides are shaped as ChannelOverwriteResponse
(packages/schema/src/domains/channel/ChannelSchemas.ts:13).

Refs #699

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

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

Independent review: Server admin 31, Channel Permissions tab (#699)

I reviewed only this task's own commits, 9eee9a48 and 1e339704 (b9c0f260..1e339704). The merge 451bbb2c only brings in origin/serveradmin.

Gate, on the merged head 451bbb2c

  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci: ffmpeg, fmt and clippy passed. deny FAILED on RUSTSEC-2026-0543 (chrono, unmaintained) and RUSTSEC-2026-0545..0548 (zip 8.6.0). This task changes neither Cargo.lock nor deny.toml, so the failure comes from upstream. #773 tracks it.
  • I then ran the remaining steps by hand with the same environment. cargo xtask parity-check, cargo test --workspace and cargo test --workspace -- --ignored (the screenshot tests, including the six new goldens and every existing one) all passed. vendored-tests did not run because third_party is unchanged.

Checks

  1. Tests the plan names. All 8 headless tests are present in crates/fluxer-ui/tests/channel_permissions.rs, and each asserts what the plan says it should. All 6 goldens are tests in screenshots.rs, with an image in fixtures/golden/ and a copy in docs/screenshots/.
  2. Interfaces. channel/{permissions.rs,add_override.rs} exist, and channel/mod.rs is extended. The old view/update/escape functions delegate to the new ones, so Tasks 29 and 30 are unaffected.
  3. Invariants. fluxer-ui gains no I/O path; avatars go through user_avatar and the sanctioned loader. Nothing in the diff touches fluxer-core. The goldens' CHANNEL_UPDATE overrides are shaped as ChannelOverwriteResponse, with {id, type, allow, deny} and decimal strings. The diff contains no secrets.
  4. Parity, checked against the fork.
    • SyncWithParentBanner.tsx: both sentences match the fork, the category name is bold, the button appears only when the channel is not synced, and it is disabled without both permissions. The colours are status-online and status-idle.
    • AddOverridePopout.tsx: roles are sorted by position, overrides already present are hidden, and @everyone is always hidden. The "ROLES" and "MEMBERS" headings and "No matches" match the fork.
    • PermissionEditorPanel.tsx: "Remove override" is not shown for @everyone, and "Remove override", the set-all row and the rows are disabled with !canManageChannels || !canManageRoles. The set-all row has no active state when the rows differ, as currentState undefined.
    • ChannelPermissionsTab.getPermissionDisabledReason checks, in this order: need MANAGE_CHANNELS, need MANAGE_ROLES, owner, cannot grant what you lack, would remove your own. The core follows the same order.
  5. Review Focus (items 1 to 3 for overrides).
    • A non-owner cannot grant what they lack. The UI drops Set for a disabled row and the core set filters again; disabled_reason_tooltip covers it.
    • A non-owner cannot remove their own permission. would_remove_own_channel_permission matches wouldRemoveOwnPermission, including that it reads the saved overrides.
    • The overrides PATCH. save() sends the whole draft array without a 0/0 @everyone.
    • Nothing is sent before Save changes. Every UI message is a draft edit. The only exceptions are the popout's member search, which is a read, and "Sync with category", which saves at once as the fork's handleSyncWithParent does and as spec §6.2 requires.

The implementer's claim about the moderator view

I dumped disabled for every row as the moderator on #general and #announcements, for both the @everyone and the Moderators overrides. The moderator lacks VIEW_CHANNEL_MEMBERS (1<<54), BYPASS_SLOWMODE (1<<52) and CREATE_PRIVATE_THREADS (1<<36). On #announcements, @everyone also denies Send messages, Attach files and Add reactions. Every one of those rows is disabled with CannotGrantWhatYouLack, and every other row is enabled. That is exactly what the fork's getPermissionDisabledReason gives for this data. withImplicitThreadBits only adds bits for ADMINISTRATOR, so it changes nothing here.

No row is disabled through WouldRemoveYourOwn in this scenario, and the fork agrees. The fork only disables a row that way when the saved override already allows the bit, and neither #general nor #announcements has a saved override allowing anything for the moderator's role or for @everyone. Verdict: not a bug. Task 17 (core overwrites/perm_spec; the perm_spec rules come from Task 10) matches the original here.

Findings

  • [blocking, gate only, not caused by this task] cargo deny is red on the lockfile's advisories (#773). This PR cannot get ready-to-merge until #773 lands on serveradmin, serveradmin is merged in again, and the full gate is re-run. No code change is needed in this PR.
  • [minor, Task 17, not this PR] SetAll in core skips bits whose reason is WouldRemoveYourOwn. The fork's handleSetAllPermissions only skips bits the user lacks. The core is stricter than the original, and the server refuses the fork's case anyway. Worth a parity note.
  • [minor] The PR modifies files outside Task 31's Files list: widgets/tri_state.rs (view_any, and disabled icons now faded), permission_list.rs (search_with_id), guild/roles.rs (pub(crate)) and app.rs. Their owners (Tasks 8, 26, 27 and 33) are merged and every existing golden still passes, so I only record it.
  • [minor] "Searching..." replaces "No matches" while the server search is pending. The plan's interface asks for this, the fork does not do it, and the PR states it.

Verdict: changes are correct and match the original; not approved yet only because the CI gate is red on cargo deny (#773, upstream). Re-run the gate after #773 is merged in.

## Independent review: Server admin 31, Channel Permissions tab (#699) I reviewed only this task's own commits, 9eee9a48 and 1e339704 (b9c0f260..1e339704). The merge 451bbb2c only brings in origin/serveradmin. ### Gate, on the merged head 451bbb2c - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`: ffmpeg, fmt and clippy **passed**. **deny FAILED** on RUSTSEC-2026-0543 (chrono, unmaintained) and RUSTSEC-2026-0545..0548 (zip 8.6.0). This task changes neither Cargo.lock nor deny.toml, so the failure comes from upstream. #773 tracks it. - I then ran the remaining steps by hand with the same environment. `cargo xtask parity-check`, `cargo test --workspace` and `cargo test --workspace -- --ignored` (the screenshot tests, including the six new goldens and every existing one) **all passed**. vendored-tests did not run because third_party is unchanged. ### Checks 1. **Tests the plan names.** All 8 headless tests are present in `crates/fluxer-ui/tests/channel_permissions.rs`, and each asserts what the plan says it should. All 6 goldens are tests in `screenshots.rs`, with an image in `fixtures/golden/` and a copy in `docs/screenshots/`. 2. **Interfaces.** `channel/{permissions.rs,add_override.rs}` exist, and `channel/mod.rs` is extended. The old `view`/`update`/`escape` functions delegate to the new ones, so Tasks 29 and 30 are unaffected. 3. **Invariants.** fluxer-ui gains no I/O path; avatars go through `user_avatar` and the sanctioned loader. Nothing in the diff touches fluxer-core. The goldens' `CHANNEL_UPDATE` overrides are shaped as `ChannelOverwriteResponse`, with `{id, type, allow, deny}` and decimal strings. The diff contains no secrets. 4. **Parity, checked against the fork.** - `SyncWithParentBanner.tsx`: both sentences match the fork, the category name is bold, the button appears only when the channel is not synced, and it is disabled without both permissions. The colours are status-online and status-idle. - `AddOverridePopout.tsx`: roles are sorted by position, overrides already present are hidden, and @everyone is always hidden. The "ROLES" and "MEMBERS" headings and "No matches" match the fork. - `PermissionEditorPanel.tsx`: "Remove override" is not shown for @everyone, and "Remove override", the set-all row and the rows are disabled with `!canManageChannels || !canManageRoles`. The set-all row has no active state when the rows differ, as `currentState` undefined. - `ChannelPermissionsTab.getPermissionDisabledReason` checks, in this order: need MANAGE_CHANNELS, need MANAGE_ROLES, owner, cannot grant what you lack, would remove your own. The core follows the same order. 5. **Review Focus** (items 1 to 3 for overrides). - **A non-owner cannot grant what they lack.** The UI drops `Set` for a disabled row and the core `set` filters again; `disabled_reason_tooltip` covers it. - **A non-owner cannot remove their own permission.** `would_remove_own_channel_permission` matches `wouldRemoveOwnPermission`, including that it reads the *saved* overrides. - **The overrides PATCH.** `save()` sends the whole draft array without a 0/0 @everyone. - **Nothing is sent before Save changes.** Every UI message is a draft edit. The only exceptions are the popout's member search, which is a read, and "Sync with category", which saves at once as the fork's `handleSyncWithParent` does and as spec §6.2 requires. ### The implementer's claim about the moderator view I dumped `disabled` for every row as the moderator on #general and #announcements, for both the @everyone and the Moderators overrides. The moderator lacks VIEW_CHANNEL_MEMBERS (1<<54), BYPASS_SLOWMODE (1<<52) and CREATE_PRIVATE_THREADS (1<<36). On #announcements, @everyone also denies Send messages, Attach files and Add reactions. Every one of those rows is disabled with `CannotGrantWhatYouLack`, and every other row is enabled. That is exactly what the fork's `getPermissionDisabledReason` gives for this data. `withImplicitThreadBits` only adds bits for ADMINISTRATOR, so it changes nothing here. No row is disabled through `WouldRemoveYourOwn` in this scenario, and the fork agrees. The fork only disables a row that way when the *saved* override already allows the bit, and neither #general nor #announcements has a saved override allowing anything for the moderator's role or for @everyone. **Verdict: not a bug.** Task 17 (core `overwrites`/`perm_spec`; the `perm_spec` rules come from Task 10) matches the original here. ### Findings - **[blocking, gate only, not caused by this task]** `cargo deny` is red on the lockfile's advisories (#773). This PR cannot get `ready-to-merge` until #773 lands on serveradmin, serveradmin is merged in again, and the full gate is re-run. No code change is needed in this PR. - **[minor, Task 17, not this PR]** `SetAll` in core skips bits whose reason is `WouldRemoveYourOwn`. The fork's `handleSetAllPermissions` only skips bits the user lacks. The core is stricter than the original, and the server refuses the fork's case anyway. Worth a `parity` note. - **[minor]** The PR modifies files outside Task 31's Files list: `widgets/tri_state.rs` (`view_any`, and disabled icons now faded), `permission_list.rs` (`search_with_id`), `guild/roles.rs` (`pub(crate)`) and `app.rs`. Their owners (Tasks 8, 26, 27 and 33) are merged and every existing golden still passes, so I only record it. - **[minor]** "Searching..." replaces "No matches" while the server search is pending. The plan's interface asks for this, the fork does not do it, and the PR states it. **Verdict: changes are correct and match the original; not approved yet only because the CI gate is red on `cargo deny` (#773, upstream). Re-run the gate after #773 is merged in.**
Author
Owner

Review round 1, per finding:

  • Blocking: cargo deny red (Cargo.lock). No change to the PR. #773 is still open and has not reached origin/serveradmin (its tip is still 4d543549, which this branch already contains). cargo deny check on 451bbb2c still fails with RUSTSEC-2026-0543 and RUSTSEC-2026-0545 to 0548. Once #773 lands I will merge origin/serveradmin again and rerun the full cargo xtask ci. Until then this PR is blocked on #773.
  • Minor: SetAll in core is stricter than handleSetAllPermissions (overwrites.rs, Task 17). Not changed here, because the code belongs to Task 17. The core module doc already describes the deviation. I opened follow-up #774 (labels follow-up and parity) to record it in a parity note, or to align it with the original if Charles prefers that.
  • Minor: edits outside Task 31's Files list (tri_state.rs, permission_list.rs, guild/roles.rs, app.rs). No change. These are small additions that the channel tab needs: view_any, the faded disabled icons, search_with_id and the pub(crate) visibility. The tasks that own those files are merged and every existing golden still passes, so reverting the edits would only mean duplicating the code.
  • Minor: "Searching..." in place of "No matches" while the server search is pending (add_override.rs). No change. The plan's interface for Task 31 asks for this state, and the PR description already notes that it differs from the original.

No new commit this round.

Review round 1, per finding: - **Blocking: cargo deny red (Cargo.lock).** No change to the PR. #773 is still open and has not reached origin/serveradmin (its tip is still 4d543549, which this branch already contains). `cargo deny check` on 451bbb2c still fails with RUSTSEC-2026-0543 and RUSTSEC-2026-0545 to 0548. Once #773 lands I will merge origin/serveradmin again and rerun the full `cargo xtask ci`. Until then this PR is blocked on #773. - **Minor: SetAll in core is stricter than `handleSetAllPermissions` (overwrites.rs, Task 17).** Not changed here, because the code belongs to Task 17. The core module doc already describes the deviation. I opened follow-up #774 (labels follow-up and parity) to record it in a parity note, or to align it with the original if Charles prefers that. - **Minor: edits outside Task 31's Files list (tri_state.rs, permission_list.rs, guild/roles.rs, app.rs).** No change. These are small additions that the channel tab needs: `view_any`, the faded disabled icons, `search_with_id` and the `pub(crate)` visibility. The tasks that own those files are merged and every existing golden still passes, so reverting the edits would only mean duplicating the code. - **Minor: "Searching..." in place of "No matches" while the server search is pending (add_override.rs).** No change. The plan's interface for Task 31 asks for this state, and the PR description already notes that it differs from the original. No new commit this round.
Author
Owner

Independent review (round 2): Server admin 31, Channel Permissions tab (#699)

Head reviewed: 451bbb2c (the task's own commits 9eee9a48 and 1e339704; the merge only brings in origin/serveradmin 4d543549, which is still the tip of serveradmin).

Gate

  • FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci in a fresh review worktree: ffmpeg, fmt and clippy pass; deny FAILS on RUSTSEC-2026-0543 (chrono) and RUSTSEC-2026-0545..0548 (zip 8.6.0 via velopack). This PR does not touch Cargo.lock or deny.toml. #773 is still open.
  • By hand, with the same environment: cargo test -p fluxer-ui --test channel_permissions passes (8/8). cargo test -p fluxer-ui --test screenshots -- --ignored channel_ passes (22/22), including the six new goldens.

Checks

  1. Plan tests: all eight named tests exist and assert what the plan describes. All six goldens are in screenshots.rs, with images in fixtures/golden/ and docs/screenshots/.
  2. Interfaces: channel/{permissions.rs,add_override.rs} exist and channel/mod.rs is extended. view/update/escape still exist and delegate to *_with, so Tasks 29 and 30 still build and pass.
  3. Invariants: fluxer-core is untouched and fluxer-ui gains no I/O (avatars go through user_avatar). The goldens' CHANNEL_UPDATE overrides have the ChannelOverwriteResponse shape ({id,type,allow,deny}, decimal strings). No secrets.
  4. Parity, checked against the fork:
    • ChannelPermissionsTab.getPermissionDisabledReason: the core applies the same order (MANAGE_CHANNELS, then MANAGE_ROLES, then the owner exemption, then cannot-grant against the channel's computed perms, then would-remove-own against the saved overrides), and all four strings match the fork's text exactly.
    • canManageChannels and canManageRoles are guild-wide in the fork (Permission.can(..., {guildId})), and the core uses guild_permissions too.
    • SyncWithParentBanner.tsx: both sentences match, the name is bold, the button shows only when not synced and is disabled without both permissions.
    • AddOverridePopout.tsx: roles are sorted by position (descending), and "Members" and "No matches" match.
  5. Review Focus (overrides):
    • A non-owner cannot grant what they lack. The UI drops Set for a disabled row, and the core set() checks overwrite_switch_with again for every bit, so neither Set nor SetAll gets past it.
    • A non-owner cannot remove their own permission. This is would_remove_own_channel_permission, which is wouldRemoveOwnPermission line for line.
    • The PATCH. save() sends the whole draft and leaves out an @everyone whose allow and deny are both 0.
    • Nothing is sent before Save changes. Every UI message changes only the draft. The only exceptions are the popout's debounced member search, which is a read, and "Sync with category", which PATCHes at once as the fork's handleSyncWithParent does.

The moderator-view claim

I recomputed the scenario from serveradmin_moderator_ready.json. The moderator has @everyone plus Moderators: 446676978752 | 2253364151184471. Among the channel permissions, that lacks bit 52 BYPASS_SLOWMODE, bit 54 VIEW_CHANNEL_MEMBERS and bit 36 CREATE_PRIVATE_THREADS. #general has no saved overrides. The fork therefore disables exactly those rows with "You can't grant a permission you don't have in this channel.". No row qualifies for "would remove it from you", because wouldRemoveOwnPermission returns false when there is no saved override that allows the bit. The golden channel_permissions_moderator_disabled shows Bypass slowmode and Create private threads disabled and every other row enabled, which matches. Verdict: no bug. The behaviour is correct, and if a discrepancy were ever found it would belong to Task 17 (core overwrites/perm_spec; the disabled-reason rules come from Task 10), not to Task 31.

Findings

  • [blocking, gate only, not caused by this PR] cargo deny is red on Cargo.lock advisories (#773). The PR cannot be merged until #773 lands, origin/serveradmin is merged in again and the full gate passes. No code change is needed here.
  • [minor, Task 17, tracked in #774] Core SetAll also skips WouldRemoveYourOwn bits, while the fork's handleSetAllPermissions skips only the bits the user lacks. The core is stricter, and the server refuses the fork's case anyway.
  • [minor] Small edits outside the Files list (tri_state.rs view_any plus faded disabled icons, permission_list.rs search_with_id, guild/roles.rs pub(crate), app.rs). Their owner tasks are merged and every existing golden still passes. Recorded only.
  • [minor] "Searching..." is shown while the server member search is pending. The plan's interface asks for it, the fork shows "No matches" there instead, and the PR states the deviation.

Verdict: the code is correct and matches the original. Not approved, only because the gate is red on cargo deny (#773, upstream). Re-run FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci after #773 is merged into serveradmin and then into this branch.

## Independent review (round 2): Server admin 31, Channel Permissions tab (#699) Head reviewed: 451bbb2c (the task's own commits 9eee9a48 and 1e339704; the merge only brings in origin/serveradmin 4d543549, which is still the tip of serveradmin). ### Gate - `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` in a fresh review worktree: ffmpeg, fmt and clippy **pass**; **deny FAILS** on RUSTSEC-2026-0543 (chrono) and RUSTSEC-2026-0545..0548 (zip 8.6.0 via velopack). This PR does not touch Cargo.lock or deny.toml. #773 is still open. - By hand, with the same environment: `cargo test -p fluxer-ui --test channel_permissions` passes (8/8). `cargo test -p fluxer-ui --test screenshots -- --ignored channel_` passes (22/22), including the six new goldens. ### Checks 1. **Plan tests**: all eight named tests exist and assert what the plan describes. All six goldens are in `screenshots.rs`, with images in `fixtures/golden/` and `docs/screenshots/`. 2. **Interfaces**: `channel/{permissions.rs,add_override.rs}` exist and `channel/mod.rs` is extended. `view`/`update`/`escape` still exist and delegate to `*_with`, so Tasks 29 and 30 still build and pass. 3. **Invariants**: fluxer-core is untouched and fluxer-ui gains no I/O (avatars go through `user_avatar`). The goldens' `CHANNEL_UPDATE` overrides have the `ChannelOverwriteResponse` shape (`{id,type,allow,deny}`, decimal strings). No secrets. 4. **Parity, checked against the fork**: - `ChannelPermissionsTab.getPermissionDisabledReason`: the core applies the same order (MANAGE_CHANNELS, then MANAGE_ROLES, then the owner exemption, then cannot-grant against the channel's computed perms, then would-remove-own against the *saved* overrides), and all four strings match the fork's text exactly. - `canManageChannels` and `canManageRoles` are guild-wide in the fork (`Permission.can(..., {guildId})`), and the core uses `guild_permissions` too. - `SyncWithParentBanner.tsx`: both sentences match, the name is bold, the button shows only when not synced and is disabled without both permissions. - `AddOverridePopout.tsx`: roles are sorted by position (descending), and "Members" and "No matches" match. 5. **Review Focus (overrides)**: - **A non-owner cannot grant what they lack.** The UI drops `Set` for a disabled row, and the core `set()` checks `overwrite_switch_with` again for every bit, so neither Set nor SetAll gets past it. - **A non-owner cannot remove their own permission.** This is `would_remove_own_channel_permission`, which is `wouldRemoveOwnPermission` line for line. - **The PATCH.** `save()` sends the whole draft and leaves out an @everyone whose allow and deny are both 0. - **Nothing is sent before Save changes.** Every UI message changes only the draft. The only exceptions are the popout's debounced member search, which is a read, and "Sync with category", which PATCHes at once as the fork's `handleSyncWithParent` does. ### The moderator-view claim I recomputed the scenario from `serveradmin_moderator_ready.json`. The moderator has @everyone plus Moderators: 446676978752 | 2253364151184471. Among the channel permissions, that lacks bit 52 BYPASS_SLOWMODE, bit 54 VIEW_CHANNEL_MEMBERS and bit 36 CREATE_PRIVATE_THREADS. #general has no saved overrides. The fork therefore disables exactly those rows with "You can't grant a permission you don't have in this channel.". No row qualifies for "would remove it from you", because `wouldRemoveOwnPermission` returns false when there is no saved override that allows the bit. The golden `channel_permissions_moderator_disabled` shows Bypass slowmode and Create private threads disabled and every other row enabled, which matches. **Verdict: no bug.** The behaviour is correct, and if a discrepancy were ever found it would belong to Task 17 (core `overwrites`/`perm_spec`; the disabled-reason rules come from Task 10), not to Task 31. ### Findings - **[blocking, gate only, not caused by this PR]** `cargo deny` is red on Cargo.lock advisories (#773). The PR cannot be merged until #773 lands, origin/serveradmin is merged in again and the full gate passes. No code change is needed here. - **[minor, Task 17, tracked in #774]** Core `SetAll` also skips `WouldRemoveYourOwn` bits, while the fork's `handleSetAllPermissions` skips only the bits the user lacks. The core is stricter, and the server refuses the fork's case anyway. - **[minor]** Small edits outside the Files list (`tri_state.rs` `view_any` plus faded disabled icons, `permission_list.rs` `search_with_id`, `guild/roles.rs` `pub(crate)`, `app.rs`). Their owner tasks are merged and every existing golden still passes. Recorded only. - **[minor]** "Searching..." is shown while the server member search is pending. The plan's interface asks for it, the fork shows "No matches" there instead, and the PR states the deviation. **Verdict: the code is correct and matches the original. Not approved, only because the gate is red on `cargo deny` (#773, upstream). Re-run `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci` after #773 is merged into serveradmin and then into this branch.**
Author
Owner

Round 2 review, per finding:

  • Blocking (Cargo.lock / cargo deny): not addressed here, by design. #773 is still open and origin/serveradmin (4d543549) still has no fix; this branch already contains it (451bbb2c). Re-checked today: cargo deny check advisories still fails on RUSTSEC-2026-0543 and RUSTSEC-2026-0545 to 0548. Once #773 lands, merge origin/serveradmin into this branch and re-run the gate. No code change.
  • Minor (core SetAll skips WouldRemoveYourOwn bits): owned by Task 17, already tracked in #774. No change in this PR.
  • Minor (small edits outside the Files list): recorded only, no change.
  • Minor ("Searching..." in the add-override popout): matches the plan interface and is stated in the PR description. No change.
Round 2 review, per finding: - Blocking (Cargo.lock / cargo deny): not addressed here, by design. #773 is still open and origin/serveradmin (4d543549) still has no fix; this branch already contains it (451bbb2c). Re-checked today: `cargo deny check advisories` still fails on RUSTSEC-2026-0543 and RUSTSEC-2026-0545 to 0548. Once #773 lands, merge origin/serveradmin into this branch and re-run the gate. No code change. - Minor (core SetAll skips WouldRemoveYourOwn bits): owned by Task 17, already tracked in #774. No change in this PR. - Minor (small edits outside the Files list): recorded only, no change. - Minor ("Searching..." in the add-override popout): matches the plan interface and is stated in the PR description. No change.
Author
Owner

Independent review (round 3): Server admin 31, Channel Permissions tab (#699)

Head reviewed: 451bbb2c. The task's own commits are 9eee9a48 and 1e339704. The merge brings in only origin/serveradmin 4d543549, which is still the tip of serveradmin. I read the code cold, in a fresh review worktree.

Gate

  • I ran FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci. It is RED at deny: advisories FAILED on RUSTSEC-2026-0543 (chrono, unmaintained) and RUSTSEC-2026-0545 to 0548 (zip). Bans, licenses and sources are ok. This PR does not touch Cargo.lock or deny.toml, and #773 (the issue that tracks this) is still open.
  • I also ran these by hand with the same environment: cargo test -p fluxer-ui --test channel_permissions passes 8/8, and cargo test -p fluxer-ui --test screenshots -- --ignored channel_permissions passes 6/6 (all six new goldens).

Checks

  1. Plan tests. All eight tests named in the plan exist and assert what it describes. Examples: disabled_reason_tooltip checks a CannotGrantWhatYouLack row for a tooltip, no clicks and no Set sent. view_only_disables_controls checks that Set, SetAll, OpenAdd and Sync send nothing, while search and select still work. All six goldens are in screenshots.rs, with images in fixtures/golden/ and docs/screenshots/.
  2. Interfaces. channel/{permissions.rs,add_override.rs} exist and channel/mod.rs is extended. view/update/escape remain and delegate to the *_with versions, so Tasks 29 and 30 are unaffected.
  3. Invariants. fluxer-core is untouched. fluxer-ui gains no I/O path: avatars go through the media loader. The goldens' CHANNEL_UPDATE overrides use the ChannelOverwriteResponse shape ({id,type,allow,deny}, decimal strings). The diff has no secrets.
  4. Parity, spot-checked against the fork.
    • ChannelPermissionsTab.getPermissionDisabledReason checks MANAGE_CHANNELS, then MANAGE_ROLES (both guild-wide), then the owner, then can't-grant against the channel's computed perms, then would-remove-own. The core overwrite_disabled_reason uses the same order.
    • wouldRemoveOwnPermission reads the saved override and needs an allow on it. The core does the same.
    • These strings match the fork: "Use these buttons to quickly set all permissions." (PermissionEditorPanel), "Couldn't update channel permissions" (ChannelPermissionsUpdateFailedModal), "Search roles or members…" and "No matches" (AddOverridePopout), "Access overrides" (ChannelPermissionsSidebar), "Back to overrides" (DesktopChannelSettingsView).
  5. Review Focus (overrides).
    • A non-owner cannot grant what they lack or remove their own permission. The UI forwards Set only when the row is enabled, and forwards SetAll only with can_edit && set_all_enabled. The core checks every bit again through overwrite_switch_with.
    • The PATCH. The core save sends the whole draft and leaves out a 0/0 @everyone (overwrites.rs:1241).
    • Nothing is sent before Save changes. Every UI message becomes an OverwriteAction draft edit. The only exceptions are the popout's member search, which is a read, and "Sync with category", which saves at once, as the fork's handleSyncWithParent and spec §3.7 require.

Extra check: the moderator-view claim

I recomputed this from serveradmin_moderator_ready.json. The moderator holds @everyone | Moderators = 446676978752 | 2253364151184471, and is not the owner. Among #general's channel permissions that leaves out bit 36 CREATE_PRIVATE_THREADS, bit 52 BYPASS_SLOWMODE and bit 54 VIEW_CHANNEL_MEMBERS. withImplicitThreadBits only adds bits for ADMINISTRATOR, which the moderator does not have. #general has no saved overrides, so wouldRemoveOwnPermission is false for every row.

The fork therefore disables exactly those three rows, each with "You can't grant a permission you don't have in this channel.". The golden shows Bypass slowmode and Create private threads disabled, and every other row in view enabled. Verdict: no bug. The behaviour is correct for this data. A real mismatch in the disabled reasons would belong to Task 10 (perm_spec::overwrite_switch and its DisabledReasons), which Task 17 consumes, and not to Task 31.

Findings

  • [blocking, gate only, not caused by this PR] cargo xtask ci is red at cargo deny (RUSTSEC-2026-0543, 0545 to 0548). Fix #773, merge origin/serveradmin into this branch, then rerun the gate. This PR needs no code change.
  • [minor] In the add-override popout, "Searching..." replaces "No matches" while the server search is pending. The original shows "No matches". The plan's interface asks for this state, and the PR description records it.
  • [minor] There are small edits outside the Files list: widgets/tri_state.rs (view_any, faded disabled icons), permission_list.rs (search_with_id), guild/roles.rs (pub(crate)) and app.rs. They are additive and the existing goldens still pass.
  • [minor, Task 17, tracked in #774] The core SetAll is stricter than the fork's handleSetAllPermissions. Nothing to change in this PR.

Verdict: not approved, only because the gate is red (cargo deny, #773). The Task 31 code itself has no blocking finding. Once #773 is merged into serveradmin and this branch, it can be approved with a green gate.

## Independent review (round 3): Server admin 31, Channel Permissions tab (#699) Head reviewed: 451bbb2c. The task's own commits are 9eee9a48 and 1e339704. The merge brings in only origin/serveradmin 4d543549, which is still the tip of serveradmin. I read the code cold, in a fresh review worktree. ### Gate - I ran `FLUXER_SCREENSHOT_TESTS=1 cargo xtask ci`. It is **RED at `deny`**: advisories FAILED on RUSTSEC-2026-0543 (chrono, unmaintained) and RUSTSEC-2026-0545 to 0548 (zip). Bans, licenses and sources are ok. This PR does not touch Cargo.lock or deny.toml, and #773 (the issue that tracks this) is still open. - I also ran these by hand with the same environment: `cargo test -p fluxer-ui --test channel_permissions` passes 8/8, and `cargo test -p fluxer-ui --test screenshots -- --ignored channel_permissions` passes 6/6 (all six new goldens). ### Checks 1. **Plan tests.** All eight tests named in the plan exist and assert what it describes. Examples: `disabled_reason_tooltip` checks a `CannotGrantWhatYouLack` row for a tooltip, no clicks and no `Set` sent. `view_only_disables_controls` checks that Set, SetAll, OpenAdd and Sync send nothing, while search and select still work. All six goldens are in `screenshots.rs`, with images in `fixtures/golden/` and `docs/screenshots/`. 2. **Interfaces.** `channel/{permissions.rs,add_override.rs}` exist and `channel/mod.rs` is extended. `view`/`update`/`escape` remain and delegate to the `*_with` versions, so Tasks 29 and 30 are unaffected. 3. **Invariants.** fluxer-core is untouched. fluxer-ui gains no I/O path: avatars go through the media loader. The goldens' `CHANNEL_UPDATE` overrides use the `ChannelOverwriteResponse` shape (`{id,type,allow,deny}`, decimal strings). The diff has no secrets. 4. **Parity, spot-checked against the fork.** - `ChannelPermissionsTab.getPermissionDisabledReason` checks MANAGE_CHANNELS, then MANAGE_ROLES (both guild-wide), then the owner, then can't-grant against the channel's computed perms, then would-remove-own. The core `overwrite_disabled_reason` uses the same order. - `wouldRemoveOwnPermission` reads the *saved* override and needs an allow on it. The core does the same. - These strings match the fork: "Use these buttons to quickly set all permissions." (PermissionEditorPanel), "Couldn't update channel permissions" (ChannelPermissionsUpdateFailedModal), "Search roles or members…" and "No matches" (AddOverridePopout), "Access overrides" (ChannelPermissionsSidebar), "Back to overrides" (DesktopChannelSettingsView). 5. **Review Focus (overrides).** - **A non-owner cannot grant what they lack or remove their own permission.** The UI forwards `Set` only when the row is enabled, and forwards `SetAll` only with `can_edit && set_all_enabled`. The core checks every bit again through `overwrite_switch_with`. - **The PATCH.** The core `save` sends the whole draft and leaves out a 0/0 @everyone (overwrites.rs:1241). - **Nothing is sent before Save changes.** Every UI message becomes an `OverwriteAction` draft edit. The only exceptions are the popout's member search, which is a read, and "Sync with category", which saves at once, as the fork's `handleSyncWithParent` and spec §3.7 require. ### Extra check: the moderator-view claim I recomputed this from `serveradmin_moderator_ready.json`. The moderator holds @everyone | Moderators = 446676978752 | 2253364151184471, and is not the owner. Among #general's channel permissions that leaves out bit 36 CREATE_PRIVATE_THREADS, bit 52 BYPASS_SLOWMODE and bit 54 VIEW_CHANNEL_MEMBERS. `withImplicitThreadBits` only adds bits for ADMINISTRATOR, which the moderator does not have. #general has no saved overrides, so `wouldRemoveOwnPermission` is false for every row. The fork therefore disables exactly those three rows, each with "You can't grant a permission you don't have in this channel.". The golden shows Bypass slowmode and Create private threads disabled, and every other row in view enabled. **Verdict: no bug. The behaviour is correct for this data.** A real mismatch in the disabled reasons would belong to **Task 10** (`perm_spec::overwrite_switch` and its `DisabledReason`s), which Task 17 consumes, and not to Task 31. ### Findings - **[blocking, gate only, not caused by this PR]** `cargo xtask ci` is red at `cargo deny` (RUSTSEC-2026-0543, 0545 to 0548). Fix #773, merge origin/serveradmin into this branch, then rerun the gate. This PR needs no code change. - **[minor]** In the add-override popout, "Searching..." replaces "No matches" while the server search is pending. The original shows "No matches". The plan's interface asks for this state, and the PR description records it. - **[minor]** There are small edits outside the Files list: `widgets/tri_state.rs` (`view_any`, faded disabled icons), `permission_list.rs` (`search_with_id`), `guild/roles.rs` (`pub(crate)`) and `app.rs`. They are additive and the existing goldens still pass. - **[minor, Task 17, tracked in #774]** The core `SetAll` is stricter than the fork's `handleSetAllPermissions`. Nothing to change in this PR. **Verdict: not approved, only because the gate is red (cargo deny, #773). The Task 31 code itself has no blocking finding.** Once #773 is merged into serveradmin and this branch, it can be approved with a green gate.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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-17 19:33:19 +00:00

Pull request closed

Sign in to join this conversation.
No description provided.