feat(users): redesign the admin users page, keep custom roles on save - #214
Merged
Merged
Conversation
The users table crammed a role select + save, a lock form, a password reset and a delete button into one row; "Actions" expanded them inside the narrow right column. Each user is now an expandable row in one grouped panel: the summary is the scan line (name, role, 2FA, status, last sign-in), and "Manage" opens Role / Sign-in / Password side by side with Delete split off at the bottom. Add user moved below the list as a collapsible group with a role legend. Stacks on narrow screens. Fixes a data-loss bug found on the way: a custom-role user's `role` column holds the operator sentinel, so the dropdown preselected "Operator" and one "Save role" silently dropped the custom role. WebUserList now carries `custom_role_id` (serde default for older agents) and the page preselects and shows the custom role. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Redesign of
/admin/users, plus a fix for a bug that silently dropped a user's custom role.WebUserSummarygainscustom_role_id, filled byWebUserListthrough a newweb_users::custom_role_assignmentsquery.Why
The old row crammed a role select, a lock form, a password reset and a delete button into the narrow Actions column, which was hard to read and easy to misclick.
The bug: a custom-role user's
rolecolumn holds theoperatorsentinel. The dropdown therefore preselected "Operator", and one Save role click replaced the custom role with Operator without any warning. The page now preselects the custom role and shows its name in the list, marked "custom".Operator-facing change?
Test plan
cargo test -p hyperion-web -p hyperion-state -p hyperion-typespasses.cargo clippy -p hyperion-web -p hyperion-state -p hyperion-core --all-targetsproduces no warnings.cargo fmt --all -- --checkpasses.tests/devserver.rs) on desktop and mobile widths, with a custom-role user and a locked user.custom_role_assignments_lists_linked_users_only, a write-then-read-back test.Anti-scope
web_user_getstill returnscustom_role_id: None. Only the list view needs the field.🤖 Generated with Claude Code