From 436d80a0977529b4b1c06fa019ae755181bce571 Mon Sep 17 00:00:00 2001 From: boban Date: Sat, 16 May 2026 18:28:27 +0200 Subject: [PATCH] =?UTF-8?q?fix(FIX-13):=208=20bugs=20=E2=80=94=20sidebar?= =?UTF-8?q?=20flash,=20mobile=20hamburger,=20AI=20insights,=20button=20ove?= =?UTF-8?q?rlay,=20QR=20modal=20collapse,=20dashboard=20always-active,=20b?= =?UTF-8?q?io=20themes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - BUG 1: blocking script in reads localStorage before first paint; CSS rule html[data-sidebar-collapsed] .skel-sidebar{width:64px} eliminates width flash - BUG 2: sidebar store gains mobileOpen/toggleMobile()/closeMobile(); hamburger calls toggleMobile(); backdrop and sidebar :style use mobileOpen; SPA navigated handler calls closeMobile() - BUG 3: text-purple → text-accent in AI Insights view (text-purple is undefined) - BUG 4: ui/button.blade.php — spinner is now absolute inset-0 overlay; content fades to opacity-40 via wire:loading.class instead of hiding - BUG 5: insights generate button and QR modal save/cancel migrated to x-ui.button component - BUG 6: QR modal Styling/Frame/Advanced sections replaced from
(destroyed by Livewire re-render) to Alpine x-data{open:false} divs with x-show — state survives wire:model.live updates - BUG 7: updateActiveNav() now checks el.dataset.navExact; Dashboard gets data-nav-exact="1" so it only activates on exact pathname match - BUG 8: bio_pages.theme JSON applied in public show.blade.php via inline CSS vars (4 presets: dark/light/purple/blue); EditBioPage gains theme property with preset selector in modal Co-Authored-By: Claude Sonnet 4.6 --- app/Livewire/Modals/EditBioPage.php | 5 ++ resources/js/bootstrap.js | 13 ++++- resources/views/bio/show.blade.php | 39 ++++++++++++-- resources/views/components/sidebar.blade.php | 3 +- resources/views/components/topbar.blade.php | 2 +- .../views/components/ui/button.blade.php | 5 +- resources/views/layouts/nimuli-app.blade.php | 20 +++++-- .../livewire/modals/create-qr-code.blade.php | 53 +++++++++++-------- .../livewire/modals/edit-bio-page.blade.php | 14 +++++ .../livewire/pages/ai/insights.blade.php | 20 ++----- 10 files changed, 124 insertions(+), 50 deletions(-) diff --git a/app/Livewire/Modals/EditBioPage.php b/app/Livewire/Modals/EditBioPage.php index 9bc620f..7c6b1d0 100644 --- a/app/Livewire/Modals/EditBioPage.php +++ b/app/Livewire/Modals/EditBioPage.php @@ -20,6 +20,8 @@ class EditBioPage extends ModalComponent public bool $isPublished = false; + public string $theme = 'dark'; + public function mount(string $bioUlid): void { $bio = BioPage::where('ulid', $bioUlid)->firstOrFail(); @@ -31,6 +33,7 @@ class EditBioPage extends ModalComponent $this->title = $bio->getTranslation('title', 'en') ?? ''; $this->slug = $bio->slug; $this->isPublished = $bio->is_published; + $this->theme = is_array($bio->theme) ? ($bio->theme['preset'] ?? 'dark') : 'dark'; } /** @return array */ @@ -40,6 +43,7 @@ class EditBioPage extends ModalComponent 'title' => 'required|max:200', 'slug' => 'nullable|alpha_dash|max:80', 'isPublished' => 'boolean', + 'theme' => 'in:dark,light,purple,blue', ]; } @@ -55,6 +59,7 @@ class EditBioPage extends ModalComponent 'title' => ['en' => $this->title, 'de' => $this->title], 'slug' => $this->slug ?: $bio->slug, 'is_published' => $this->isPublished, + 'theme' => ['preset' => $this->theme], ]); $this->dispatch('bio-updated')->to(Index::class); diff --git a/resources/js/bootstrap.js b/resources/js/bootstrap.js index 09554c9..e1e4a90 100644 --- a/resources/js/bootstrap.js +++ b/resources/js/bootstrap.js @@ -60,12 +60,23 @@ document.addEventListener('alpine:init', () => { }); Alpine.store('sidebar', { - open: false, + mobileOpen: false, collapsed: localStorage.getItem('sidebarCollapsed') === 'true', + init() { this._syncDataset(); }, + _syncDataset() { + if (this.collapsed) { + document.documentElement.dataset.sidebarCollapsed = '1'; + } else { + delete document.documentElement.dataset.sidebarCollapsed; + } + }, toggle() { this.collapsed = ! this.collapsed; localStorage.setItem('sidebarCollapsed', this.collapsed); + this._syncDataset(); window.dispatchEvent(new CustomEvent('sidebar-toggled', { detail: { collapsed: this.collapsed } })); }, + toggleMobile() { this.mobileOpen = ! this.mobileOpen; }, + closeMobile() { this.mobileOpen = false; }, }); }); diff --git a/resources/views/bio/show.blade.php b/resources/views/bio/show.blade.php index aeb35d9..a35f6be 100644 --- a/resources/views/bio/show.blade.php +++ b/resources/views/bio/show.blade.php @@ -1,3 +1,13 @@ +@php +$preset = is_array($page->theme) ? ($page->theme['preset'] ?? 'dark') : 'dark'; +$themes = [ + 'dark' => ['bg' => '#0a0a0f', 'card' => '#111117', 'border' => 'rgba(255,255,255,0.08)', 'text' => '#f0f0f5', 'sub' => '#b8b8d0', 'accent' => '#7c3aed'], + 'light' => ['bg' => '#ffffff', 'card' => '#f9fafb', 'border' => '#e5e7eb', 'text' => '#111827', 'sub' => '#6b7280', 'accent' => '#7c3aed'], + 'purple' => ['bg' => '#13001a', 'card' => '#1e0028', 'border' => 'rgba(139,92,246,0.25)', 'text' => '#f0e8ff', 'sub' => '#c4b5fd', 'accent' => '#a855f7'], + 'blue' => ['bg' => '#000d1a', 'card' => '#001c33', 'border' => 'rgba(59,130,246,0.25)', 'text' => '#e8f4ff', 'sub' => '#93c5fd', 'accent' => '#3b82f6'], +]; +$t = $themes[$preset] ?? $themes['dark']; +@endphp @@ -5,21 +15,42 @@ {{ $page->getTranslation('title', app()->getLocale()) }} @vite(['resources/css/app.css']) + - +

