mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-26 19:53:18 -07:00
4ee4bfcb02
Checkpoint optimizing virtualized list Fixes for fallback rendering where terminalBuffer=false Change terminalBuffer false back to the default while we fix performance with very large chats. Checkpoint changes to virtualized list. Fix virtualized list NO commit Update ink version. Fix UI snapshot mismatch in MainContent tests and VirtualizedList computation Checkpoint.
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
/**
|
|
* @license
|
|
* Copyright 2025 Google LLC
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
import React from 'react';
|
|
import { useIsScreenReaderEnabled } from 'ink';
|
|
import { useUIState } from './contexts/UIStateContext.js';
|
|
import { StreamingContext } from './contexts/StreamingContext.js';
|
|
import { QuittingDisplay } from './components/QuittingDisplay.js';
|
|
import { ScreenReaderAppLayout } from './layouts/ScreenReaderAppLayout.js';
|
|
import { DefaultAppLayout } from './layouts/DefaultAppLayout.js';
|
|
import { AlternateBufferQuittingDisplay } from './components/AlternateBufferQuittingDisplay.js';
|
|
import { useAlternateBuffer } from './hooks/useAlternateBuffer.js';
|
|
|
|
export const App = React.memo(() => {
|
|
const uiState = useUIState();
|
|
const isAlternateBuffer = useAlternateBuffer();
|
|
const isScreenReaderEnabled = useIsScreenReaderEnabled();
|
|
|
|
if (uiState.quittingMessages) {
|
|
if (isAlternateBuffer) {
|
|
return (
|
|
<StreamingContext.Provider value={uiState.streamingState}>
|
|
<AlternateBufferQuittingDisplay />
|
|
</StreamingContext.Provider>
|
|
);
|
|
} else {
|
|
return <QuittingDisplay />;
|
|
}
|
|
}
|
|
|
|
return (
|
|
<StreamingContext.Provider value={uiState.streamingState}>
|
|
{isScreenReaderEnabled ? <ScreenReaderAppLayout /> : <DefaultAppLayout />}
|
|
</StreamingContext.Provider>
|
|
);
|
|
});
|
|
|
|
App.displayName = 'App';
|