From 06df2235d8fbf0e1e64172560387fad63e7e2130 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 04:35:37 +0000 Subject: [PATCH 1/2] Initial plan From 9e91dde35abb6d49155247c5cc17c6724dc2dc5a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 04:38:02 +0000 Subject: [PATCH 2/2] perf/a11y: optimize slide index search and fix duplicate ARIA tabpanel Co-authored-by: AndyH0ng <60703412+AndyH0ng@users.noreply.github.com> --- src/pages/SlidePage.tsx | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/pages/SlidePage.tsx b/src/pages/SlidePage.tsx index db581152..f221daf5 100644 --- a/src/pages/SlidePage.tsx +++ b/src/pages/SlidePage.tsx @@ -22,10 +22,15 @@ export default function SlidePage() { pollingIntervalMs: 15000, }); - const currentSlide = slides?.find((s) => s.slideId === routeSlideId) ?? slides?.[0]; - const currentIndex = currentSlide - ? (slides?.findIndex((s) => s.slideId === currentSlide.slideId) ?? -1) - : -1; + const currentIndexFromRoute = slides?.findIndex((s) => s.slideId === routeSlideId) ?? -1; + const effectiveIndex = + slides && slides.length > 0 + ? currentIndexFromRoute >= 0 + ? currentIndexFromRoute + : 0 + : -1; + const currentSlide = effectiveIndex >= 0 && slides ? slides[effectiveIndex] : undefined; + const currentIndex = effectiveIndex; const hasPrev = currentIndex > 0; const hasNext = !!slides && currentIndex >= 0 && currentIndex < slides.length - 1; @@ -132,12 +137,7 @@ export default function SlidePage() { -
+