Skip to content

feat: Add column sorting to the Queues dashboard #3249

@winkelmeyer

Description

@winkelmeyer

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" } with skip/take pagination (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 orderBy directly with no performance change.
  • No sortable table header component exists yet in apps/webapp/app/components/primitives/Table.tsx — one would

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions