Skip to content

🔍 fix: Roles Search and Pagination#12

Merged
dustinhealy merged 1 commit intomainfrom
dustin/roles-search-pagination
Apr 8, 2026
Merged

🔍 fix: Roles Search and Pagination#12
dustinhealy merged 1 commit intomainfrom
dustin/roles-search-pagination

Conversation

@dustinhealy
Copy link
Copy Markdown
Contributor

Summary

Roles search and pagination were fighting each other. Search filtered client-side on the current server page only (e.g. 50 of 200+ roles), and the page number didn't reset — so typing a search term while on page 5 would show zero results even when matches existed on other pages.

Now RolesTab fetches all roles via allRolesQueryOptions (capped at 200 by the backend) and does client-side filtering + pagination with page reset on search input change.

The LibreChat roles list API (GET /api/admin/roles) does not support a search query parameter (unlike groups), so client-side filtering is the correct approach here.

Change Type

  • Bug fix (non-breaking change which fixes an issue)

Testing

  1. Seed 200+ roles in the database
  2. Open the Access page → Roles tab
  3. Verify pagination shows multiple pages
  4. Type a search term → confirm results filter across all roles (not just the current page) and pagination resets to page 1
  5. Clear search → confirm all roles return with correct page count
  6. Navigate to page 3 → type a search → confirm page resets to 1

Checklist

  • My code adheres to this project's style guidelines
  • I have performed a self-review of my own code
  • My changes do not introduce new warnings
  • Local unit tests pass with my changes

Previously search filtered only the current server page (50 of 200+)
and didn't reset the page number, causing search and pagination to
fight. Now fetches all roles via allRolesQueryOptions and does
client-side filtering + pagination with page reset on search.

The roles list API does not support a search parameter (unlike groups),
so client-side filtering is the correct approach here.
@dustinhealy dustinhealy marked this pull request as ready for review April 8, 2026 00:04
@dustinhealy dustinhealy merged commit 1f49249 into main Apr 8, 2026
4 checks passed
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.

2 participants