From f163c932cfac28ab04103ccef8f3de73f220c99d Mon Sep 17 00:00:00 2001 From: Abhay Singh Date: Wed, 12 Aug 2026 20:55:01 +0530 Subject: [PATCH] fix(web): keep highlights card active index in range on refresh (#1334) Co-authored-by: Vedant Mahajan --- apps/web/components/highlights-card.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/web/components/highlights-card.tsx b/apps/web/components/highlights-card.tsx index 38257d2e..6caaadf7 100644 --- a/apps/web/components/highlights-card.tsx +++ b/apps/web/components/highlights-card.tsx @@ -92,8 +92,8 @@ export function HighlightsCard({ if (isReplyOpen) replyInputRef.current?.focus() }, [isReplyOpen]) - // biome-ignore lint/correctness/useExhaustiveDependencies: intentionally re-run when items changes useEffect(() => { + setActiveIndex((i) => Math.min(i, Math.max(items.length - 1, 0))) setIsReplyOpen(false) setReplyText("") setIsExpanded(false)