From 0393d4e931d6af79d7cf18e42d60c9223070930a Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Tue, 29 Sep 2026 09:58:54 +0200 Subject: [PATCH] fix(ui): move deployments indicator into the sidebar The floating bottom-left pill and its expanded list covered page content. - Desktop: show a compact 'N deployments' row in the sticky sidebar footer (spinner with count badge when the sidebar is collapsed); the list opens to the right of the sidebar - Mobile: show a spinner with the count in the top bar; the list opens below the top bar - Poll only the copy visible at the current breakpoint (wire:poll.visible) - Show the indicator on the dashboard too, and drop the path-based visibility logic and its navigate round trip --- app/Livewire/DeploymentsIndicator.php | 38 +--- resources/views/components/navbar.blade.php | 28 +-- resources/views/layouts/app.blade.php | 5 +- .../livewire/deployments-indicator.blade.php | 179 ++++++++++-------- ...yTest.php => DeploymentsIndicatorTest.php} | 46 ++--- 5 files changed, 133 insertions(+), 163 deletions(-) rename tests/Feature/{DeploymentsIndicatorDashboardVisibilityTest.php => DeploymentsIndicatorTest.php} (63%) diff --git a/app/Livewire/DeploymentsIndicator.php b/app/Livewire/DeploymentsIndicator.php index 28c9a00c61..e6b68a62b7 100644 --- a/app/Livewire/DeploymentsIndicator.php +++ b/app/Livewire/DeploymentsIndicator.php @@ -9,23 +9,10 @@ use Livewire\Component; class DeploymentsIndicator extends Component { - public bool $expanded = false; - /** - * Persisted across polls. Livewire update requests are not the page route, - * so this must not be re-derived from request()->routeIs() on every render. + * Where the indicator is rendered: 'sidebar' (desktop sidebar footer) or 'mobile' (mobile top bar). */ - public bool $shouldShow = true; - - public function mount(): void - { - $this->shouldShow = $this->shouldShowForCurrentRequest(); - } - - public function updateShouldShowFromPath(string $path): void - { - $this->shouldShow = ! $this->isDashboardPath($path); - } + public string $variant = 'sidebar'; #[Computed] public function deployments() @@ -54,29 +41,8 @@ class DeploymentsIndicator extends Component return $this->deployments->count(); } - public function toggleExpanded() - { - $this->expanded = ! $this->expanded; - } - public function render() { return view('livewire.deployments-indicator'); } - - private function shouldShowForCurrentRequest(): bool - { - if (request()->routeIs('dashboard')) { - return false; - } - - return ! $this->isDashboardPath(request()->path()); - } - - private function isDashboardPath(string $path): bool - { - $normalized = trim($path, '/'); - - return $normalized === '' || $normalized === '/'; - } } diff --git a/resources/views/components/navbar.blade.php b/resources/views/components/navbar.blade.php index 6975eb1e0e..ad6a8cd61f 100644 --- a/resources/views/components/navbar.blade.php +++ b/resources/views/components/navbar.blade.php @@ -1,3 +1,5 @@ +@props(['deploymentsIndicator' => false]) +