Skip to content

255: Sort admin users to top of user list#914

Open
rootandroo wants to merge 1 commit intomainfrom
255
Open

255: Sort admin users to top of user list#914
rootandroo wants to merge 1 commit intomainfrom
255

Conversation

@rootandroo
Copy link
Copy Markdown

@rootandroo rootandroo commented Apr 23, 2026

255

Description of changes

Sort users by admins first per page on /admin

Checklist before review

  • I have done a thorough self-review of the PR
  • Copilot has reviewed my latest changes, and all comments have been fixed and/or closed.
  • If I have made database changes, I have made sure I followed all the db repo rules listed in the wiki here. (check if no db changes)
  • All tests have passed
  • I have successfully deployed this PR to staging
  • I have done manual QA in both dev (and staging if possible) and attached screenshots below.

Screenshots

Dev

image

Staging

@github-actions
Copy link
Copy Markdown
Contributor

Available PR Commands

  • /ai - Triggers all AI review commands at once
  • /review - AI review of the PR changes
  • /describe - AI-powered description of the PR
  • /improve - AI-powered suggestions
  • /deploy - Deploy to staging

See: https://github.com/tahminator/codebloom/wiki/CI-Commands

@github-actions
Copy link
Copy Markdown
Contributor

Title

255: Sort admin users to top of user list


PR Type

Enhancement


Description

  • Prioritize admin users in the admin list display.

  • Add new author to server metadata.


Diagram Walkthrough

flowchart LR
  A[Fetch User List] --> B{Is data successful?};
  B -- Yes --> C[Extract Page Data];
  C --> D[Sort Users: Admins First];
  D --> E[Render Sorted User List];
  B -- No --> F[Display Error Message];
Loading

File Walkthrough

Relevant files
Documentation
ServerMetadataObject.java
Add new author to server metadata                                               

src/main/java/org/patinanetwork/codebloom/utilities/ServerMetadataObject.java

  • Added "Randy Dean" to the list of authors.
+2/-1     
Enhancement
UserAdminList.tsx
Sort admin users to top of list                                                   

js/src/app/admin/_components/users/UserAdminList.tsx

  • Implemented client-side sorting to display admin users at the top of
    the list.
  • Created a sortedItems array by spreading and sorting the fetched
    pageData.items.
  • Updated the Table.Tr mapping to iterate over sortedItems instead of
    pageData.items.
+7/-1     

@github-actions
Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

**🎫 Ticket compliance analysis **

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ Recommended focus areas for review

Unrelated Change

The addition of authors in ServerMetadataObject.java is unrelated to the PR's stated purpose of sorting admin users. This change should either be removed from this PR or moved to a separate, relevant PR.

"Maliha Tasnim",
"Randy Dean"));
Missing Test

The new sorting logic for admin users in UserAdminList.tsx does not appear to have corresponding unit tests. Adding tests for this sorting function would ensure its correctness and prevent future regressions.

const sortedItems = [...pageData.items].sort((a, b) => {
  if (a.admin === b.admin) return 0;
  return a.admin ? -1 : 1;
});

Comment thread js/src/app/admin/_components/users/UserAdminList.tsx
@github-actions
Copy link
Copy Markdown
Contributor

Failed to generate code suggestions for PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant