From 334fd2500fea9adb2e1ae0eb6cfef86238c9004f Mon Sep 17 00:00:00 2001 From: Andras Bacsai <5845193+andrasbacsai@users.noreply.github.com> Date: Thu, 18 Dec 2025 12:43:42 +0100 Subject: [PATCH] Fix color highlighting not applying on initial runtime logs load MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added morph.added hook to apply color highlighting when logs are first loaded. The morph.updated hook only fires on subsequent updates, not on initial DOM insertion. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- .../project/shared/get-logs.blade.php | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/resources/views/livewire/project/shared/get-logs.blade.php b/resources/views/livewire/project/shared/get-logs.blade.php index 2be3d3a32..9fcd52cd7 100644 --- a/resources/views/livewire/project/shared/get-logs.blade.php +++ b/resources/views/livewire/project/shared/get-logs.blade.php @@ -192,16 +192,28 @@ this.applySearch(); }); - // Apply colors after Livewire updates + // Handler for applying colors and search after DOM changes + const applyAfterUpdate = () => { + this.$nextTick(() => { + this.applyColorLogs(); + this.applySearch(); + if (this.alwaysScroll) { + this.scrollToBottom(); + } + }); + }; + + // Apply colors after Livewire updates (existing content) Livewire.hook('morph.updated', ({ el }) => { if (el.id === 'logs') { - this.$nextTick(() => { - this.applyColorLogs(); - this.applySearch(); - if (this.alwaysScroll) { - this.scrollToBottom(); - } - }); + applyAfterUpdate(); + } + }); + + // Apply colors after Livewire adds new content (initial load) + Livewire.hook('morph.added', ({ el }) => { + if (el.id === 'logs') { + applyAfterUpdate(); } }); }