Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Breakout turbo frame when accept Terms of Service. #296

Merged
merged 2 commits into from
Mar 25, 2025

Conversation

kinoppyd
Copy link
Member

Bug

A full reload is needed after agreed to ToS, because the TurboFrames is not replace all buttons.

@kinoppyd kinoppyd requested a review from Copilot March 25, 2025 13:26
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR addresses a bug where accepting the Terms of Service fails to correctly update all TurboFrame components by forcing a full page reload when necessary.

  • In the plans controller, a session flag (breakout_turbo) is set during plan creation.
  • The session card view replaces a custom button with a standardized button partial.
  • The schedules view checks for the breakout flag to determine if a full page reload is required.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
app/controllers/plans_controller.rb Sets a session flag to indicate when a turbo frame full reload is needed.
app/views/components/_session_card.html.erb Updates the button rendering to use a button partial for consistency.
app/views/schedules/index.html.erb Adds a conditional full reload based on a breakout flag from the session.
Comments suppressed due to low confidence (2)

app/controllers/plans_controller.rb:37

  • Consider resetting session[:breakout_turbo] after triggering the full reload to prevent the flag from affecting subsequent page loads.
session[:breakout_turbo] = true

app/views/schedules/index.html.erb:5

  • Ensure that @breakout_turbo is properly assigned from session[:breakout_turbo] before rendering this view, to guarantee the reload condition works as intended.
<% if @breakout_turbo %>

@kinoppyd kinoppyd merged commit a6a9555 into 2025 Mar 25, 2025
2 checks passed
@kinoppyd kinoppyd deleted the fixes/breakout_from_tos branch March 25, 2025 13:28
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.

1 participant