From 40b1b1319ff10a2ff0cc50b983a0700a7d1ca57a Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 18 Dec 2025 06:14:42 +0000 Subject: [PATCH 1/3] Improve logging view performance to prevent browser freezing - Use CSS content-visibility: auto for lazy rendering of off-screen log lines - Replace setInterval auto-scroll with requestAnimationFrame for smoother scrolling - Cache HTML entity decoding to avoid repeated DOMParser calls (up to 5000 entries) - Cache match count calculations to prevent repeated DOM queries - Debounce search input (300ms) in deployment logs view - Debounce Livewire render updates (100ms) to batch rapid changes - Add log-line utility class with content-visibility optimization - Add log-highlight utility class for search result highlighting These changes address browser freezing when viewing deployment logs with 3500+ lines (GitHub issue #7668). The content-visibility CSS property lets the browser skip rendering of off-screen content, significantly reducing initial render time and memory usage. Fixes #7668 --- resources/css/utilities.css | 11 ++ .../application/deployment/show.blade.php | 106 +++++++++++------- .../project/shared/get-logs.blade.php | 97 +++++++++++----- 3 files changed, 147 insertions(+), 67 deletions(-) diff --git a/resources/css/utilities.css b/resources/css/utilities.css index abb177835..4f8230487 100644 --- a/resources/css/utilities.css +++ b/resources/css/utilities.css @@ -292,3 +292,14 @@ @utility dz-button { @utility xterm { @apply p-2; } + +/* Log line optimization - uses content-visibility for lazy rendering of off-screen log lines */ +@utility log-line { + content-visibility: auto; + contain-intrinsic-size: auto 1.5em; +} + +/* Search highlight styling for logs */ +@utility log-highlight { + @apply bg-warning/40 dark:bg-warning/30 rounded-sm px-0.5; +} diff --git a/resources/views/livewire/project/application/deployment/show.blade.php b/resources/views/livewire/project/application/deployment/show.blade.php index 5f37786f5..8b50e523b 100644 --- a/resources/views/livewire/project/application/deployment/show.blade.php +++ b/resources/views/livewire/project/application/deployment/show.blade.php @@ -8,26 +8,44 @@
@@ -212,7 +240,7 @@ class="text-xs text-gray-500 dark:text-gray-400 whitespace-nowrap"> -