Server admin 12: fluxer-core roles: list, create, edit, permissions, reorder, duplicate, delete (#679) #737
Closed
charles
wants to merge 0 commits from
serveradmin-12-core-roles into serveradmin
pull from: serveradmin-12-core-roles
merge into: charles:serveradmin
charles:main
charles:camera
charles:dailyuse
charles:textchat
charles:fix-1008-idle-in-voice
charles:camera-21-acceptance
charles:feat-1000-app-sounds-output
charles:fix-1001-local-time
charles:camera-20-parity-list-for-the
charles:fix-931-silent-voices
charles:camera-15-ui-settings-voice-video
charles:camera-14-ui-camera-buttons-camera
charles:camera-16-ui-layout-with-cameras
charles:camera-17-core-toggle-camera-shortcut
charles:camera-13-ui-mirrored-video-and
charles:camera-12-appsfluxer-camera-runtime-and
charles:camera-10-capture-camera-on-linux
charles:camera-11-capture-camera-on-windows
charles:camera-9-voice-the-camera-track
charles:camera-7-core-the-own-camera
charles:camera-6-capture-camera-trait-mode
charles:camera-8-core-remote-cameras-tile
charles:camera-3-spike-a-camera-track
charles:camera-4-video-camera-formats-and
charles:camera-18-devserver-camera-scenario
charles:camera-1-spike-capture-linux
charles:camera-5-core-camera-ports-commands
charles:camera-2-spike-capture-windows
charles:camera-plan
charles:shell
charles:fix-925-keybinds-persist
charles:feat-934-935-stream-view
charles:feat-933-stream-output-device
charles:shell-44-acceptance
charles:feat-946-select-message-text
charles:shell-43-parity-list-for-the
charles:fix-589-black-band-linux-sender
charles:shell-37-ui-system-wide-shortcuts
charles:shell-ship
charles:fix-931-voices-silent-after-long-uptime
charles:shell-39-ui-settings-notifications
charles:shell-36-ui-settings-keybinds
charles:shell-16-core-autostart
charles:fix-923-late-publication-next-share
charles:fix-921-share-teardown-publish-race
charles:shell-1-spike-iced-daemon-hide
charles:shell-10-core-instance-messages-tasks
charles:shell-11-core-keybinds-actions-combos
charles:shell-13-core-badge-attention-sound
charles:shell-14-core-notification-settings-inactive
charles:shell-18-platform-desktop-entry-and
charles:shell-2-spike-tray-on-linux
charles:shell-3-spike-wayland-global-shortcuts
charles:shell-41-devserver-shell-scenario
charles:shell-5-spike-overlay-technique-for
charles:shell-6-core-shell-ports-settings
charles:shell-7-platform-settings-shell-keybinds
charles:shell-8-core-tray-model-and
charles:shell-9-core-window-rules-close
charles:fix-913-keep-awake-retry
charles:shell-35-ui-in-window-voice
charles:shell-sync-textchat
charles:shell-34-app-shortcuts-runtime
charles:fix-913-keep-screen-awake
charles:fix-910-deepfilter-windows-timing
charles:shell-33-app-shell-runtime
charles:shell-28-platform-shortcuts-on-wayland
charles:fix-910-deepfilter-late-frame
charles:shell-29-platform-shortcuts-by-direct
charles:shell-27-platform-shortcuts-on-x11
charles:shell-17-platform-single-instance
charles:shell-24-platform-badge-displays-and-24
charles:shell-26-platform-shortcuts-on-windows
charles:shell-21-platform-tray-on-linux
charles:shell-22-platform-tray-on-windows
charles:fix-908-flaky-stream-end-test
charles:shell-30-platform-wayland-activation
charles:shell-38-ui-settings-desktop
charles:shell-19-platform-autostart
charles:shell-25-platform-shortcut-back-end
charles:shell-23-platform-badge-displays-and
charles:shell-40-ui-companion-apps-control
charles:shell-31-statusapi-default-avatars
charles:shell-12-core-system-wide-shortcut
charles:shell-20-platform-tray-trait-icons
charles:shell-32-ui-daemon-window-lifecycle
charles:shell-4-spike-raising-a-wayland
charles:shell-15-core-status-payload-gaps
charles:fix-876-share-resolution-and-bars
charles:shell-42-packaging-windows-shortcuts-and
charles:fix-874-tests-must-not-notify
charles:fix-868-deepfilternet-start
charles:gamenight-plan
charles:fix-867-869-stream-end-soundboard-limits
charles:feat-229-windows-hardware-encoding
charles:fix-857-vaapi-hardware-encoding
charles:fix-849-inert-cards
charles:fix-848-pinned-messages-clickable
charles:shell-plan
charles:fix-764-nvenc-above-720p30
charles:serveradmin
charles:feat-780-forum-archived-filter
charles:serveradmin-35-acceptance
charles:feat-781-no-join-chime-with-entrance-sound
charles:feat-784-rejoin-voice-after-update
charles:fix-779-782-search-dropdown-paste-preview
charles:fix-783-781-dm-rail-entrance-sound
charles:serveradmin-34-parity-screenshots
charles:serveradmin-31-ui-channel-permissions
charles:fix-773-cargo-deny-advisories
charles:serveradmin-33-ui-sudo-delete-transfer
charles:serveradmin-28-ui-members-page
charles:serveradmin-26-ui-role-permissions
charles:serveradmin-30-ui-voice-overview-channel-invites
charles:serveradmin-fix-27-29
charles:serveradmin-25-ui-roles-tab
charles:serveradmin-27-ui-menus-moderation-modals
charles:serveradmin-29-ui-channel-settings
charles:fix-589-stream-top-strip-encode
charles:serveradmin-24-ui-moderation-invites-bans
charles:feat-760-version-in-title
charles:fix-751-stream-audio-pipewire
charles:serveradmin-20-core-menu-rows
charles:fix-752-linux-notification-panic
charles:serveradmin-17-core-overrides
charles:fix-740-updater-always-latest
charles:serveradmin-23-ui-community-settings-overview
charles:serveradmin-19-core-sudo-delete-transfer
charles:serveradmin-32-ui-sidebar-drag
charles:serveradmin-15-core-members-page
charles:serveradmin-16-core-channel-settings
charles:serveradmin-14-core-bans-invites
charles:fix-615-restore-on-stored-session-start
charles:serveradmin-22-runtime
charles:serveradmin-13-core-member-moderation
charles:serveradmin-18-core-channel-reorder
charles:fix-732-status-api-speaking
charles:serveradmin-10-core-permission-lists
charles:serveradmin-11-core-forms-community
charles:serveradmin-21b-devserver-channels-members-sudo
charles:serveradmin-4-api-community-roles-sudo
charles:serveradmin-9b-core-hierarchy-bulk-events
charles:serveradmin-21a-devserver-community-roles
charles:serveradmin-9a-core-ports
charles:serveradmin-8-form-widgets
charles:serveradmin-5-api-channels-members-bans
charles:serveradmin-7-settings-shell
charles:serveradmin-1-proto-community-roles
charles:serveradmin-3-proto-members-bans-invites
charles:serveradmin-6-reorder-widget
charles:serveradmin-2-proto-channel-admin
charles:fix-706-presence-after-reconnect
charles:fix-615-start-on-last-view
charles:feat-663-create-channel
charles:serveradmin-plan
charles:fix-662-long-text-wrap
charles:fix-660-661-menu-toolbar-paste-focus
charles:fix-620-forum-list-reactions
charles:fix-657-windows-console
charles:fix-622-emoji-in-names
charles:fix-smoke-645-648
charles:fix-614-install-location
charles:dailyuse-41-acceptance
charles:fix/597-copy-id
charles:dailyuse-40-parity-screenshots
charles:dailyuse-35-ui-quick-switcher-keybinds
charles:dailyuse-38-ui-profile-modal
charles:fix/voice-view
charles:fix/side-panel-composer
charles:dailyuse-37b-ui-composer-barriers-blocked
charles:fix/image-viewer
charles:fix/619-picker-flicker
charles:fix/editor-forum-edit
charles:dailyuse-32-ui-status-picker
charles:dailyuse-34b-ui-add-guild-invite-modal
charles:dailyuse-28-app-dailyuse-runtime
charles:dailyuse-36-ui-voice-badge-refusals
charles:fix/594-menu-placement-textchat
charles:fix/589-stream-top-strip
charles:fix/594-menu-placement
charles:dailyuse-39-ui-report-modal
charles:dailyuse-37a-ui-attachment-audio-group-icon
charles:dailyuse-24-core-notification-icon-passive
charles:fix/587-quiet-voice
charles:dailyuse-30-ui-notification-settings-modal
charles:dailyuse-31-ui-user-dm-menus
charles:dailyuse-22b-core-composer-barriers-blocked
charles:dailyuse-22a-core-mark-unread-attachments
charles:dailyuse-29-ui-channel-guild-menus
charles:dailyuse-18-core-user-dm-menus
charles:dailyuse-33-ui-confirm-friends-page
charles:dailyuse-22c-core-trusted-domains-hide-muted
charles:dailyuse-20-core-keyboard-navigation
charles:dailyuse-15-core-friends-blocking
charles:dailyuse-23-core-profile-report-flow
charles:dailyuse-19-core-quick-switcher
charles:dailyuse-14-core-status-idle-presence
charles:dailyuse-17-core-channel-guild-menus
charles:ci/27-linux-cache
charles:dailyuse-37c-ui-trust-links-hide-muted
charles:dailyuse-13-core-honour-mutes
charles:dailyuse-34a-ui-invite-cards-accept
charles:dailyuse-16b-core-create-invites-guilds
charles:dailyuse-12-core-notification-settings-mutes
charles:dailyuse-16a-core-invite-links
charles:dailyuse-25-audio-attachments
charles:dailyuse-21-core-voice-refusals
charles:dailyuse-11b-core-state-skeleton
charles:dailyuse-11a-core-dailyuse-ports
charles:dailyuse-26b-devserver-dailyuse-b
charles:dailyuse-26a-devserver-dailyuse-a
charles:dailyuse-4-api-settings-acks-reports
charles:dailyuse-5-api-relationships-invites-guilds
charles:dailyuse-27-platform-notification-idle
charles:dailyuse-10-highlight-languages
charles:fix-search-focus-hover-emoji
charles:dailyuse-8-context-menu-widget
charles:dailyuse-9-image-load-retry
charles:dailyuse-7-chat-navigation-persistence
charles:dailyuse-2-proto-relationships-invites-reports
charles:dailyuse-1-proto-notification-presence
charles:dailyuse-6-gateway-op12-presence
charles:textchat-next
charles:fix-stream-black
charles:fix-reactions-hover
charles:textchat-68-app-video-playback-runtime
charles:textchat-35-acceptance
charles:textchat-34-parity-screenshots
charles:textchat-74-app-updater-runtime
charles:textchat-67-ui-video-player
charles:textchat-stage-46-47
charles:textchat-47-ui-media-channel
charles:textchat-75-promote-stable-workflow
charles:textchat-46-ui-forum-composer
charles:textchat-73-ui-update-button
charles:textchat-64-media-playback-crate
charles:textchat-stage-43-48
charles:textchat-72-platform-updater
charles:textchat-44-ui-thread-view
charles:textchat-70-release-update-feed
charles:textchat-48-ui-announcements
charles:textchat-45-ui-forum-view
charles:textchat-71-core-updater
charles:textchat-43-ui-sidebar-links-notes
charles:textchat-stage-40
charles:textchat-42-app-channel-types-runtime
charles:textchat-39-core-forums
charles:textchat-40-core-announcements-thread-admin
charles:textchat-60-ui-entrance-sounds
charles:textchat-63-ffmpeg-lgpl-packaging
charles:textchat-stage-batch6
charles:textchat-69-proto-update-manifest
charles:textchat-61-app-soundboard-entrance-runtime
charles:textchat-52-app-audio-devices-runtime
charles:textchat-38-core-channel-routing
charles:soundboard-effect-emoji
charles:status-api-rebind
charles:textchat-28-ui-gif-picker
charles:textchat-41-devserver-channel-types
charles:voice-panel-soundboard
charles:textchat-29-ui-message-actions
charles:textchat-37-api-channel-types
charles:textchat-66-core-video-players
charles:autoupdate-plan
charles:textchat-33-ui-message-list-settings
charles:textchat-32-ui-dms
charles:textchat-62-rename-flaxative
charles:fix-chatcolumn-tree
charles:textchat-65-audio-media-source
charles:textchat-31-ui-threads
charles:textchat-stage-27
charles:textchat-30-ui-search-pins-inbox
charles:textchat-53-ui-audio-sources-menu
charles:textchat-27-ui-expression-picker
charles:textchat-57-core-entrance-library
charles:textchat-36-proto-channel-types
charles:textchat-26-ui-upload-tray
charles:textchat-59-ui-soundboard-popout-parity
charles:textchat-58-audio-sound-edit
charles:textchat-55-proto-api-entrance-library
charles:textchat-25-ui-composer
charles:textchat-56-core-soundboard-parity
charles:rename-video-plan
charles:textchat-stage-25
charles:textchat-stage-23-24
charles:soundboard-plan
charles:textchat-24-ui-message-row
charles:textchat-22-ui-attachments-media
charles:textchat-23-ui-embeds
charles:textchat-14-core-expressions
charles:textchat-21-app-textchat-runtime
charles:textchat-16-core-navigation-read
charles:textchat-17-core-search
charles:textchat-19-core-dms-settings
charles:textchat-stage-13-15-18
charles:textchat-54-livekit-stereo-audio
charles:textchat-50-core-stream-audio-sources
charles:textchat-12-core-uploads
charles:textchat-15-core-message-actions
charles:textchat-11-core-composer
charles:textchat-18-core-threads
charles:textchat-13-core-reactions
charles:textchat-51-audio-pipewire-devices
charles:textchat-49-capture-audio-targets
charles:audio-plan
charles:textchat-plan2
charles:textchat-20-devserver-textchat
charles:textchat-6-api-chat-endpoints
charles:textchat-10-core-chat-ports
charles:textchat-9-ui-code-highlighting
charles:textchat-3-proto-expressions-threads-prefs
charles:textchat-5-api-messages-uploads
charles:textchat-2-proto-chat-requests-events
charles:textchat-8-ui-inline-flow-emoji
charles:screenshare
charles:textchat-7-platform-files-clipboard
charles:textchat-1-proto-message-content
charles:textchat-4-emoji-crate
charles:screenshare-31-acceptance
charles:screenshare-29-parity-screenshots
charles:textchat-plan
charles:screenshare-24-ui-focus-layout
charles:screenshare-27-ui-stream-menu
charles:screenshare-30-packaging-ci
charles:screenshare-21-app-screenshare-runtime
charles:screenshare-22-ui-sidebar-live
charles:screenshare-23-ui-stream-tile
charles:screenshare-26-ui-source-picker
charles:screenshare-28-ui-screenshare-settings
charles:screenshare-13-core-previews
charles:screenshare-12-core-codec-negotiation
charles:screenshare-25-ui-share-controls
charles:screenshare-18-hw-encode-linux
charles:screenshare-19-spike-hw-encode-windows
charles:screenshare-11-core-stream-params
charles:screenshare-20-devserver-screenshare
charles:screenshare-10-core-go-live
charles:screenshare-17-voice-livekit-video
charles:screenshare-14-audio-capture-linux
charles:wip/screenshare-17
charles:screenshare-integration
charles:feat-user-profile
charles:fix-voice-join
charles:feat-entity-images
charles:screenshare-16-voice-video-session
charles:screenshare-9-core-watching
charles:screenshare-5-capture-windows
charles:fix-wire-livekit
charles:screenshare-4-capture-linux
charles:screenshare-15-audio-capture-windows
charles:fix-member-list
charles:screenshare-8-core-stream-ports
charles:fix-live-protocol
charles:screenshare-6-ui-video-widget
charles:screenshare-3-capture-crate
charles:fix-altcha-captcha
charles:screenshare-1-video-frames
charles:screenshare-7-proto-api-streams
charles:screenshare-2-spike-livekit-video
charles:voice
charles:voice-26-acceptance
charles:voice-23-voice-e2ee
charles:voice-25-packaging-ci
charles:voice-13-voice-livekit-interop
charles:voice-24-parity-screenshots
charles:voice-19-ui-soundboard
charles:voice-20-ui-participant-menu
charles:voice-22-ui-dm-calls
charles:voice-21-ui-voice-settings
charles:voice-18-ui-call-view
charles:voice-14-app-voice-runtime
charles:voice-10-core-soundboard
charles:voice-17-ui-voice-panel
charles:voice-9-core-voice-settings-advert
charles:voice-5-audio-clips-chimes
charles:voice-15-devserver-voice
charles:voice-8-core-live-room-volumes
charles:voice-11-core-calls-status
charles:voice-12-voice-session
charles:voice-4-audio-devices-mixer
charles:voice-16-ui-voice-sidebar
charles:voice-7-core-voice-connection
charles:foundation
charles:voice-2-proto-api-soundboard-rtc
charles:voice-6-core-voice-states
charles:voice-3-audio-dsp
charles:voice-1-proto-voice-gateway
charles:task/26-acceptance
charles:task/25-packaging-release
charles:task/24-screenshot-tests
charles:task/20-ui-message-list-composer
charles:task/22-ui-settings-parity
charles:task/18-ui-main-layout
charles:task/23-notifications
charles:task/17-ui-shell-login
charles:task/14-app-runtime
charles:ci/51-windows-disk-space
charles:task/12-platform-persistence
charles:task/13-devserver
charles:task/21-ui-avatar-image-cache
charles:task/10-core-messages-readstate
charles:task/9-core-guilds-channels
charles:task/7-gateway-machine-transport
charles:task/11-core-presence-ui
charles:task/19-ui-rich-text
charles:task/8-core-store-session
charles:task/16-ui-theme-fonts-icons
charles:task/15-status-api
charles:task/4-proto-gateway-events
charles:task/5-openapi-vendor-contract
charles:task/6-api-client
charles:task/3-proto-rest-models
charles:task/2-proto-primitives
charles:task/1-workspace-scaffold
No reviewers
Labels
Clear labels
bug
A bug found while working on something else; steps to reproduce and the commit seen on
ci
Build, CI runners and workflows
follow-up
Deferred reviewer finding, linked from the PR it came from
good-first-task
Small, well-scoped, no cross-crate knowledge needed
parity
Settings/behaviour parity with the Electron client
question
Design question that needs Charles; blocks its task until answered
ready-to-merge
Reviewer approved, foundation merged in, CI green on both runners; waiting for the orchestrator to merge
task
A plan task (one per Foundation plan task)
No labels
bug
ci
follow-up
good-first-task
parity
question
ready-to-merge
task
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
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!737
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "serveradmin-12-core-roles"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Stacked on: origin/serveradmin-10-core-permission-lists, origin/serveradmin-11-core-forms-community (both already contained in origin/serveradmin at
05e6c55e, so the merges were no-ops).What this builds
fluxer-coreadmin::roles(plan Task 12, spec §3.4, §6.2 "Roles"):roles::model(app) -> Option<RolesModel { list: Vec<RoleRow>, can_create, editor: Option<RoleEditorModel> }>: roles by position (lower id first at equal positions, sorted only throughperms::is_role_higher), @everyone forced last, unsaved edits shown in the rows and the editor; with nothing selected the first role is shown (the original's desktopuseLayoutEffect). The editor carries the permission groups ofperm_spec::guild, filtered byperm_spec::search, each switch withperm_spec::role_switch's state and disabled reason.RoleAction::Createsends{name: "New role"}, toast "Role created successfully", selects the nextGUILD_ROLE_CREATE(pendingRoleCreationRef);MAX_GUILD_ROLESshows "You've reached the maximum of 250 community roles.", any other refusal "Couldn't create role".Edit/TogglePermission/ClearPermissionsfilleditswith only the fields that differ from the server's (a locked role or a disabled switch changes nothing; names cut to 100).MoveiscreateRoleMovePreviewplusRoleReorderStateMachine.getResultBlockedReason(locked roles do not move and are not crossed, nothing lands right above a locked role unless owner, nothing goes below @everyone). The pending order stays valid through role create / delete / bulk events (each role once, @everyone last) and goes when it equals the server's.UpdateRoleper changed role with only its changed fields andmask_for_saved permissions; when all are answered, oneUpdateRolePositionsbuilt ascreateSubmittableRoleOrderIds+createRoleOrderPayload(no @everyone, no locked roles, positions n..1). A refusal keeps the unsaved rest and shows "Couldn't update roles" on the bar;RESOURCE_LOCKEDon the order is retried once after 1 s; success toasts "Roles updated successfully".Duplicate(handleDuplicateRole): create "{name} copy" (cut to 100) with the source's colour,permissions & mineandicon_source_role_idwhen the source has an icon, then PATCH hoist + mentionable, then the order placing it below its source; shown at once throughoptimistic(not an unsaved change).Delete:Confirm::DeleteRolefrom the editor, immediate withconfirmed: true(the context menu); not for @everyone or locked roles; the next role is selected; a failure showsWe couldn't delete "{name}". Try again.roles::context_menu(app, role_id): "Copy role ID" (UserAction::CopyId(IdKind::Role, id)), "Duplicate role" (MANAGE_ROLES), then "Delete role" (danger; not @everyone, not locked).Strings recorded (from
GT/GuildRolesTab.tsx,RoleItem.tsx,RoleSidebar.tsx,RoleEditor.tsx,AM/RoleContextMenu.tsx,CopyMenuItems.tsx,CommonMessageDescriptors.ts, serverErrorI18nMessages.ts): New role; Role created successfully; Roles updated successfully; Role deleted successfully; Couldn't create role; Couldn't update roles; Couldn't delete role; Try again in a moment.; Role name is required; Give the role a name before saving.; Delete role; Duplicate role; Copy role ID; Create role; Clear permissions; You cannot edit this role because it is at or above your highest role; Are you sure you want to delete the {name} role? Any members with this role will no longer have it.; We couldn't delete "{name}". Try again.; You've reached the maximum of {count} community roles.Outside roles.rs (minimal)
event.rs:IdKind::Role(no exhaustive match onIdKindexists; the copy reducer handles every kind).admin/mod.rs:Admin::role_writes(in-flight role requests, likeguild_writes) and re-exports.admin/guild.rs: the bar'ssaving/errorread the Roles editor;UnsavedusesRolesEditor::dirty.admin/perms.rs,admin/perm_spec.rs:is_role_locked_with,highest_role_in,role_switch_with,mask_for_save_with-- the same rules over&Guilds/ the thread-guild set, because reducers getAdminCtx, not&App. The&Appfunctions now delegate to them; behaviour unchanged (their tests pass).Deviations from the plan / spec
RoleEditor.tsxalso shows the colour for @everyone and the server appliescolorto it (GuildRoleService.ts:807), so the colour stays editable; name, hoist, mentionable and delete are not. The test keeps the plan's nameeveryone_shows_permissions_onlyand documents this.RoleAction::Searchis the editor's permission search (the original's role list has no search); its doc comment is corrected.RolesEditorgainsoptimistic,saving,error,creating;RoleRowgainsis_everyone;RoleEditorModelgainsrole_id,can_edit,can_delete;PermissionGroupModel { title, rows: Vec<PermissionSwitchRow { permission, title, description, on, disabled }> }is defined here.context_menu(app, role_id)uses the guild of the open community settings (the menu only exists in the Roles tab).Tests
crates/fluxer-core/tests/admin_roles.rs: the 16 tests of the plan (list_order_and_everyone_last, create_selects_on_event, max_roles_error_text, edits_accumulate_per_role, blocked_switch_changes_nothing, clear_permissions, move_within_manageable_roles, locked_role_cannot_move_or_be_crossed, save_sends_changed_roles_then_order_without_everyone_and_locked, partial_failure_keeps_remaining_edits, resource_locked_retries_once, duplicate_three_requests_in_order, delete_confirms_in_editor_not_in_menu, everyone_shows_permissions_only, role_deleted_elsewhere_drops_its_edits_and_selection, bulk_event_while_dragging_keeps_pending_order_valid), written first and seen failing.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen locally. No new fixtures (no new event or endpoint); no UI, so no screenshots and no display tests.Closes #679
🤖 Generated with Claude Code
https://claude.ai/code/session_0161qMQMsCyJhjYw4gqa6e4K
Review: Server admin 12 (core roles), commit
847cd2fdI reviewed only the diff
05e6c55e..847cd2fd, with no prior context.Findings
[blocking] The plan's test
locked_reorder_is_not_sent_againis missing. In its place, the branch adds a resend the spec rules out.crates/fluxer-core/src/admin/roles.rs(on_failure,on_timer,RESOURCE_LOCKED_RETRY) sends a role order again after 1 s when it is refused withRESOURCE_LOCKED.tests/admin_roles.rs::resource_locked_retries_oncetests that resend.GENERAL_ERROR,Retry-After: 2, spec §3.4; notRESOURCE_LOCKED) is not sent again: it fails like any other refusal, as in the original".GuildRoleService.ts:450-453throwsResourceLockedError, andpackages/errors/src/domains/core/ResourceLockedError.tsgives that error codeGENERAL_ERRORwithRetry-After: 2.RESOURCE_LOCKEDcomes only fromRetryingLock.ts, which this endpoint does not use. It is a 429, and the 429 path inRestTransport.reactToOutcomeis a transport concern, not a reducer one.Fix:
RoleWrites::retry,on_timer,retried,RESOURCE_LOCKED_RETRY) and its README sentence.locked_reorder_is_not_sent_again: refuse the order with 423 andGENERAL_ERROR. Assert that nothing is sent again and no timer is set, that the bar shows "Couldn't update roles", and that the pending order is kept.[minor] @everyone's colour stays editable, but spec §3.4 says "only the permission list". The code is right and the spec is wrong.
RoleEditor.tsx:162, theColorPickerFieldsits outside the!isEveryoneguards (lines 130, 149, 178, 187).GuildRoleService.ts:807, the server appliescolorto @everyone and ignores only name, hoist, hoist_position and mentionable.[minor] The save sends the role PATCHes first and the order second, as the plan says.
The original's
handleSavesends the order first (GuildRolesTab.tsx:284-297). The difference is recorded in the module doc. No action needed.[minor] A blank name is refused on the bar ("Give the role a name before saving.").
The original shows a modal titled "Role name is required".
NAME_REQUIREDis defined but unused. Task 25 or 27 can use it if the modal is drawn.Checks
MAX_GUILD_ROLES(250), "{name} copy" cut to 100,permissions & mine, the three duplicate requests in order, the order without @everyone and locked roles numbered from the top down to 1, confirm in the editor and none in the menu, and the bulk event keeping the pending order valid.locked_reorder_is_not_sent_againis the missing one (see above).roles::model(&App) -> Option<RolesModel>(alreadyOptionin the 9a stub).RolesModel,RoleRowandRoleEditorModelhave every field the plan names, plus the extra fields listed in the PR.RoleActionandRoleMoveare unchanged.context_menu(app, role) -> MenuModelhas the rows "Copy role ID", "Duplicate role", "Delete role".IdKind::Roleis additive.*_withhelpers in perms and perm_spec keep the&Appfunctions' behaviour; their existing tests are green.position()and positions usetry_from.perms(sorting goes throughperms::is_role_higher).handleDuplicateRole: colour,permissions & currentUserPermissions,iconSourceRoleIdonly with an icon or emoji, the position after the source, and the order-failure toast.handleContextMenuDeleteRole: no confirm, next roleroles[i+1] ?? roles[0], the failure textWe couldn't delete "{name}". Try again.createRoleMovePreviewandRoleReorderStateMachine: no move for a locked or @everyone role, nothing after @everyone, no crossing a locked role when moving up, and the target-before-locked-role rule for non-owners.handleSave: the blank-name check and thread bits masked when threads are inactive.save_sends_changed_roles_then_order_without_everyone_and_lockedandbulk_event_while_dragging_keeps_pending_order_valid.FLUXER_SCREENSHOT_TESTS=1 cargo xtask cion847cd2fd: green ("xtask ci: all steps passed").Verdict: changes requested. One blocking finding: the missing
locked_reorder_is_not_sent_againtest and theRESOURCE_LOCKEDresend the spec rules out.Review round 1, fixed in
e67995ad(localFLUXER_SCREENSHOT_TESTS=1 cargo xtask cigreen):RESOURCE_LOCKEDretry path (RoleWrites::retry,on_timer,retried,RESOURCE_LOCKED_RETRY, and the now-unusedpositionscopy kept for resending) and its README line. Replacedresource_locked_retries_oncewith the plan'slocked_reorder_is_not_sent_again: a 423GENERAL_ERRORrefusal (and aRESOURCE_LOCKEDone) sends nothing again, schedules no timer, shows "Couldn't update roles" and keeps the pending order. The test failed on the old code before the fix.admin/roles.rs(which now namesNAME_REQUIREDas the original's modal title) and in the crate README.Review round 2: Server admin 12 (core roles), commit
e67995adI reviewed the whole diff
05e6c55e..e67995adfrom scratch. I did not rely on the earlier round or on the implementer's notes.Checks
locked_reorder_is_not_sent_againcovers both 423GENERAL_ERRORandRESOURCE_LOCKED. In both cases there is no timer, no second order request, the bar shows "Couldn't update roles" and the pending order is kept.save_sends_changed_roles_then_order_without_everyone_and_lockedchecks the order body[LOW2, BELOW, ZERO]numbered 3..1, with @everyone and the locked roles ABOVE and ACTOR left out. It also checks that @everyone's PATCH carries permissions only and that the thread bit is masked out.model,RolesModel,RoleRow,RoleEditorModel,PermissionGroupModel,RoleAction::{Create, Select, Edit, TogglePermission, ClearPermissions, Move(RoleMove), Duplicate, Delete, Search},RoleMoveTarget,RolesEditorandcontext_menu(app, role) -> MenuModelare present and re-exported fromadmin.modelreturnsOption<RolesModel>, which is 9a's existing stub signature, so the existing code wins over the plan text. The extra fields (is_everyone,can_edit,can_delete,role_id) only add to the interface.GuildRoleResponseshape. Every lookup is guarded, and the onlyunwrap_oris a position conversion that saturates. No secrets appear. No role positions are compared outsideadmin::perms:sorted_idsgoes throughperms::is_role_higher, and the_withvariants ofis_role_locked,role_switchandmask_for_saveare pure refactors of the old functions.GuildRolesTab.tsx:402-454: "{name} copy".slice(0,100), colour,permissions & mine,iconSourceRoleId, then the hoist/mentionable PATCH, then the order with the copy counted as not locked. A failed order still shows the "Role created successfully" toast.createSubmittableRoleOrderIds/createRoleOrderPayloadmatch: positions arelen - index, and @everyone and duplicates are dropped.MAX_GUILD_ROLES= 250 (LimitConstants.ts:42). The text matchesmessages.json"You've reached the maximum of # community roles."RoleItem.tsx:36) are exact.GuildRoleService.ts:450-453throwsResourceLockedError, and this branch does not send that order again.GUILD_ROLE_UPDATE_BULKwhile a drag is pending keeps the pending order valid: every role appears once, @everyone is last, and the user's move is kept. A role that becomes locked is left out of what is sent. The round-1 retry path is gone fromroles.rsand the README.FLUXER_SCREENSHOT_TESTS=1 cargo xtask ciexited 0 with the screenshot suite included.Findings
on_createdmatches anApiResult::RoleCreatedto the oldest pendingCreate/DuplicateCreateof the guild, not to its effect. If someone clicks "Create role" and "Duplicate role" quickly and the answers come back in the other order, the plain new role would get the copy's hoist/mentionable PATCH and order. This is unlikely, and the original has the same per-click race throughpendingRoleCreationRef. It does not block.Verdict: approve. No blocking findings, and local CI is green.
Merged into
serveradminby hand (the merge API returns 405); the commits are in the branch.Pull request closed