Attempt to resolve OOM w/ useMemo on history items (#16424)

This commit is contained in:
christine betts
2026-01-12 11:53:04 -05:00
committed by GitHub
parent 64c75cb767
commit 950244f6b0

View File

@@ -36,17 +36,26 @@ export const MainContent = () => {
availableTerminalHeight,
} = uiState;
const historyItems = uiState.history.map((h) => (
<HistoryItemDisplay
terminalWidth={mainAreaWidth}
availableTerminalHeight={staticAreaMaxItemHeight}
availableTerminalHeightGemini={MAX_GEMINI_MESSAGE_LINES}
key={h.id}
item={h}
isPending={false}
commands={uiState.slashCommands}
/>
));
const historyItems = useMemo(
() =>
uiState.history.map((h) => (
<MemoizedHistoryItemDisplay
terminalWidth={mainAreaWidth}
availableTerminalHeight={staticAreaMaxItemHeight}
availableTerminalHeightGemini={MAX_GEMINI_MESSAGE_LINES}
key={h.id}
item={h}
isPending={false}
commands={uiState.slashCommands}
/>
)),
[
uiState.history,
mainAreaWidth,
staticAreaMaxItemHeight,
uiState.slashCommands,
],
);
const pendingItems = useMemo(
() => (