From dfe0d08a78e750162ae47195329ac1196528536e Mon Sep 17 00:00:00 2001 From: AK <144495202+AKnassa@users.noreply.github.com> Date: Wed, 29 Apr 2026 17:20:54 -0400 Subject: [PATCH] chore(fullscreen): drop inline rationale comments, bump copyright to 2026 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Addresses review feedback: the explanatory block comments in FullscreenProvider (source-of-truth rationale, CoreTransport typing note) were noise — the same context already lives in the PR description and commit history. Copyright headers on the four new files were carried over from the template at 2023; bumped to 2026. Co-Authored-By: Claude Opus 4.7 (1M context) --- src/common/Fullscreen/FullscreenContext.ts | 4 ++-- src/common/Fullscreen/FullscreenProvider.tsx | 15 +-------------- src/common/Fullscreen/index.ts | 2 +- src/common/Fullscreen/useFullscreen.ts | 2 +- 4 files changed, 5 insertions(+), 18 deletions(-) diff --git a/src/common/Fullscreen/FullscreenContext.ts b/src/common/Fullscreen/FullscreenContext.ts index 860eb044f..117a616e8 100644 --- a/src/common/Fullscreen/FullscreenContext.ts +++ b/src/common/Fullscreen/FullscreenContext.ts @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2023 Smart code 203358507 +// Copyright (C) 2017-2026 Smart code 203358507 import { createContext } from 'react'; @@ -9,7 +9,7 @@ export type FullscreenContextValue = readonly [ () => void, ]; -const noop = () => { /* no-op */ }; +const noop = () => undefined; const defaultValue: FullscreenContextValue = [false, noop, noop, noop]; diff --git a/src/common/Fullscreen/FullscreenProvider.tsx b/src/common/Fullscreen/FullscreenProvider.tsx index b98d64186..1c899d283 100644 --- a/src/common/Fullscreen/FullscreenProvider.tsx +++ b/src/common/Fullscreen/FullscreenProvider.tsx @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2023 Smart code 203358507 +// Copyright (C) 2017-2026 Smart code 203358507 import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react'; import { useServices } from 'stremio/services'; @@ -10,16 +10,6 @@ type Props = { children: React.ReactNode, }; -// Single source of truth for fullscreen state. Mounted once at the app root so -// the value survives route remounts (fixes desync where switching tabs while in -// fullscreen would leave the UI thinking we were still windowed). -// -// We deliberately avoid useSettings()/useProfile() here because those go -// through useModelState -> useCoreSuspender, which is only available beneath -// the router's withCoreSuspender boundary. This provider sits above the -// router (alongside ToastProvider et al.), so we read the single setting we -// need (escExitFullscreen) directly from core.transport, which is provided -// by ServicesProvider higher up the tree. const FullscreenProvider = ({ children }: Props) => { const shell = useShell(); const { core } = useServices(); @@ -64,9 +54,6 @@ const FullscreenProvider = ({ children }: Props) => { let cancelled = false; - // CoreTransport.on types the listener as () => void, but 'CoreEvent' - // actually emits { event, args }. Read it via a rest-args wrapper to - // stay compatible with the ambient signature. const onCoreEvent = (...listenerArgs: unknown[]) => { const payload = listenerArgs[0] as | { event?: string, args?: { settings?: { escExitFullscreen?: boolean } } } diff --git a/src/common/Fullscreen/index.ts b/src/common/Fullscreen/index.ts index cc89f769b..db65974ac 100644 --- a/src/common/Fullscreen/index.ts +++ b/src/common/Fullscreen/index.ts @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2023 Smart code 203358507 +// Copyright (C) 2017-2026 Smart code 203358507 import FullscreenProvider from './FullscreenProvider'; import useFullscreen from './useFullscreen'; diff --git a/src/common/Fullscreen/useFullscreen.ts b/src/common/Fullscreen/useFullscreen.ts index 29b2f62e5..da27035d2 100644 --- a/src/common/Fullscreen/useFullscreen.ts +++ b/src/common/Fullscreen/useFullscreen.ts @@ -1,4 +1,4 @@ -// Copyright (C) 2017-2023 Smart code 203358507 +// Copyright (C) 2017-2026 Smart code 203358507 import { useContext } from 'react'; import FullscreenContext from './FullscreenContext';