summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/App.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'packages/cli/src/ui/App.tsx')
-rw-r--r--packages/cli/src/ui/App.tsx17
1 files changed, 9 insertions, 8 deletions
diff --git a/packages/cli/src/ui/App.tsx b/packages/cli/src/ui/App.tsx
index 42613530..74c1ea5d 100644
--- a/packages/cli/src/ui/App.tsx
+++ b/packages/cli/src/ui/App.tsx
@@ -134,7 +134,7 @@ export const App = ({
cliVersion,
);
- const { streamingState, submitQuery, initError, pendingHistoryItem } =
+ const { streamingState, submitQuery, initError, pendingHistoryItems } =
useGeminiStream(
addItem,
refreshStatic,
@@ -209,7 +209,7 @@ export const App = ({
}, [terminalHeight, footerHeight]);
useEffect(() => {
- if (!pendingHistoryItem) {
+ if (!pendingHistoryItems.length) {
return;
}
@@ -223,7 +223,7 @@ export const App = ({
if (pendingItemDimensions.height > availableTerminalHeight) {
setStaticNeedsRefresh(true);
}
- }, [pendingHistoryItem, availableTerminalHeight, streamingState]);
+ }, [pendingHistoryItems.length, availableTerminalHeight, streamingState]);
useEffect(() => {
if (streamingState === StreamingState.Idle && staticNeedsRefresh) {
@@ -264,17 +264,18 @@ export const App = ({
>
{(item) => item}
</Static>
- {pendingHistoryItem && (
- <Box ref={pendingHistoryItemRef}>
+ <Box ref={pendingHistoryItemRef}>
+ {pendingHistoryItems.map((item, i) => (
<HistoryItemDisplay
+ key={i}
availableTerminalHeight={availableTerminalHeight}
// TODO(taehykim): It seems like references to ids aren't necessary in
// HistoryItemDisplay. Refactor later. Use a fake id for now.
- item={{ ...pendingHistoryItem, id: 0 }}
+ item={{ ...item, id: 0 }}
isPending={true}
/>
- </Box>
- )}
+ ))}
+ </Box>
{showHelp && <Help commands={slashCommands} />}
<Box flexDirection="column" ref={mainControlsRef}>