Skip to content

feat: add sortable column headers to all job list tables#24

Merged
vishaltps merged 1 commit intomainfrom
feature/column-sorting
Feb 6, 2026
Merged

feat: add sortable column headers to all job list tables#24
vishaltps merged 1 commit intomainfrom
feature/column-sorting

Conversation

@vishaltps
Copy link
Owner

Summary

  • Add clickable column header sorting to all job list tables
  • Click to sort ascending, click again to toggle descending
  • Visual indicators: ↑ (ascending), ↓ (descending), ⇅ (sortable/default)
  • Sort state preserved across pagination and filtering

Tables with Sorting

Table Sortable Columns Default Sort
Ready Jobs class_name, queue_name, priority, created_at created_at DESC
Scheduled Jobs class_name, queue_name, scheduled_at scheduled_at ASC
Failed Jobs class_name, queue_name, created_at created_at DESC
In Progress Jobs class_name, queue_name, created_at created_at DESC
Recurring Jobs key, class_name, queue_name, priority key ASC
Jobs class_name, queue_name, status, created_at created_at DESC
Queues queue_name, job_count job_count DESC
Workers hostname, last_heartbeat_at last_heartbeat_at DESC

Implementation

  • Added sort infrastructure to BaseController with sort_params, apply_sorting, and apply_execution_sorting methods
  • Added sortable_header helper to BasePresenter for generating clickable header links
  • Added CSS styles for sortable headers with hover and active states
  • Special handling for execution tables that require JOINs on the jobs table
  • Special handling for GROUP BY queries on the queues page

Test Plan

  • All 181 tests pass (5 pre-existing pending)
  • Manual testing completed on all pages
  • Rubocop passes with no offenses

Add clickable column headers for sorting across all job tables:
- Ready Jobs: class_name, queue_name, priority, created_at
- Scheduled Jobs: class_name, queue_name, scheduled_at
- Failed Jobs: class_name, queue_name, created_at
- In Progress Jobs: class_name, queue_name, created_at
- Recurring Jobs: key, class_name, queue_name, priority
- Jobs: class_name, queue_name, status, created_at
- Queues: queue_name, job_count
- Workers: hostname, last_heartbeat_at

Features:
- Click to sort ascending, click again for descending
- Visual indicators: ↑ (asc), ↓ (desc), ⇅ (default/sortable)
- Sort state preserved across pagination and filtering
- Special handling for execution tables with JOIN queries
- Special handling for GROUP BY queries on queues page

Includes comprehensive test coverage with 27 new specs.
@vishaltps vishaltps force-pushed the feature/column-sorting branch from ca8c005 to 2dcb72b Compare February 6, 2026 17:35
@vishaltps vishaltps merged commit cd0f822 into main Feb 6, 2026
3 checks passed
@vishaltps vishaltps mentioned this pull request Feb 7, 2026
3 tasks
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