From 6948c134e3850d229a89af6b7313587bc6cf3b31 Mon Sep 17 00:00:00 2001 From: elvira Date: Tue, 3 Nov 2026 00:01:21 +0200 Subject: [PATCH] Header: give the cart badge a stable id for islands The badge is absolute inside the fixed-size cart button, so showing it or growing from 1 to 2 digits doesn't move the header. Adds #cart-badge as a Turbo Stream target and records the rule that no island may change the size of its container. cart-count-controller is unchanged. Co-Authored-By: Claude Opus 5.5 --- resources/views/components/header.blade.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/resources/views/components/header.blade.php b/resources/views/components/header.blade.php index c8d413e..99219aa 100644 --- a/resources/views/components/header.blade.php +++ b/resources/views/components/header.blade.php @@ -74,7 +74,13 @@ class="relative flex items-center justify-center w-10 h-10 hover:opacity-70 tran data-action="cart-count#open" > + {{-- Island target: the count will come from the islands request + (Turbo Stream on #cart-badge). It's absolute inside the + fixed-size button, so showing it or going from 1 to 2 digits + never moves the header. Rule for every island: it may never + change the size of its container. --}}