refactor(feedback): replace jSimple Star Rating with progressive Font Awesome stars - #2812
Draft
mroderick wants to merge 1 commit into
Draft
refactor(feedback): replace jSimple Star Rating with progressive Font Awesome stars#2812mroderick wants to merge 1 commit into
mroderick wants to merge 1 commit into
Conversation
mroderick
force-pushed
the
feature/replace-jsimple-star-rating
branch
2 times, most recently
from
August 26, 2026 06:25
041e61d to
1a4a5ba
Compare
…stars Remove the abandoned jSimple Star Rating jQuery plugin and replace it with a small vanilla-JS initializer that progressively enhances radio buttons into CSS-generated Unicode stars. Why not Font Awesome: the project loads Font Awesome 5 with SVG+JS, which replaces <i> elements at runtime. Toggling far/fas classes on those <i> tags after replacement has no effect, so the widget is now rendered via CSS ::before content instead. Changes: - Add app/assets/javascripts/feedback-rating.js - Render radio buttons in feedback/show.html.haml instead of hidden input - Update _star-rating.scss to use CSS ::before star glyphs - Delete jsimple-star-rating.min.js and star-rating.gif - Update member_feedback feature spec to select a star and assert the persisted rating - Remove inline :javascript block Verification: - rubocop clean - haml-lint clean - rails runner boots - controller/model specs: 11 examples, 0 failures - feature spec: 9 examples, 0 failures - assets:precompile succeeds - browser snapshot: clicking star 4 fills stars 1-4
mroderick
force-pushed
the
feature/replace-jsimple-star-rating
branch
from
August 26, 2026 06:44
1a4a5ba to
baa3224
Compare
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.
What
Removes the abandoned jSimple Star Rating jQuery plugin and replaces it with a small vanilla-JS initializer that progressively enhances radio buttons into CSS-generated Unicode stars.
Why
jSimple Star Rating is unmaintained and was the only consumer of a hand-vendored, unversioned minified file. The new implementation is dependency-free, accessible, and works without JavaScript.
Font Awesome was not used for the stars because the project loads Font Awesome 5 with SVG+JS, which replaces
<i>elements at runtime. Togglingfar/fasclasses on those tags after replacement has no visual effect, so the stars are rendered via CSS::beforecontent instead.Changes
app/assets/javascripts/feedback-rating.js(vanilla JS initializer)f.hidden_field :ratingwith radio buttons inapp/views/feedback/show.html.hamlapp/assets/stylesheets/partials/_star-rating.scssto use CSS::beforestar glyphsapp/assets/javascripts/jsimple-star-rating.min.jsapp/assets/images/star-rating.gifspec/features/member_feedback_spec.rbto click the star label and assert the persisted rating:javascriptblock from the feedback viewdocs/plans/Automated verification
bundle exec rubocop spec/features/member_feedback_spec.rb— cleanbundle exec haml-lint app/views/feedback/show.html.haml— cleanbundle exec rails runner 'puts "boot OK"'— bootsbundle exec rspec spec/controllers/feedback_controller_spec.rb spec/models/feedback_spec.rb— 11 examples, 0 failuresbundle exec rspec spec/features/member_feedback_spec.rb— 9 examples, 0 failuresRAILS_ENV=test bundle exec rails assets:precompile— succeedsManual verification
Start the server:
bundle exec rails serverIn another terminal, open a Rails console and create a feedback request:
Open the printed URL in a browser.
Click stars — they should fill; click the same star again to clear; hover previews.
Select a coach and tutorial, then submit. You should be redirected to the homepage with "Thank you for your feedback".
Check that the rating was persisted:
To test progressive enhancement, disable JavaScript in devtools and reload: the radio buttons should still let you pick a rating and submit.