v2.0.0: Rails conventions refactor#38
Merged
Merged
Conversation
Replaces 11 *Presenter classes with app/views/**.html.erb plus app/helpers/solid_queue_monitor/* helpers. Serves CSS/JS via a new AssetsController with content-hashed URLs, removing the need for inline <style nonce>/<script nonce> blocks. Public API unchanged (config block, mount, URLs, auth, CSP nonce support). WIP: jobs#show specs failing with MissingExactTemplate despite the template existing — diagnosis + Phase 6 cleanup + version bump still pending in follow-up commits.
- Delete BasePresenter, StatsPresenter, HtmlGenerator, StylesheetGenerator (~2,750 LOC of legacy HTML-in-Ruby removed) - Remove BaseController#render_page (replaced by Rails implicit rendering) - Upgrade CSP spec with no-inline-style-block / no-inline-script-block assertions - Bump VERSION to 2.0.0 - Add CHANGELOG entry for [2.0.0] - 2026-05-12 - Refine job_details + jobs helpers and 3 job partials
The .queue-paused row only set a light cream background (#fffbeb) without an explicit text color, so the dark theme inherited the near-white default text and rendered as nearly invisible. Adds a dark-theme override with dark amber background + light amber text (~11:1 contrast). Light theme unchanged.
Reflects v2.0 behavior: strict `script-src 'self'; style-src 'self'` works out of the box now that CSS/JS are served as external assets. Removes the v1.3.0 caveat about nonces being required for strict policies, and adds an upgrade note for v1.x users.
These four index-only controllers lacked dedicated request specs in v1.x. The refactor inherited the gap. Each new spec covers: happy path, empty state, key DOM elements, filter by class_name (and queue_name for ready_jobs). Brings spec total from 294 to 315 examples.
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
Major architectural refactor: replaces the gem's HTML-in-Ruby rendering pipeline (13
*Presenterclasses +HtmlGenerator+StylesheetGeneratoremitting heredoc HTML) with standard Rails ERB views, helpers, and partials. CSS and JavaScript are now served as external assets via a controller-based pipeline with content-hashed URLs andCache-Control: immutable. Public API (config, mount, URLs, auth, CSP) is unchanged.Why
<style nonce>+ several inline<script nonce>blocks, requiring host-app nonce configuration to work under strict CSPResult
<style nonce>blocks per page<script nonce>blocks per pagescript-src 'self'; style-src 'self'worksCache-Control: immutable, memory/disk cacheviews/,helpers/,assets/)Net LOC: ~5,000 lines of HTML-in-Ruby removed; ~800 lines of ERB + helpers + one 2,000-line
application.css+ oneapplication.jsadded.Breaking changes (internal only)
The following internal classes are removed. None were documented as public API:
SolidQueueMonitor::HtmlGenerator,StylesheetGenerator,ChartPresenter,BasePresenter*PresenterclassesBaseController#render_pageUsers who reached into these via monkey-patches will need to migrate to view/helper overrides. CHANGELOG documents the upgrade path.
Compatibility
Test plan
Cache-Control: immutable, dark-theme paused queue row readablescript-src 'self'; style-src 'self'CSP (no nonces) in a separate test app — zero CSP violations