Skip to content

feat: job filtering by class, queue, priority, and time period#3

Merged
eclectic-coding merged 5 commits into
mainfrom
feat/job-filtering
May 25, 2026
Merged

feat: job filtering by class, queue, priority, and time period#3
eclectic-coding merged 5 commits into
mainfrom
feat/job-filtering

Conversation

@eclectic-coding
Copy link
Copy Markdown
Owner

Summary

  • Adds query-param driven filtering to the jobs list: job class substring (q), queue name, priority, and time period (1h / 24h / 7d / all)
  • Extracts a SolidStackWeb::Job PORO to hold EXECUTION_MODELS, DISCARDABLE, STATUSES, and TAB_LABELS, removing those constants from the controller
  • Extracts a filtered_scope private method in JobsController so #index stays readable

Changes

  • app/models/solid_stack_web/job.rb — new PORO with domain constants
  • app/controllers/solid_stack_web/jobs_controller.rb — filter params wired up; constants delegated to Job; scope logic in filtered_scope
  • app/assets/stylesheets/solid_stack_web/_08_filters.css — filter bar, search input, select, and period toggle styles
  • app/views/solid_stack_web/jobs/index.html.erb — filter form between tabs and table; status tabs preserve active filter params
  • spec/requests/solid_stack_web/jobs_spec.rb — 16 request specs covering each filter in isolation, combined filters, and tab-link persistence

Test plan

  • bundle exec rake passes (rubocop + rspec, 21 examples)
  • Filter by job class substring returns only matching rows
  • Filter by queue hides the select when only one queue exists
  • Period toggle preserves active class/queue/priority params
  • Switching status tabs preserves all active filter params
  • Clear link appears only when a text/select filter is active

🤖 Generated with Claude Code

eclectic-coding and others added 5 commits May 25, 2026 11:14
Filters are driven entirely by query params and preserved across status
tabs. The filter form uses a hidden period field so search/select
submissions do not lose the active time window, and period links preserve
the active class/queue/priority values. No JavaScript required.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…constants

Moves the three controller-level constants into a SolidStackWeb::Job PORO,
keeping the controller focused on HTTP concerns. The view references
SolidStackWeb::Job::TAB_LABELS directly to avoid namespace resolution
ambiguity in ERB templates.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Moves the four conditional where-clauses out of #index into a dedicated
private method, leaving the action body readable at a glance.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eclectic-coding eclectic-coding merged commit abbea32 into main May 25, 2026
5 checks passed
@eclectic-coding eclectic-coding deleted the feat/job-filtering branch May 25, 2026 15:26
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