From 13a5a9e2143a2f4673c14c6d6f4e299faaba82c9 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Sun, 22 Nov 2026 06:58:23 -0500 Subject: [PATCH 1/3] Apply suggested fix to web/js/components/preact/HLSVideoCell.tsx from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- web/js/components/preact/HLSVideoCell.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/web/js/components/preact/HLSVideoCell.tsx b/web/js/components/preact/HLSVideoCell.tsx index 5f9ba5e0b..cbf8e2ad1 100644 --- a/web/js/components/preact/HLSVideoCell.tsx +++ b/web/js/components/preact/HLSVideoCell.tsx @@ -770,6 +770,7 @@ export function HLSVideoCell({ privacyRequestGenerationRef.current += 1; setIsTogglingEnabled(false); setShowPrivacyConfirm(false); + setShowRefreshConfirm(false); return () => { privacyRequestGenerationRef.current += 1; }; }, [stream.name, streamId]); From e7c384e497f107ecec3af445dcc4a7fdb543dc22 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Sun, 22 Nov 2026 06:58:24 -0500 Subject: [PATCH 2/3] Apply suggested fix to web/js/components/preact/HLSVideoCell.tsx from Copilot Autofix Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com> --- web/js/components/preact/HLSVideoCell.tsx | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/web/js/components/preact/HLSVideoCell.tsx b/web/js/components/preact/HLSVideoCell.tsx index cbf8e2ad1..f570dd3ec 100644 --- a/web/js/components/preact/HLSVideoCell.tsx +++ b/web/js/components/preact/HLSVideoCell.tsx @@ -89,9 +89,26 @@ export function HLSVideoCell({ const [isTogglingEnabled, setIsTogglingEnabled] = useState(false); const canControlPrivacy = stream.can_control_privacy !== false; const privacyResumeButtonRef = useRef(null); + const shouldFocusPrivacyResumeRef = useRef(false); + const previousFocusedElementRef = useRef(null); + const tileContainerRef = useRef(null); useEffect(() => { - if (privacyActive) privacyResumeButtonRef.current?.focus(); + if (privacyActive) { + if (shouldFocusPrivacyResumeRef.current) { + privacyResumeButtonRef.current?.focus(); + shouldFocusPrivacyResumeRef.current = false; + } + return; + } + + const previous = previousFocusedElementRef.current; + if (previous && previous.isConnected) { + previous.focus(); + } else { + tileContainerRef.current?.focus(); + } + previousFocusedElementRef.current = null; }, [privacyActive]); useEffect(() => { From 77b0c3e2d95eb8d0d6db064adcef55d829b036d8 Mon Sep 17 00:00:00 2001 From: Matt Davis Date: Sun, 22 Nov 2026 07:00:48 -0500 Subject: [PATCH 3/3] Restore privacy focus on entry and exit --- web/js/components/preact/HLSVideoCell.tsx | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/web/js/components/preact/HLSVideoCell.tsx b/web/js/components/preact/HLSVideoCell.tsx index f570dd3ec..ed38ee004 100644 --- a/web/js/components/preact/HLSVideoCell.tsx +++ b/web/js/components/preact/HLSVideoCell.tsx @@ -89,19 +89,24 @@ export function HLSVideoCell({ const [isTogglingEnabled, setIsTogglingEnabled] = useState(false); const canControlPrivacy = stream.can_control_privacy !== false; const privacyResumeButtonRef = useRef(null); - const shouldFocusPrivacyResumeRef = useRef(false); + const hadPrivacyFocusRef = useRef(false); const previousFocusedElementRef = useRef(null); const tileContainerRef = useRef(null); useEffect(() => { if (privacyActive) { - if (shouldFocusPrivacyResumeRef.current) { - privacyResumeButtonRef.current?.focus(); - shouldFocusPrivacyResumeRef.current = false; + if (!hadPrivacyFocusRef.current) { + const focused = document.activeElement; + previousFocusedElementRef.current = focused instanceof HTMLElement && focused !== document.body + ? focused : null; } + privacyResumeButtonRef.current?.focus(); + hadPrivacyFocusRef.current = true; return; } + if (!hadPrivacyFocusRef.current) return; + hadPrivacyFocusRef.current = false; const previous = previousFocusedElementRef.current; if (previous && previous.isConnected) { previous.focus(); @@ -904,6 +909,7 @@ export function HLSVideoCell({ return (