Skip to content

Bulk job selection and discard (#10)#10

Merged
eclectic-coding merged 5 commits into
mainfrom
feat/bulk-selection
May 25, 2026
Merged

Bulk job selection and discard (#10)#10
eclectic-coding merged 5 commits into
mainfrom
feat/bulk-selection

Conversation

@eclectic-coding
Copy link
Copy Markdown
Owner

Summary

  • Adds a checkbox column to the jobs list for ready, scheduled, and blocked statuses (non-discardable statuses show no checkboxes)
  • "Select All" header checkbox toggles all rows via inline onclick
  • "Discard Selected" submits checked job IDs to a dedicated Jobs::SelectionsController#destroy at DELETE /jobs/selection — the Rails Way (singular resource, proper HTTP verb)
  • Filter state (status, q, queue, period, priority) is preserved in the redirect after a bulk discard
  • CSRF handled via data-turbo-frame="_top" (same pattern as Discard All), causing a full-page navigation after the redirect

Test plan

  • bundle exec rspec — 81 examples, 0 failures
  • bin/rubocop — no offenses
  • Manual: select one or more jobs and click "Discard Selected" — verifies only checked jobs are removed
  • Manual: "Select All" toggles all checkboxes; bulk discard removes all
  • Manual: non-discardable status (claimed) shows no checkboxes and no selection bar

🤖 Generated with Claude Code

eclectic-coding and others added 5 commits May 25, 2026 16:30
Add checkbox selection to the jobs table with a "Discard Selected" action.
Plain HTML form approach (no Stimulus) with a select-all checkbox and
per-row checkboxes scoped to DISCARDABLE statuses only.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the non-RESTful `discard_selected` collection action with a
dedicated `Jobs::SelectionsController#destroy`, routed as a singular
resource at DELETE /jobs/selection — the Rails Way.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
data-turbo="false" opts out of Turbo entirely, causing the browser to
submit a native form whose hidden authenticity_token can't be verified
by the engine. Switching to data-turbo-frame="_top" lets Turbo send
the X-CSRF-Token header while still doing a full-page navigation after
the discard.

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 388b76c into main May 25, 2026
4 checks passed
@eclectic-coding eclectic-coding deleted the feat/bulk-selection branch May 25, 2026 20:41
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