From 05af4b2a66e6252986ff8159f3232b67cd87f451 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Sat, 7 Nov 2026 12:50:24 -0800 Subject: [PATCH] chore(native-chat): remove rail wake comments (#39585) --- .../viewport/rail/use-native-chat-rail-wake.ts | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/src/renderer/src/components/native-chat/viewport/rail/use-native-chat-rail-wake.ts b/src/renderer/src/components/native-chat/viewport/rail/use-native-chat-rail-wake.ts index 97f9617135e..d4c7db1de61 100644 --- a/src/renderer/src/components/native-chat/viewport/rail/use-native-chat-rail-wake.ts +++ b/src/renderer/src/components/native-chat/viewport/rail/use-native-chat-rail-wake.ts @@ -1,25 +1,14 @@ import { useCallback, useEffect, useRef } from 'react' - -/** How long the rail stays lit after the last scroll input, before its CSS fade begins. */ const NATIVE_CHAT_RAIL_WAKE_MS = 300 -/** Scroll events extend a wake this long after the input, so app-driven scrolls never keep it lit. */ const NATIVE_CHAT_RAIL_SUSTAIN_MS = 1500 - -/** - * Lights the idle-dimmed message rail while the reader scrolls. Writes a data attribute on the - * rail's node instead of state, so scrolling never re-renders the transcript. - */ export function useNativeChatRailWake(): { railRef: React.RefObject wake: () => void - /** A scroll event: keeps a just-lit rail lit through scrollbar drags and touch flings. */ sustain: () => void } { const railRef = useRef(null) const timer = useRef | null>(null) - /** When the rail may go dark again. */ const sleepAt = useRef(0) - /** Scroll events before this still belong to the reader's last input. */ const sustainUntil = useRef(0) const wake = useCallback(() => { @@ -27,7 +16,6 @@ export function useNativeChatRailWake(): { sleepAt.current = now + NATIVE_CHAT_RAIL_WAKE_MS sustainUntil.current = now + NATIVE_CHAT_RAIL_SUSTAIN_MS const rail = railRef.current - // Why: a gesture fires wheel events every frame; write the DOM and arm a timer once per gesture. if (rail && !('awake' in rail.dataset)) { rail.dataset.awake = '' } @@ -49,7 +37,6 @@ export function useNativeChatRailWake(): { }, []) const sustain = useCallback(() => { - // Why: most scroll events (streaming, auto-follow) arrive with no wake pending; skip the clock read. if (timer.current === null) { return }