From 20a9855c04573530cd2772c5c4c4610cd87c492f Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Sat, 13 Dec 2025 21:42:19 +0100 Subject: [PATCH] Address CodeRabbit review feedback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix null-safe operator on currentTeam() call in Upgrade.php - Add --rm flag to docker run in upgrade.sh for cleanup consistency - Store beforeunload handler as named reference and clean up on success - Add clarifying comments for upgrade method calls - Add error state handling with close option in upgrade modal - Add step mapping documentation comment in upgrade-progress component 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- app/Livewire/Upgrade.php | 2 +- .../components/upgrade-progress.blade.php | 9 +++ resources/views/livewire/upgrade.blade.php | 72 +++++++++++++++++-- scripts/upgrade.sh | 2 +- 4 files changed, 78 insertions(+), 7 deletions(-) diff --git a/app/Livewire/Upgrade.php b/app/Livewire/Upgrade.php index 70723135f..37cc8ec28 100644 --- a/app/Livewire/Upgrade.php +++ b/app/Livewire/Upgrade.php @@ -55,7 +55,7 @@ public function upgrade() public function getUpgradeStatus(): array { // Only root team members can view upgrade status - if (auth()->user()?->currentTeam()->id !== 0) { + if (auth()->user()?->currentTeam()?->id !== 0) { return ['status' => 'none']; } diff --git a/resources/views/components/upgrade-progress.blade.php b/resources/views/components/upgrade-progress.blade.php index 13eca4f5b..d65273cce 100644 --- a/resources/views/components/upgrade-progress.blade.php +++ b/resources/views/components/upgrade-progress.blade.php @@ -1,5 +1,14 @@ @props(['step' => 0]) +{{-- + Step Mapping (Backend → UI): + Backend steps 1-2 (config download, env update) → UI Step 1: Preparing + Backend step 3 (pulling images) → UI Step 2: Helper + UI Step 3: Image + Backend steps 4-5 (stop/start containers) → UI Step 4: Restart + Backend step 6 (complete) → mapped in JS mapStepToUI() in upgrade.blade.php + + The currentStep variable is inherited from parent Alpine component (upgradeModal). +--}}
{{-- Step 1: Preparing --}} diff --git a/resources/views/livewire/upgrade.blade.php b/resources/views/livewire/upgrade.blade.php index d9d717f44..dcc664e84 100644 --- a/resources/views/livewire/upgrade.blade.php +++ b/resources/views/livewire/upgrade.blade.php @@ -51,7 +51,7 @@ class="relative w-full py-6 border rounded-sm min-w-full lg:min-w-[36rem] max-w- {{ $currentVersion }} {{ $latestVersion }}
-