Files
elviraandClaude Opus 5.5 f0a1b928dd Reviews: submit without a redirect, answered with Turbo Streams
The review form now submits through Turbo (data-turbo="true"; Drive
stays off) and storeReview answers with Turbo Streams instead of a
redirect with flashed data:
- success: the new review is prepended to the list (same Blade partial
  as the existing ones), the empty message is removed, the stars/count
  under the title and the tab label are updated (count and average from
  the DB, which is what the index builds them from), the form is removed
  and the thank-you goes into a live region and gets focus
- validation error: 422 + a stream that replaces the form with inline
  errors (aria-invalid/aria-describedby) and the entered values, focus on
  the first invalid field

Nothing on the product page reads the session any more: no
session('reviewSubmitted'), old() or $errors, and
mergeJustSubmittedReview and the justSubmittedReview flash are gone.
searchableSync() stays.

Without JS it's a plain POST that redirects back to ?tab=reviews,
without inline errors or the thank-you, and the new review shows once
Meilisearch catches up. The ?tab=reviews query parameter is noted in
the controller as a variant to handle once product pages are cached.

New: product/partials/review, product/partials/rating-summary,
product/streams/review-stored|review-invalid, and a small
focus-on-connect Stimulus controller that only appears on streamed
markup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-03 00:09:58 +02:00
..
2026-10-26 16:06:55 +02:00