Skip to content

Re-enable Turbo Drive on Recipients Shout-Out Form - #2643

Open
1steve78 wants to merge 4 commits into
rubyforgood:mainfrom
1steve78:enable-turbo-on-recipient-shoutout
Open

1steve78 wants to merge 4 commits into
rubyforgood:mainfrom
1steve78:enable-turbo-on-recipient-shoutout

Conversation

@1steve78

@1steve78 1steve78 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Re-enable Turbo Drive on recipients shout-out form and ensure 303 redirect

Re-enables Turbo Drive on the recipients page shout-out form and aligns controller guard redirects with HTTP 303 See Other so submissions feel faster and avoid unnecessary full-page reloads.

What is the goal of this PR and why is this important?

How did you approach the change?

  • Controller status codes: Added status: :see_other (303) to the guard redirect in EventsController#feature_recipient_shoutout when the recipient selection is blank or locked.
  • Form opt-out removal: Removed data: { turbo: false } from the shout-out form_with block.
  • Submit-in-progress state: Added data-turbo-submits-with="Adding…" to the submit button.
  • Request specs: Updated spec/requests/events_spec.rb to assert have_http_status(:see_other) across the relevant redirect pathways.
  • System specs: Added spec/system/events_recipient_shoutout_spec.rb to verify Turbo submission, TomSelect selection, alert rendering, and button disabling.

UI testing checklist

  • Visit an event's recipients page (/events/:id/recipients) as an admin.
  • Select a scholarship recipient from the dropdown and click Add shoutout. Verify the button displays “Adding…” and the request redirects to the registration edit form.
  • Confirm the registration's shout-out toggle is enabled and any seeded bio appears.
  • Return to the recipients page and submit without selecting a recipient. Verify the warning alert, “Choose a recipient to feature.”, displays correctly under Turbo Drive.

Anything else to add?

  • searchable_select_controller.js already implements Turbo cache and disconnect() teardown handlers, so no JavaScript changes were required.
  • This is the first PR in the incremental series to safely re-enable Turbo Drive across the application.

1steve78 and others added 3 commits October 12, 2026 23:21
Turbo drops the fragment when following a 303 form redirect, leaving admins at the top of the registration editor. Carry the section target in a query parameter and let the existing reveal controller scroll to it.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@1steve78
1steve78 force-pushed the enable-turbo-on-recipient-shoutout branch from 5812a32 to 1053517 Compare October 12, 2026 17:52
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