{{ $page->getTranslation('title', app()->getLocale()) }}

@if($page->getTranslation('description', app()->getLocale())) -

+

{{ $page->getTranslation('description', app()->getLocale()) }}

@endif
@foreach($page->blocks as $block) -
-
{{ $block->config['content'] ?? '' }}
+
+
{{ $block->config['content'] ?? '' }}
@endforeach
diff --git a/resources/views/components/sidebar.blade.php b/resources/views/components/sidebar.blade.php index 35b77a0..99e7566 100644 --- a/resources/views/components/sidebar.blade.php +++ b/resources/views/components/sidebar.blade.php @@ -100,7 +100,7 @@ x-data="{ wsOpen: false }" :class="$store.sidebar.collapsed ? 'w-16' : 'w-60'" class="fixed inset-y-0 left-0 h-screen flex flex-col bg-s1 border-r border-white/[.06] z-40 -translate-x-full md:translate-x-0 transition-[width,transform] duration-200 ease-in-out" - :style="$store.sidebar?.open ? 'transform: translateX(0)' : null" + :style="$store.sidebar?.mobileOpen ? 'transform: translateX(0)' : null" >
@@ -183,6 +183,7 @@ href="{{ $url }}" wire:navigate data-nav-link="{{ $item['route'] }}" + @if(in_array($item['route'], ['w.dashboard', 'dashboard'])) data-nav-exact="1" @endif :title="$store.sidebar.collapsed ? '{{ $item['label'] }}' : ''" :class="$store.sidebar.collapsed ? 'justify-center px-2 gap-0' : 'gap-3 px-3'" class="flex items-center py-2 rounded-lg text-sm transition-colors group diff --git a/resources/views/components/topbar.blade.php b/resources/views/components/topbar.blade.php index fc15be8..266d7f0 100644 --- a/resources/views/components/topbar.blade.php +++ b/resources/views/components/topbar.blade.php @@ -13,7 +13,7 @@ diff --git a/resources/views/layouts/nimuli-app.blade.php b/resources/views/layouts/nimuli-app.blade.php index d9b9ff3..beb6220 100644 --- a/resources/views/layouts/nimuli-app.blade.php +++ b/resources/views/layouts/nimuli-app.blade.php @@ -15,6 +15,17 @@ + + +