mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-15 16:41:11 -07:00
Revert "feat(accessibility): implement centralized screen reader layo… (#9255)
This commit is contained in:
@@ -26,12 +26,10 @@ import { useSettings } from '../contexts/SettingsContext.js';
|
||||
import { ApprovalMode } from '@google/gemini-cli-core';
|
||||
import { StreamingState } from '../types.js';
|
||||
import { ConfigInitDisplay } from '../components/ConfigInitDisplay.js';
|
||||
import { useLayoutConfig } from '../hooks/useLayoutConfig.js';
|
||||
|
||||
export const Composer = () => {
|
||||
const config = useConfig();
|
||||
const settings = useSettings();
|
||||
const layout = useLayoutConfig();
|
||||
const uiState = useUIState();
|
||||
const uiActions = useUIActions();
|
||||
const { vimEnabled, vimMode } = useVimMode();
|
||||
@@ -178,7 +176,7 @@ export const Composer = () => {
|
||||
/>
|
||||
)}
|
||||
|
||||
{!settings.merged.ui?.hideFooter && layout.shouldShowFooterInComposer && (
|
||||
{!settings.merged.ui?.hideFooter && (
|
||||
<Footer {...footerProps} vimMode={vimEnabled ? vimMode : undefined} />
|
||||
)}
|
||||
</Box>
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { HistoryItemDisplay } from './HistoryItemDisplay.js';
|
||||
import type { HistoryItem } from '../types.js';
|
||||
import type { SlashCommand } from '../commands/types.js';
|
||||
|
||||
interface HistoryListProps {
|
||||
history: HistoryItem[];
|
||||
terminalWidth: number;
|
||||
staticAreaMaxItemHeight: number;
|
||||
slashCommands: readonly SlashCommand[];
|
||||
}
|
||||
|
||||
export const HistoryList = ({
|
||||
history,
|
||||
terminalWidth,
|
||||
staticAreaMaxItemHeight,
|
||||
slashCommands,
|
||||
}: HistoryListProps) => (
|
||||
<>
|
||||
{history.map((h) => (
|
||||
<HistoryItemDisplay
|
||||
terminalWidth={terminalWidth}
|
||||
availableTerminalHeight={staticAreaMaxItemHeight}
|
||||
key={h.id}
|
||||
item={h}
|
||||
isPending={false}
|
||||
commands={slashCommands}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
@@ -5,19 +5,16 @@
|
||||
*/
|
||||
|
||||
import { Box, Static } from 'ink';
|
||||
import { HistoryList } from './HistoryList.js';
|
||||
import { PendingHistoryList } from './PendingHistoryList.js';
|
||||
import { HistoryItemDisplay } from './HistoryItemDisplay.js';
|
||||
import { ShowMoreLines } from './ShowMoreLines.js';
|
||||
import { OverflowProvider } from '../contexts/OverflowContext.js';
|
||||
import { useUIState } from '../contexts/UIStateContext.js';
|
||||
import { useAppContext } from '../contexts/AppContext.js';
|
||||
import { AppHeader } from './AppHeader.js';
|
||||
import { useLayoutConfig } from '../hooks/useLayoutConfig.js';
|
||||
|
||||
export const MainContent = () => {
|
||||
const { version } = useAppContext();
|
||||
const uiState = useUIState();
|
||||
const layout = useLayoutConfig();
|
||||
const {
|
||||
pendingHistoryItems,
|
||||
mainAreaWidth,
|
||||
@@ -25,60 +22,42 @@ export const MainContent = () => {
|
||||
availableTerminalHeight,
|
||||
} = uiState;
|
||||
|
||||
// In screen reader mode, use regular layout without Static component
|
||||
if (!layout.shouldUseStatic) {
|
||||
return (
|
||||
<OverflowProvider>
|
||||
<Box flexDirection="column">
|
||||
<AppHeader version={version} />
|
||||
<HistoryList
|
||||
history={uiState.history}
|
||||
terminalWidth={mainAreaWidth}
|
||||
staticAreaMaxItemHeight={staticAreaMaxItemHeight}
|
||||
slashCommands={uiState.slashCommands}
|
||||
/>
|
||||
<PendingHistoryList
|
||||
pendingHistoryItems={pendingHistoryItems}
|
||||
terminalWidth={mainAreaWidth}
|
||||
availableTerminalHeight={availableTerminalHeight}
|
||||
constrainHeight={uiState.constrainHeight}
|
||||
isEditorDialogOpen={uiState.isEditorDialogOpen}
|
||||
/>
|
||||
<ShowMoreLines constrainHeight={uiState.constrainHeight} />
|
||||
</Box>
|
||||
</OverflowProvider>
|
||||
);
|
||||
}
|
||||
|
||||
// Default mode with Static component
|
||||
return (
|
||||
<>
|
||||
<Static
|
||||
key={uiState.historyRemountKey}
|
||||
items={[
|
||||
<AppHeader key="app-header" version={version} />,
|
||||
<HistoryList
|
||||
key="history-list"
|
||||
history={uiState.history}
|
||||
terminalWidth={mainAreaWidth}
|
||||
staticAreaMaxItemHeight={staticAreaMaxItemHeight}
|
||||
slashCommands={uiState.slashCommands}
|
||||
/>,
|
||||
...uiState.history.map((h) => (
|
||||
<HistoryItemDisplay
|
||||
terminalWidth={mainAreaWidth}
|
||||
availableTerminalHeight={staticAreaMaxItemHeight}
|
||||
key={h.id}
|
||||
item={h}
|
||||
isPending={false}
|
||||
commands={uiState.slashCommands}
|
||||
/>
|
||||
)),
|
||||
]}
|
||||
>
|
||||
{(item) => item}
|
||||
</Static>
|
||||
<OverflowProvider>
|
||||
<Box flexDirection="column">
|
||||
<PendingHistoryList
|
||||
pendingHistoryItems={pendingHistoryItems}
|
||||
terminalWidth={mainAreaWidth}
|
||||
availableTerminalHeight={availableTerminalHeight}
|
||||
constrainHeight={uiState.constrainHeight}
|
||||
isEditorDialogOpen={uiState.isEditorDialogOpen}
|
||||
activePtyId={uiState.activePtyId?.toString()}
|
||||
embeddedShellFocused={uiState.embeddedShellFocused}
|
||||
/>
|
||||
{pendingHistoryItems.map((item, i) => (
|
||||
<HistoryItemDisplay
|
||||
key={i}
|
||||
availableTerminalHeight={
|
||||
uiState.constrainHeight ? availableTerminalHeight : undefined
|
||||
}
|
||||
terminalWidth={mainAreaWidth}
|
||||
item={{ ...item, id: 0 }}
|
||||
isPending={true}
|
||||
isFocused={!uiState.isEditorDialogOpen}
|
||||
activeShellPtyId={uiState.activePtyId}
|
||||
embeddedShellFocused={uiState.embeddedShellFocused}
|
||||
/>
|
||||
))}
|
||||
<ShowMoreLines constrainHeight={uiState.constrainHeight} />
|
||||
</Box>
|
||||
</OverflowProvider>
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { HistoryItemDisplay } from './HistoryItemDisplay.js';
|
||||
import type { HistoryItemWithoutId } from '../types.js';
|
||||
|
||||
interface PendingHistoryListProps {
|
||||
pendingHistoryItems: HistoryItemWithoutId[];
|
||||
terminalWidth: number;
|
||||
availableTerminalHeight?: number;
|
||||
constrainHeight?: boolean;
|
||||
isEditorDialogOpen: boolean;
|
||||
activePtyId?: string;
|
||||
embeddedShellFocused?: boolean;
|
||||
}
|
||||
|
||||
export const PendingHistoryList = ({
|
||||
pendingHistoryItems,
|
||||
terminalWidth,
|
||||
availableTerminalHeight,
|
||||
constrainHeight,
|
||||
isEditorDialogOpen,
|
||||
activePtyId,
|
||||
embeddedShellFocused,
|
||||
}: PendingHistoryListProps) => (
|
||||
<>
|
||||
{pendingHistoryItems.map((item, i) => (
|
||||
<HistoryItemDisplay
|
||||
key={i}
|
||||
availableTerminalHeight={
|
||||
constrainHeight ? availableTerminalHeight : undefined
|
||||
}
|
||||
terminalWidth={terminalWidth}
|
||||
item={{ ...item, id: 0 }}
|
||||
isPending={true}
|
||||
isFocused={!isEditorDialogOpen}
|
||||
activeShellPtyId={activePtyId ? parseInt(activePtyId, 10) : null}
|
||||
embeddedShellFocused={embeddedShellFocused}
|
||||
/>
|
||||
))}
|
||||
</>
|
||||
);
|
||||
Reference in New Issue
Block a user