From ee6f07445a82626e5d68f58027cdab3b1f18b79b Mon Sep 17 00:00:00 2001 From: Roo Code Date: Wed, 30 Jul 2025 00:03:09 +0000 Subject: [PATCH] fix: address review feedback - Remove unused lastCheckpointInfo parameter from ChatRowContent - Remove unreachable return null statement - Optimize useMemo performance for lastCheckpointInfo calculation --- webview-ui/src/components/chat/ChatRow.tsx | 6 +----- webview-ui/src/components/chat/ChatView.tsx | 7 +++---- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/webview-ui/src/components/chat/ChatRow.tsx b/webview-ui/src/components/chat/ChatRow.tsx index 1c45a68614..17732dd2db 100644 --- a/webview-ui/src/components/chat/ChatRow.tsx +++ b/webview-ui/src/components/chat/ChatRow.tsx @@ -117,7 +117,6 @@ export const ChatRowContent = ({ onBatchFileResponse, isFollowUpAnswered, editable, - lastCheckpointInfo: _lastCheckpointInfo, }: ChatRowContentProps) => { const { t } = useTranslation() const { mcpServers, alwaysAllowMcp, currentCheckpoint: _currentCheckpoint, mode } = useExtensionState() @@ -1345,9 +1344,6 @@ export const ChatRowContent = ({ return null } } - - // Default return for messages that don't match any case - return null } // Create a wrapper component to handle the checkpoint UI @@ -1356,7 +1352,7 @@ export const ChatRowWithCheckpoint: React.FC = (props) => { const { currentCheckpoint } = useExtensionState() // Render the regular content - const content = + const content = // Check if we should show checkpoint UI const shouldShowCheckpoint = diff --git a/webview-ui/src/components/chat/ChatView.tsx b/webview-ui/src/components/chat/ChatView.tsx index 99c6166d94..6563aca5a4 100644 --- a/webview-ui/src/components/chat/ChatView.tsx +++ b/webview-ui/src/components/chat/ChatView.tsx @@ -145,10 +145,9 @@ const ChatViewComponent: React.ForwardRefRenderFunction messages.filter((msg) => msg.say === "checkpoint_saved"), [messages]) const lastCheckpointInfo = useMemo(() => { - // Find the last checkpoint_saved message - const checkpointMessages = messages.filter((msg) => msg.say === "checkpoint_saved") if (checkpointMessages.length === 0) return null const lastCheckpoint = checkpointMessages[checkpointMessages.length - 1] @@ -157,7 +156,7 @@ const ChatViewComponent: React.ForwardRefRenderFunction combineApiRequests(combineCommandSequences(messages.slice(1))), [messages])