From 256ebb73685519832344bb0be8513db816a3e742 Mon Sep 17 00:00:00 2001 From: xintaofei Date: Tue, 21 Apr 2026 21:28:40 +0800 Subject: [PATCH] fix(sidebar): guard virtualizer itemSize against non-finite zoom level --- .../conversations/sidebar-conversation-list.tsx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/components/conversations/sidebar-conversation-list.tsx b/src/components/conversations/sidebar-conversation-list.tsx index 73297b5..10a86fa 100644 --- a/src/components/conversations/sidebar-conversation-list.tsx +++ b/src/components/conversations/sidebar-conversation-list.tsx @@ -216,7 +216,14 @@ export function SidebarConversationList({ const t = useTranslations("Folder.sidebar") const tCommon = useTranslations("Folder.common") const { zoomLevel } = useZoomLevel() - const cardHeightPx = (CARD_HEIGHT_REM * 16 * zoomLevel) / 100 + const safeZoomLevel = + typeof zoomLevel === "number" && Number.isFinite(zoomLevel) && zoomLevel > 0 + ? zoomLevel + : 100 + const cardHeightPx = Math.max( + 1, + Math.round((CARD_HEIGHT_REM * 16 * safeZoomLevel) / 100) + ) const { allFolders, conversations,