Skip to content

Scope rating submissions to their own turbo frame#1134

Merged
amatsuda merged 1 commit into
rubycentral:mainfrom
amatsuda:rating_frame_split
Jul 11, 2026
Merged

Scope rating submissions to their own turbo frame#1134
amatsuda merged 1 commit into
rubycentral:mainfrom
amatsuda:rating_frame_split

Conversation

@amatsuda

Copy link
Copy Markdown
Collaborator

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.

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 unasuke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was reviewed on my local env and it works. Thank you!

@amatsuda amatsuda merged commit 89249c3 into rubycentral:main Jul 11, 2026
1 check passed
@amatsuda amatsuda deleted the rating_frame_split branch July 11, 2026 04:04
@amatsuda

Copy link
Copy Markdown
Collaborator Author

@unasuke Merged. Thank you for reviewing!

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.

2 participants