Revert "feat(accessibility): implement centralized screen reader layo… (#9255)

This commit is contained in:
christine betts
2025-09-23 15:44:33 -04:00
committed by GitHub
parent 16278fd849
commit 39b0948417
10 changed files with 64 additions and 348 deletions

View File

@@ -1,32 +0,0 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { useUIState } from '../contexts/UIStateContext.js';
import { useConfig } from '../contexts/ConfigContext.js';
import { useSettings } from '../contexts/SettingsContext.js';
export const useFooterProps = () => {
const uiState = useUIState();
const config = useConfig();
const settings = useSettings();
return {
model: config.getModel(),
targetDir: config.getTargetDir(),
debugMode: config.getDebugMode(),
branchName: uiState.branchName,
debugMessage: uiState.debugMessage,
corgiMode: uiState.corgiMode,
errorCount: uiState.errorCount,
showErrorDetails: uiState.showErrorDetails,
showMemoryUsage:
config.getDebugMode() || settings.merged.ui?.showMemoryUsage || false,
promptTokenCount: uiState.sessionStats.lastPromptTokenCount,
nightly: uiState.nightly,
isTrustedFolder: uiState.isTrustedFolder,
vimMode: undefined,
};
};

View File

@@ -1,38 +0,0 @@
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { useIsScreenReaderEnabled } from 'ink';
export interface LayoutConfig {
shouldUseStatic: boolean;
shouldShowFooterInComposer: boolean;
mode: 'default' | 'screenReader';
allowStaticToggle?: boolean;
}
export interface LayoutConfigOptions {
forceStaticMode?: boolean;
allowToggle?: boolean;
}
export const useLayoutConfig = (
options?: LayoutConfigOptions,
): LayoutConfig => {
const isScreenReader = useIsScreenReaderEnabled();
// Allow overriding static behavior when toggle is enabled
const shouldUseStatic =
options?.forceStaticMode !== undefined
? options.forceStaticMode
: !isScreenReader;
return {
shouldUseStatic,
shouldShowFooterInComposer: !isScreenReader,
mode: isScreenReader ? 'screenReader' : 'default',
allowStaticToggle: options?.allowToggle ?? false,
};
};