From 6c81dd1d482992ac1a15be1b3b980ed0280e4b93 Mon Sep 17 00:00:00 2001 From: boban Date: Sat, 16 May 2026 13:23:44 +0200 Subject: [PATCH] fix: eliminate FOUC, Echo, modal duplicate, icons, test DB isolation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - FIX 1: Remove duplicate modal container (keep @livewire directive, drop ) - FIX 2: Add Laravel Echo + Pusher to bootstrap.js with Reverb config - FIX 3: Cookie-based theme — exclude nimuli_theme from encryption, write cookie in Alpine store, read server-side in layout - FIX 4: Generate missing PNG favicons (16/32/180/192/512px) via GD - FIX 5: Create scripts/verify-modals.sh (27 checks, all green) - BUG: Docker OS env DB_CONNECTION=mysql was overriding phpunit.xml sqlite config, causing RefreshDatabase to migrate:fresh production MySQL — fixed by forcing DB vars in tests/bootstrap.php alongside existing APP_ENV fix Co-Authored-By: Claude Sonnet 4.6 --- bootstrap/app.php | 2 + public/android-chrome-192x192.png | Bin 0 -> 618 bytes public/android-chrome-512x512.png | Bin 0 -> 1941 bytes public/apple-touch-icon.png | Bin 0 -> 569 bytes public/favicon-16x16.png | Bin 0 -> 145 bytes public/favicon-32x32.png | Bin 0 -> 171 bytes resources/js/app.js | 1 + resources/js/bootstrap.js | 15 +- resources/views/layouts/nimuli-app.blade.php | 9 +- scripts/verify-modals.sh | 150 +++++++++++++++++++ tests/bootstrap.php | 12 +- 11 files changed, 181 insertions(+), 8 deletions(-) create mode 100644 public/android-chrome-192x192.png create mode 100644 public/android-chrome-512x512.png create mode 100644 public/apple-touch-icon.png create mode 100644 public/favicon-16x16.png create mode 100644 public/favicon-32x32.png create mode 100755 scripts/verify-modals.sh diff --git a/bootstrap/app.php b/bootstrap/app.php index 1ac8199..f7b9c20 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -17,6 +17,8 @@ return Application::configure(basePath: dirname(__DIR__)) ->withMiddleware(function (Middleware $middleware): void { $middleware->trustProxies(at: '*'); + $middleware->encryptCookies(except: ['nimuli_theme']); + $middleware->web(append: [ LocaleFromUser::class, SecurityHeaders::class, diff --git a/public/android-chrome-192x192.png b/public/android-chrome-192x192.png new file mode 100644 index 0000000000000000000000000000000000000000..5199f8d92475148b85d4d4d7c6d1bc443f4ab932 GIT binary patch literal 618 zcmeAS@N?(olHy`uVBq!ia0vp^2SAvE2}s`E_d5VcaTa()7BevL9RXp+soH$f3=B*% zo-U3d6?5KR*~r_(AmSQWz;gWH)eS{v#}7*C_~`T~eH1(LWX`AX{W~fj+vqa?d9~p? z^B;4@i5wj+4k}Daf&!fl9xN_O3PM9(=*88iReNIkUyILU`7$rbOz48U)Ga5VAFJNi z?BaFHU&8j50rWdDD0PKZe}HA_&mpbdq&$qL{AxUSls{ P;$iS~^>bP0l+XkKIRT&Y literal 0 HcmV?d00001 diff --git a/public/android-chrome-512x512.png b/public/android-chrome-512x512.png new file mode 100644 index 0000000000000000000000000000000000000000..f81e0b9fbcf0192550af2d4b55f18ed01aeef55e GIT binary patch literal 1941 zcmeAS@N?(olHy`uVBq!ia0y~yU;;9k7&t&wwUqN(AjMhW5n0T@z;^_M8K-LVNi#68 zyL-AghE&XXdwrp3vxA81K~>cNzD!<`t$}=38an!83)7#hTK{d{_BXd}8D9K6W5>{7 z$-H$n+h;3FnGH9xvXAA0bD7GEI!!w)axjT`8P_4dL+jg<{I5stKb+5L+9bMP p^+s;Pi-j{Me~3P0@k2hF;VN}mWCW_Hb)r; zhqYg=**4i2X4D*TSf}psnehmpRFngo!cC?i+k+NSFZ-hmvJS3bZDC~CBPa59g;Dlu PphXOxu6{1-oD!M { this.current = theme; document.documentElement.dataset.theme = theme; localStorage.setItem('nimuli_theme', theme); + document.cookie = 'nimuli_theme=' + theme + '; path=/; max-age=31536000; SameSite=Lax'; }, cycle() { const order = ['dark', 'light', 'system']; diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index 5f1390b..fb8b32e 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -1,4 +1,17 @@ import axios from 'axios'; window.axios = axios; - window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'; + +import Echo from 'laravel-echo'; +import Pusher from 'pusher-js'; +window.Pusher = Pusher; + +window.Echo = new Echo({ + broadcaster: 'reverb', + key: import.meta.env.VITE_REVERB_APP_KEY, + wsHost: import.meta.env.VITE_REVERB_HOST, + wsPort: import.meta.env.VITE_REVERB_PORT ?? 443, + wssPort: import.meta.env.VITE_REVERB_PORT ?? 443, + forceTLS: (import.meta.env.VITE_REVERB_SCHEME ?? 'https') === 'https', + enabledTransports: ['ws', 'wss'], +}); diff --git a/resources/views/layouts/nimuli-app.blade.php b/resources/views/layouts/nimuli-app.blade.php index 388c132..eedb290 100644 --- a/resources/views/layouts/nimuli-app.blade.php +++ b/resources/views/layouts/nimuli-app.blade.php @@ -1,5 +1,5 @@ - + @@ -19,7 +19,7 @@