From ba872e2ecfd08f050165b44e693b56a8eed02bdd Mon Sep 17 00:00:00 2001 From: xRangerDE Date: Mon, 11 May 2026 09:54:40 +0200 Subject: [PATCH] =?UTF-8?q?cleanup:=20default=20accent=20color=20baked=20i?= =?UTF-8?q?nto=20.chat-viewer-user=20=E2=80=94=20kills=20one=20branch=20of?= =?UTF-8?q?=20inline-style=20fallback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit renderChatList in renderer.ts was setting uSpan.style.color twice: once with the per-user IRC color when m.color was present, and once as a fallback to var(--accent) when it wasn't. The fallback is exactly the styling .chat-viewer-user should own by default. Moved color: var(--accent) into the .chat-viewer-user CSS rule next to its font-weight + margin-right. The renderer's per-user color override stays inline because it's truly dynamic (parsed from chat IRC payload), but the no-color path no longer needs to assign anything — the class default takes over. One inline .style.color assignment + one else branch gone, semantics preserved. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/renderer.ts | 4 ++-- src/styles.css | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/renderer.ts b/src/renderer.ts index b0870c5..a99f27d 100644 --- a/src/renderer.ts +++ b/src/renderer.ts @@ -512,9 +512,9 @@ function renderChatViewerList(messages: ChatViewerMessage[]): void { if (user) { const uSpan = document.createElement('span'); uSpan.className = 'chat-viewer-user'; - // Per-user IRC color is preserved; the class supplies weight. + // Per-user IRC color overrides the default accent colour + // supplied by .chat-viewer-user; the class also sets weight. if (m.color) uSpan.style.color = m.color; - else uSpan.style.color = 'var(--accent)'; uSpan.textContent = `${user}:`; row.appendChild(uSpan); } diff --git a/src/styles.css b/src/styles.css index 608f3c6..1b2c2d2 100644 --- a/src/styles.css +++ b/src/styles.css @@ -3823,6 +3823,7 @@ input[type="number"]::-webkit-outer-spin-button { .chat-viewer-row .chat-viewer-user { font-weight: 700; margin-right: 4px; + color: var(--accent); } .chat-viewer-row .chat-viewer-tag {