优化 GET /api/roles/users 用户列表的排序:
- 主排序:按角色等级 皇帝 → 公爵 → 骑士 → 平民(无角色用户排最后)
- 次排序:用户名长度(短者优先)
- 末排序:用户名字母序(大小写不敏感)
- 查询由 db.query.users.findMany(relational)改为显式 select + leftJoin,
以支持基于角色名的 CASE 排序
Sort the user list returned by GET /api/roles/users:
- Primary: by role rank Emperor -> Duke -> Knight -> Civilian (users
without a role sort last)
- Secondary: username length (shorter first)
- Tertiary: username alphabetical order (case-insensitive)
- Switch the query from db.query.users.findMany (relational) to an explicit
select + leftJoin to enable CASE-based ordering on role name
Add ability for Emperor to delete users from the role management panel:
- New POST /api/roles/delete endpoint with PROMOTE_USER permission guard,
blocks deleting self or other emperors, cascades user data cleanup
- Trash button on each non-emperor row with confirmation dialog
- Auto-navigate to previous page when deleting the last user on a page
- i18n strings added for all 5 locales
Redesign the Emperor's Role Management panel from a single-user
search-and-assign form into a full user management dashboard with
browsable user list and inline role editing.