feat: job class search with dynamic Turbo Frame filtering#16
Merged
Conversation
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>
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
searchcontroller)data-turbo-action="advance") so filtering is bookmarkable and the back button worksImplementation notes
app/javascript/solid_queue_web/search_controller.jsfollowing Rails naming conventionsimportmap-railsintegration (config/importmap.rb,solid_queue_web.assetsandsolid_queue_web.importmapinitializers, explicitrequire "importmap-rails"to work around Bundler's auto-require path mismatch with hyphenated gem names)@hotwired/turbois imported in the engine entry point so Turbo is active within the engine's own layoutapp/javascript/assetsTest plan
bundle exec rspec— 57 examples, 0 failures, 100% coveragebin/rubocop— no offenses/jobs/list, type 4+ chars in search — table updates without page reload, URL updates🤖 Generated with Claude Code