From 323ed9c137ed0a431ce2e64fd34ec5421524d196 Mon Sep 17 00:00:00 2001 From: Usman Baig Date: Wed, 18 Mar 2026 21:20:08 +0100 Subject: [PATCH] fix: add skeleton loading for favicon in site picker Show a pulsing placeholder while the favicon loads from Google's service instead of an empty container. --- components/dashboard/Sidebar.tsx | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/components/dashboard/Sidebar.tsx b/components/dashboard/Sidebar.tsx index c6752d6..229df36 100644 --- a/components/dashboard/Sidebar.tsx +++ b/components/dashboard/Sidebar.tsx @@ -82,6 +82,7 @@ function SitePicker({ sites, siteId, collapsed, onExpand, onCollapse, wasCollaps const [open, setOpen] = useState(false) const [search, setSearch] = useState('') const [faviconFailed, setFaviconFailed] = useState(false) + const [faviconLoaded, setFaviconLoaded] = useState(false) const ref = useRef(null) const pathname = usePathname() const router = useRouter() @@ -129,14 +130,18 @@ function SitePicker({ sites, siteId, collapsed, onExpand, onCollapse, wasCollaps className="w-full flex items-center gap-2.5 rounded-lg px-2.5 py-2 text-sm font-medium text-neutral-700 dark:text-neutral-200 hover:bg-neutral-100 dark:hover:bg-neutral-800 overflow-hidden" > - {faviconUrl && !faviconFailed && ( - setFaviconFailed(true)} - /> - )} + {faviconUrl && !faviconFailed ? ( + <> + {!faviconLoaded && } + setFaviconLoaded(true)} + onError={() => setFaviconFailed(true)} + /> + + ) : null}