From 70a117d0db6f5ce7c3ee70d847826eaf84b57810 Mon Sep 17 00:00:00 2001 From: npeter83 Date: Fri, 26 Jun 2026 00:00:21 +0200 Subject: [PATCH] fix(messages): make the dock new-message flash actually visible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ring-based flash relied on ring-accent and a CSS transition that never restarted on a repeat message, so it was effectively invisible. Replace it with a keyed inset-glow overlay (animation replays on every flash counter bump, and inset shadow isn't clipped by the window's overflow-hidden) — flashes whether the window is expanded, freshly auto-opened, or minimised. --- frontend/src/components/ChatDock.tsx | 22 ++++++---------------- frontend/src/index.css | 10 ++++++++++ 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/frontend/src/components/ChatDock.tsx b/frontend/src/components/ChatDock.tsx index 12fff57..87dbb0d 100644 --- a/frontend/src/components/ChatDock.tsx +++ b/frontend/src/components/ChatDock.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from "react"; +import { useEffect } from "react"; import { useTranslation } from "react-i18next"; import { useQueryClient } from "@tanstack/react-query"; import { ChevronDown, ChevronUp, X } from "lucide-react"; @@ -51,22 +51,12 @@ export default function ChatDock({ meId }: { meId: number }) { function ChatWindow({ chat, meId }: { chat: DockChat; meId: number }) { const { t } = useTranslation(); - const [flashing, setFlashing] = useState(false); - - // One-shot attention flash whenever a new message bumps the counter. - useEffect(() => { - if (chat.flash <= 0) return; - setFlashing(true); - const id = setTimeout(() => setFlashing(false), 800); - return () => clearTimeout(id); - }, [chat.flash]); - return ( -
+
+ {/* One-shot attention flash on a new message; keyed by the counter so it replays each time. */} + {chat.flash > 0 && ( +
+ )}