From c046b186aa598a71c8ac979027da8ab137d3f17e Mon Sep 17 00:00:00 2001 From: Aditya Tripathi Date: Fri, 11 Sep 2026 06:38:48 +0000 Subject: [PATCH] feat(ui): optimistic updates for notifications and resource actions - Notification channels: flip enable/disable label + highlight instantly, roll back on error (all 6 channels via shared channel-actions) - Database heading: Start/Restart show instant Starting/Restarting state + spinner, disable during the request - Service heading: Restart now reuses the deploying state (spinner + Restarting label), matching the existing Deploy pattern --- .../notification/channel-actions.blade.php | 11 ++-- .../project/database/heading.blade.php | 50 ++++++++++++------- .../project/service/heading.blade.php | 20 +++++--- 3 files changed, 55 insertions(+), 26 deletions(-) diff --git a/resources/views/components/notification/channel-actions.blade.php b/resources/views/components/notification/channel-actions.blade.php index 677b4b0c6f..37f7ee963f 100644 --- a/resources/views/components/notification/channel-actions.blade.php +++ b/resources/views/components/notification/channel-actions.blade.php @@ -13,12 +13,17 @@ toggleMethod: @js($toggleMethod), testMethod: @js($testMethod), }"> - - {{ $enabled ? 'Disable' : 'Enable' }} + {{ $enabled ? 'Disable' : 'Enable' }} diff --git a/resources/views/livewire/project/database/heading.blade.php b/resources/views/livewire/project/database/heading.blade.php index 2d28510165..769e7ecdb2 100644 --- a/resources/views/livewire/project/database/heading.blade.php +++ b/resources/views/livewire/project/database/heading.blade.php @@ -57,7 +57,8 @@ -
+

@@ -77,9 +78,11 @@ @can('manage', $database) @if (! $databaseStatus->startsWith('exited')) - - - Restart + + + + Restart @else - - - Start + + + + Start @endif @@ -107,9 +111,11 @@ @can('manage', $database) @if (! $databaseStatus->startsWith('exited')) - - - Restart + + + + Restart @else - - - Start + + + + Start @endif @@ -162,14 +169,23 @@ @script @endscript diff --git a/resources/views/livewire/project/service/heading.blade.php b/resources/views/livewire/project/service/heading.blade.php index 8c6531f3bc..820163ddb1 100644 --- a/resources/views/livewire/project/service/heading.blade.php +++ b/resources/views/livewire/project/service/heading.blade.php @@ -65,7 +65,8 @@ -
+

@@ -95,8 +96,9 @@ @elseif ($serviceStatus->contains('running') || $serviceStatus->contains('degraded')) - - Restart + + + Restart @if ($serviceStatus->contains('running'))