From d368697c58ec85afac1be9db1406ac2882d790e3 Mon Sep 17 00:00:00 2001 From: hannesrudolph Date: Wed, 6 Aug 2025 12:26:08 -0700 Subject: [PATCH] refactor: simplify comments per review feedback - Remove verbose comments and references to other PRs - Keep comments concise and focused on what the code does --- webview-ui/src/components/chat/ChatView.tsx | 24 ++++++++------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index 179a6948be..afc37c7e56 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -70,10 +70,10 @@ export interface ChatViewRef { export const MAX_IMAGES_PER_MESSAGE = 20 // Anthropic limits to 20 images -// Viewport buffer constants for memory-efficient scroll behavior -const VIEWPORT_BUFFER_AT_BOTTOM = 10_000 // Larger buffer when at bottom to maintain scroll lock -const VIEWPORT_BUFFER_SCROLLED_UP = 1_000 // Smaller buffer when scrolled up to preserve memory efficiency -const VIEWPORT_BUFFER_TOP = 3_000 // Top buffer for smooth scrolling +// Viewport buffer constants +const VIEWPORT_BUFFER_AT_BOTTOM = 10_000 // Maintains scroll lock when at bottom +const VIEWPORT_BUFFER_SCROLLED_UP = 1_000 // Reduces memory usage when scrolled up +const VIEWPORT_BUFFER_TOP = 3_000 const isMac = navigator.platform.toUpperCase().indexOf("MAC") >= 0 @@ -1437,12 +1437,11 @@ const ChatViewComponent: React.ForwardRefRenderFunction { const timer = setTimeout(() => { setDebouncedIsAtBottom(isAtBottom) - }, 300) // 300ms delay provides good balance between responsiveness and stability + }, 300) return () => clearTimeout(timer) }, [isAtBottom]) @@ -1906,11 +1905,8 @@ const ChatViewComponent: React.ForwardRefRenderFunction