Skip to content

refactor: extract queue-scoped jobs view to Queues::JobsController#18

Merged
eclectic-coding merged 3 commits into
mainfrom
feature/nested-queue-jobs
May 19, 2026
Merged

refactor: extract queue-scoped jobs view to Queues::JobsController#18
eclectic-coding merged 3 commits into
mainfrom
feature/nested-queue-jobs

Conversation

@eclectic-coding
Copy link
Copy Markdown
Owner

Summary

  • JobsController#index now owns only status filtering — the ?queue= param and @queue instance variable are gone
  • New nested resource Queues::JobsController at /jobs/queues/:queue_name/list handles all queue-scoped job listing, individual discard (with Turbo Stream), and bulk discard — each redirecting back within the queue context
  • Queue name links in the global jobs list navigate to the nested view instead of appending ?queue=
  • JobsController simplified: set_status_and_queueset_status, filtered_scope no longer conditionally scopes by queue

Routes added

GET  /jobs/queues/:queue_name/list              queues/jobs#index
DEL  /jobs/queues/:queue_name/list/:id          queues/jobs#destroy
POST /jobs/queues/:queue_name/list/discard_all  queues/jobs#discard_all

Test plan

  • 86 examples, 100% line coverage (bundle exec rspec)
  • RuboCop clean (bin/rubocop)
  • Manual: click a queue name from the jobs list → lands on the queue-scoped view with breadcrumb
  • Manual: status tabs, search, and discard all stay within the queue context
  • Manual: Turbo Stream row removal and empty-state swap work on the queue view

🤖 Generated with Claude Code

eclectic-coding and others added 2 commits May 19, 2026 09:40
JobsController#index no longer filters by queue — it shows all jobs for
a given status. Queue filtering is now a dedicated nested resource:

  GET  /jobs/queues/:queue_name/list          → Queues::JobsController#index
  DEL  /jobs/queues/:queue_name/list/:id      → Queues::JobsController#destroy
  POST /jobs/queues/:queue_name/list/discard_all → Queues::JobsController#discard_all

Queue name links in the global jobs list navigate to the queue-scoped
view. Each controller is self-contained: status tabs, search, discard,
and redirects all resolve within their own context.

JobsController simplified: removed @Queue from index, set_status_and_queue
renamed to set_status, filtered_scope no longer takes queue into account.

86 examples, 100% coverage.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 19, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (35e7130) to head (d883386).
⚠️ Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #18   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           11        12    +1     
  Lines          153       187   +34     
=========================================
+ Hits           153       187   +34     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Job class name links inside the turbo_frame_tag "jobs-table" on the
jobs list caused Turbo to look for a matching frame on the show page.
When not found, Turbo rendered "Content missing" inside the frame.

Adding data-turbo-frame="_top" forces a full-page navigation to the
show view. Applied to both the global jobs index and the queue-scoped
jobs index.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@eclectic-coding eclectic-coding merged commit 335b80f into main May 19, 2026
5 checks passed
@eclectic-coding eclectic-coding deleted the feature/nested-queue-jobs branch May 19, 2026 13:57
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