Server admin 9b: fluxer-core hierarchy, tabs, moderation capabilities; bulk events in the store #676

Closed
opened 2026-11-15 19:01:11 +00:00 by charles · 0 comments
Owner

Task 9b of the Server administration plan (docs/superpowers/plans/2026-11-15-serveradmin.md, section "### Task 9b:"). The plan on the serveradmin branch is the source of truth; this copy is for reading.

Closes: —
Depends on: 9a

Touches the store's guild and channel reducers as well as admin::perms (same crate).

Files:

  • Modify: crates/fluxer-core/src/admin/perms.rs, crates/fluxer-core/src/{guilds.rs,channels.rs} (apply GUILD_ROLE_UPDATE_BULK, CHANNEL_UPDATE_BULK, the new guild fields from GUILD_UPDATE; expose what perms needs)
  • Test: crates/fluxer-core/tests/admin_perms.rs

Interfaces:

  • Produces, exactly as spec §3.4 and §3.5 (feat/permissions/utils/PermissionUtils.ts, feat/permissions/hooks/useRoleHierarchy.ts, feat/guild/utils/GuildModerationCapabilityUtils.ts, GT/GuildRolesTab.tsx): perms::highest_role(app, guild, user) -> Option<&Role>, is_role_higher(a, b) (position, then lower id), can_manage_role(app, guild, role), can_manage_target(app, guild, user), is_role_locked(app, guild, role), moderation_caps(app, guild, user) -> ModerationCaps { nickname, roles, timeout: TimeoutCap::{No, Timeout, Remove}, kick, ban, transfer }, settings_tabs(app, guild) -> Vec<GuildTab> (Overview, Roles, Moderation, Invites, Bans — and Members as a link row — by spec §3.2's gates, in its order and groups), can_delete_guild, channel_tabs(app, channel) -> Vec<ChannelTab> (by type and permission), can_manage_channels(app, guild), threads_active(app, guild) (the same test Text chat uses; feat/threads/state/ThreadGuilds.ts).

  • The store applies GUILD_ROLE_UPDATE_BULK (replace each listed role) and CHANNEL_UPDATE_BULK (replace each listed channel) — a reorder made in another client is visible without a restart.

  • Step 1: Write failing tests: table role_hierarchy (owner, administrator, moderator, member × role above, equal position with lower and with higher id, below, @everyone), table target_hierarchy (self, owner, bot, higher, equal, lower, administrator, target not cached), table moderation_caps_by_permission, table settings_tabs_by_permission (each single permission, none, owner), channel_tabs_by_type_and_permission, timed_out_user_cannot_change_own_nickname, role_bulk_event_reorders_roles, channel_bulk_event_moves_channels, guild_update_carries_new_fields.

  • Step 2–5: FAIL → implement → PASS → commit feat(core): role hierarchy, settings tabs, bulk events.

Task 9b of the Server administration plan (`docs/superpowers/plans/2026-11-15-serveradmin.md`, section "### Task 9b:"). The plan on the `serveradmin` branch is the source of truth; this copy is for reading. **Closes:** — **Depends on:** 9a Touches the store's guild and channel reducers as well as `admin::perms` (same crate). **Files:** - Modify: `crates/fluxer-core/src/admin/perms.rs`, `crates/fluxer-core/src/{guilds.rs,channels.rs}` (apply `GUILD_ROLE_UPDATE_BULK`, `CHANNEL_UPDATE_BULK`, the new guild fields from `GUILD_UPDATE`; expose what `perms` needs) - Test: `crates/fluxer-core/tests/admin_perms.rs` **Interfaces:** - Produces, exactly as spec §3.4 and §3.5 (`feat/permissions/utils/PermissionUtils.ts`, `feat/permissions/hooks/useRoleHierarchy.ts`, `feat/guild/utils/GuildModerationCapabilityUtils.ts`, `GT/GuildRolesTab.tsx`): `perms::highest_role(app, guild, user) -> Option<&Role>`, `is_role_higher(a, b)` (position, then lower id), `can_manage_role(app, guild, role)`, `can_manage_target(app, guild, user)`, `is_role_locked(app, guild, role)`, `moderation_caps(app, guild, user) -> ModerationCaps { nickname, roles, timeout: TimeoutCap::{No, Timeout, Remove}, kick, ban, transfer }`, `settings_tabs(app, guild) -> Vec<GuildTab>` (Overview, Roles, Moderation, Invites, Bans — and `Members` as a link row — by spec §3.2's gates, in its order and groups), `can_delete_guild`, `channel_tabs(app, channel) -> Vec<ChannelTab>` (by type and permission), `can_manage_channels(app, guild)`, `threads_active(app, guild)` (the same test Text chat uses; `feat/threads/state/ThreadGuilds.ts`). - The store applies `GUILD_ROLE_UPDATE_BULK` (replace each listed role) and `CHANNEL_UPDATE_BULK` (replace each listed channel) — a reorder made in another client is visible without a restart. - [ ] **Step 1: Write failing tests**: table `role_hierarchy` (owner, administrator, moderator, member × role above, equal position with lower and with higher id, below, @everyone), table `target_hierarchy` (self, owner, bot, higher, equal, lower, administrator, target not cached), table `moderation_caps_by_permission`, table `settings_tabs_by_permission` (each single permission, none, owner), `channel_tabs_by_type_and_permission`, `timed_out_user_cannot_change_own_nickname`, `role_bulk_event_reorders_roles`, `channel_bulk_event_moves_channels`, `guild_update_carries_new_fields`. - [ ] **Step 2–5:** FAIL → implement → PASS → commit `feat(core): role hierarchy, settings tabs, bulk events`.
Sign in to join this conversation.
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
charles/fluxer-native#676
No description provided.