From 393dcbb6cd193e61ba14ce43fc85f685af767903 Mon Sep 17 00:00:00 2001
From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com>
Date: Tue, 6 Oct 2026 22:09:27 +0200
Subject: [PATCH] fix(logs): wrap viewer in a root element for parent
re-renders
---
.../livewire/project/shared/get-logs.blade.php | 2 ++
.../TaskAndLogOutputVisibilityTest.php | 13 +++++++++++++
2 files changed, 15 insertions(+)
diff --git a/resources/views/livewire/project/shared/get-logs.blade.php b/resources/views/livewire/project/shared/get-logs.blade.php
index e05ef34eaa..7b000c8a78 100644
--- a/resources/views/livewire/project/shared/get-logs.blade.php
+++ b/resources/views/livewire/project/shared/get-logs.blade.php
@@ -1,3 +1,4 @@
+
@if (! $canReadLogs)
Container logs can contain secrets.
@@ -315,3 +316,4 @@
@endif
+
diff --git a/tests/Feature/Authorization/TaskAndLogOutputVisibilityTest.php b/tests/Feature/Authorization/TaskAndLogOutputVisibilityTest.php
index eb51d9c4b3..891711458b 100644
--- a/tests/Feature/Authorization/TaskAndLogOutputVisibilityTest.php
+++ b/tests/Feature/Authorization/TaskAndLogOutputVisibilityTest.php
@@ -136,3 +136,16 @@ it('shows task commands and task output to an owner in the ui', function () {
Livewire::test(GetLogs::class, ['server' => $this->server, 'resource' => $this->application, 'container' => 'app-container'])
->assertDontSee('Hidden (only admins can view)');
});
+
+it('renders logs inside one root element so the parent can re-render it', function (string $role) {
+ $this->actingAs($role === 'owner' ? $this->owner : $this->member);
+ session(['currentTeam' => $this->team]);
+
+ $html = Livewire::test(GetLogs::class, ['server' => $this->server, 'resource' => $this->application, 'container' => 'app-container'])
+ ->html();
+
+ // Livewire reuses the first tag name as the placeholder for kept children; a leading comment gives an empty tag.
+ preg_match('/<([a-zA-Z0-9\-]*)/', $html, $matches);
+
+ expect($matches[1])->toBe('div');
+})->with(['owner', 'member']);