Skip to content

feat: job class search with dynamic Turbo Frame filtering#16

Merged
eclectic-coding merged 8 commits into
mainfrom
feature/job-class-search
May 19, 2026
Merged

feat: job class search with dynamic Turbo Frame filtering#16
eclectic-coding merged 8 commits into
mainfrom
feature/job-class-search

Conversation

@eclectic-coding
Copy link
Copy Markdown
Owner

Summary

  • Adds a class name search field to the jobs index that filters by job class
  • Search auto-submits after 4 characters typed or on clear (300 ms debounce via a Stimulus search controller)
  • Filter tabs, search, and pagination all operate within a Turbo Frame — only the table region updates, no full page reload
  • URL is pushed to history on each navigation (data-turbo-action="advance") so filtering is bookmarkable and the back button works

Implementation notes

  • Stimulus controller lives at app/javascript/solid_queue_web/search_controller.js following Rails naming conventions
  • Engine wires its own importmap-rails integration (config/importmap.rb, solid_queue_web.assets and solid_queue_web.importmap initializers, explicit require "importmap-rails" to work around Bundler's auto-require path mismatch with hyphenated gem names)
  • @hotwired/turbo is imported in the engine entry point so Turbo is active within the engine's own layout
  • Propshaft added to the Gemfile so the dummy dev server can serve app/javascript/ assets

Test plan

  • bundle exec rspec — 57 examples, 0 failures, 100% coverage
  • bin/rubocop — no offenses
  • Start dummy server, browse to /jobs/list, type 4+ chars in search — table updates without page reload, URL updates
  • Click status filter tabs — table swaps without page reload
  • Clear search — table resets without page reload
  • Verify back button restores previous filter state

🤖 Generated with Claude Code

eclectic-coding and others added 8 commits May 19, 2026 07:42
Text input filters the jobs list by class name (case-insensitive LIKE).
Search term persists across status tab switches. Clear link shown when
a search is active. Uses references(:job) to force a JOIN so the WHERE
clause on solid_queue_jobs.class_name is valid.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Registers a Stimulus Application instance scoped to this engine (sqd-
prefixed controllers) and wires a SearchController that debounces input
events, submitting the form after 300 ms once 4+ characters are typed or
when the field is cleared. The JS is inlined via a new inline_scripts
helper using the same pattern as inline_styles.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Replace the inline IIFE approach with a standards-compliant Stimulus
search_controller.js. The engine now depends on importmap-rails,
registers its own config/importmap.rb, and loads via
javascript_importmap_tags in the layout. importmap-rails must be
explicitly required since Bundler's auto-require converts hyphens to
slashes and misses the lib/importmap-rails.rb entry point.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Move JS files from app/assets/javascripts to app/javascript (the
conventional importmap-rails location) and add a solid_queue_web.assets
initializer that registers the engine's app/javascript directory with
the host app's asset pipeline. Add Propshaft to the Gemfile so the
dummy dev server can resolve and serve the JS assets.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Import @hotwired/turbo in the engine entry point so Turbo is active
when using the engine's own layout. Add data-turbo-action="advance"
to the jobs-table frame so status filter clicks and search submissions
update only the table region and push the filtered URL to history.
Pin @hotwired/turbo in the dummy app's importmap from CDN for the dev
server.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Use turbo.es2017-esm.js (dash before esm, not dot) at the matching
8.0.23 version that turbo-rails 2.0.23 bundles.

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 1ef57f1 into main May 19, 2026
5 checks passed
@eclectic-coding eclectic-coding deleted the feature/job-class-search branch May 19, 2026 12:48
@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 (0149429) to head (7e67679).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff            @@
##              main       #16   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          131       141   +10     
=========================================
+ Hits           131       141   +10     

☔ 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.

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