From 7fb3b85a645cc451f973da281ce6aebcab855599 Mon Sep 17 00:00:00 2001 From: ciregenz Date: Thu, 30 Jul 2026 12:03:29 -0700 Subject: [PATCH] [eric] dock: show the favicon INSTEAD of the browser glyph (it used to sit behind it), glyph returns if the favicon fails --- .../pages/Dashboard/desktop/DesktopDock.tsx | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/frontend/src/app/pages/Dashboard/desktop/DesktopDock.tsx b/frontend/src/app/pages/Dashboard/desktop/DesktopDock.tsx index 95787492..8e6f7997 100644 --- a/frontend/src/app/pages/Dashboard/desktop/DesktopDock.tsx +++ b/frontend/src/app/pages/Dashboard/desktop/DesktopDock.tsx @@ -35,6 +35,21 @@ interface DesktopDockProps { const TILE = 30; const PREVIEW_W = 190; +/** A tile shows its site favicon OR the generic glyph, never the glyph peeking out from behind the favicon. */ +function DockTileIcon({ entry }: { entry: DockEntry }): React.ReactElement { + const [faviconFailed, setFaviconFailed] = useState(false); + if (!entry.faviconUrl || faviconFailed) return <>{entry.icon}; + return ( + setFaviconFailed(true)} + sx={{ width: 18, height: 18, borderRadius: '6px' }} + /> + ); +} + /** Left-edge desktop dock: one tile per open card, hover previews, click focuses the window. */ function DesktopDock({ sessions, @@ -177,16 +192,8 @@ function DesktopDock({ ...(isActive && { outline: '2px solid #6aa2ff', outlineOffset: '2px' }), }} > - {entry.icon} - {entry.faviconUrl && ( - ) => { e.currentTarget.style.display = 'none'; }} - sx={{ position: 'absolute', width: 18, height: 18, borderRadius: '6px' }} - /> - )} + {/* Keyed by url so navigating to a new site re-arms the favicon after a previous one failed. */} + ); })}