cleanup memory in chat (#4073)

This commit is contained in:
Zane
2025-08-13 13:56:07 -07:00
committed by GitHub
parent c42da79479
commit 84d0ca111d
2 changed files with 26 additions and 6 deletions
@@ -141,11 +141,16 @@ export default function ProgressiveMessageList({
// Force complete rendering when search is active
useEffect(() => {
// Only add listener if we're actually loading
if (!isLoading) {
return;
}
const handleKeyDown = (e: KeyboardEvent) => {
const isMac = window.electron.platform === 'darwin';
const isSearchShortcut = (isMac ? e.metaKey : e.ctrlKey) && e.key === 'f';
if (isSearchShortcut && isLoading) {
if (isSearchShortcut) {
// Immediately render all messages when search is triggered
setRenderedCount(messages.length);
setIsLoading(false);
@@ -248,14 +253,14 @@ export default function ProgressiveMessageList({
renderedCount,
renderMessage,
isUserMessage,
hasContextHandlerContent,
getContextHandlerType,
chat,
append,
appendMessage,
toolCallNotifications,
onScrollToBottom,
isStreamingMessage,
hasContextHandlerContent,
getContextHandlerType,
onScrollToBottom,
]);
return (