-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Description
Is your feature request related to a problem? Please describe.
The Queues dashboard (/orgs/:org/projects/:project/env/:env/queues) currently displays queues in a fixed alphabetical order by name. There is no way to sort by other columns like queued count, running count, or concurrency limit.
We at getclera.com are running more than 100 queues and can't easily see where work is being queued right now. Sorting alphabetically doesn't make sense when you're trying to quickly identify which queues have the most backlog or are hitting their concurrency limits — you have to scan through pages manually.
Describe the solution you'd like to see
Add clickable sort headers to the Queues table for the following columns: Name, Queued, Running, and Limit. Clicking a column header should sort by that column, and clicking again should toggle between ascending and descending order. The current sort state should be persisted in URL search params (sortBy, sortDirection) so it survives page refreshes and is shareable.
Default sort should remain Name ascending (current behavior) for backward compatibility.
Describe alternate solutions
- Client-side only sorting: Sort only the current page of results in the browser. Simpler to implement but gives misleading results with pagination (e.g., "top queued" would only be the top within the current alphabetical page, not globally).
- Sort only DB-backed columns (Name, Limit): Avoids the cost of fetching Redis counts for all queues when sorting by Queued/Running, but limits usefulness since Queued and Running are often the most valuable sort criteria.
Additional information
Implementation notes from codebase exploration:
- Route:
apps/webapp/app/routes/_app.orgs.$organizationSlug.projects.$projectParam.env.$envParam.queues/route.tsx - Presenter:
apps/webapp/app/presenters/v3/QueueListPresenter.server.ts - Currently the Prisma query uses
orderBy: { orderableName: "asc" }withskip/takepagination (25 per page) - Queued and Running counts come from Redis (
engine.lengthOfQueues()/engine.currentConcurrencyOfQueues()), not the database. Currently only fetched for the 25 queues on the current page. Sorting by these columns would require fetching counts for all queues in the environment, sorting in-memory, then paginating — a performance tradeoff to consider. - Name and Limit are DB columns and can use Prisma
orderBydirectly with no performance change. - No sortable table header component exists yet in
apps/webapp/app/components/primitives/Table.tsx— one would