From d805dbc4076dc06c4d7e5023f99be4c420219975 Mon Sep 17 00:00:00 2001 From: Andreas Reinhold / reini Date: Sun, 13 Sep 2026 14:39:26 +0200 Subject: [PATCH] Lay the scheme picker out as tiles and pass its attributes to the group The check sat beside the name and truncated it at four columns; it now sits in the tile's corner under the swatch dots. Attributes other than the binding (data-test, class) reach the fieldset, and the dots' ring follows the selected tile's colour. Co-Authored-By: Claude Opus 5 (1M context) Claude-Session: https://claude.ai/code/session_01V9NnLxnPp8vaaurb3Z1MFy --- resources/views/components/scheme-picker.blade.php | 13 ++++++++----- tests/Feature/Components/SchemePickerTest.php | 8 ++++++++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/resources/views/components/scheme-picker.blade.php b/resources/views/components/scheme-picker.blade.php index 09ad1c0b..1c9172c6 100644 --- a/resources/views/components/scheme-picker.blade.php +++ b/resources/views/components/scheme-picker.blade.php @@ -29,7 +29,7 @@ @endphp @if ($profiles !== []) -
only(['class', 'wire:key'])->class('min-w-0') }}> +
whereDoesntStartWith(['wire:model', 'x-model'])->except('name')->class('min-w-0') }}> @if (filled($label)) {{ $label }} @endif @@ -38,7 +38,7 @@ @foreach ($profiles as $profile => $scheme) @endforeach diff --git a/tests/Feature/Components/SchemePickerTest.php b/tests/Feature/Components/SchemePickerTest.php index dea189fc..7b770401 100644 --- a/tests/Feature/Components/SchemePickerTest.php +++ b/tests/Feature/Components/SchemePickerTest.php @@ -32,6 +32,14 @@ it('draws a radio per generated profile, bound, named and previewing on change', ->toContain('style="--swatch-light: #00897b; --swatch-dark: #80cbc4"'); }); +it('puts its other attributes on the group and the binding on the radios', function () { + $html = (string) $this->blade(''); + + expect($html)->toMatch('/
/') + ->and(substr_count($html, 'wire:model="colorProfile"'))->toBe(2) + ->and(substr_count($html, 'data-test="color-profile"'))->toBe(1); +}); + it('keeps its inline styles to the scheme file\'s checked colours', function () { File::put($this->path, json_encode([ 'default' => 'indigo',