Scope rating submissions to their own turbo frame#1134
Merged
Conversation
Star-rating clicks used to re-render the whole rating widget, clobbering any internal-comment draft mid-typing (the motivating gap in PR rubycentral#1133's localStorage approach). The rating form now lives in a nested rating_form frame; the controller responds with Turbo Streams so each transition replaces exactly what it changes: score updates swap only the rating form, while the first rating and rating removal still replace the whole widget (they toggle the internal-comments block's visibility). A localStorage layer for true page reloads (PR rubycentral#1133) remains complementary; with this change it no longer needs to compensate for in-page re-renders. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
unasuke
approved these changes
Jul 11, 2026
unasuke
left a comment
Contributor
There was a problem hiding this comment.
I was reviewed on my local env and it works. Thank you!
Collaborator
Author
|
@unasuke Merged. Thank you for reviewing! |
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.
Star-rating clicks used to re-render the whole rating widget, clobbering any internal-comment draft mid-typing (the motivating gap in PR #1133's localStorage approach). The rating form now lives in a nested rating_form frame; the controller responds with Turbo Streams so each transition replaces exactly what it changes: score updates swap only the rating form, while the first rating and rating removal still replace the whole widget (they toggle the internal-comments block's visibility).
A localStorage layer for true page reloads (PR #1133) remains complementary; with this change it no longer needs to compensate for in-page re-renders.