Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 1 addition & 10 deletions packages/cli/src/ui/AppContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ import { calculatePromptWidths } from './components/InputPrompt.js';
import { useApp, useStdout, useStdin } from 'ink';
import { calculateMainAreaWidth } from './utils/ui-sizing.js';
import ansiEscapes from 'ansi-escapes';
import * as fs from 'node:fs';
import { basename } from 'node:path';
import { computeTerminalTitle } from '../utils/windowTitle.js';
import { useTextBuffer } from './components/shared/text-buffer.js';
Expand Down Expand Up @@ -468,14 +467,6 @@ export const AppContainer = (props: AppContainerProps) => {

const staticAreaMaxItemHeight = Math.max(terminalHeight * 4, 100);

const isValidPath = useCallback((filePath: string): boolean => {
try {
return fs.existsSync(filePath) && fs.statSync(filePath).isFile();
} catch (_e) {
return false;
}
}, []);

const getPreferredEditor = useCallback(
() => settings.merged.general.preferredEditor as EditorType,
[settings.merged.general.preferredEditor],
Expand All @@ -486,7 +477,7 @@ export const AppContainer = (props: AppContainerProps) => {
viewport: { height: 10, width: inputWidth },
stdin,
setRawMode,
isValidPath,
escapePastedPaths: true,
shellModeActive,
getPreferredEditor,
});
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/ui/auth/ApiAuthDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export function ApiAuthDialog({
width: viewportWidth,
height: 4,
},
isValidPath: () => false, // No path validation needed for API key
inputFilter: (text) =>
text.replace(/[^a-zA-Z0-9_-]/g, '').replace(/[\r\n]/g, ''),
singleLine: true,
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/src/ui/components/AskUserDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ const TextQuestionView: React.FC<TextQuestionViewProps> = ({
initialText: initialAnswer,
viewport: { width: Math.max(1, bufferWidth), height: 1 },
singleLine: true,
isValidPath: () => false,
});

const { text: textValue } = buffer;
Expand Down Expand Up @@ -564,7 +563,6 @@ const ChoiceQuestionView: React.FC<ChoiceQuestionViewProps> = ({
initialText: initialCustomText,
viewport: { width: Math.max(1, bufferWidth), height: 1 },
singleLine: true,
isValidPath: () => false,
});

const customOptionText = customBuffer.text;
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/ui/components/ConfigExtensionDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export const ConfigExtensionDialog: React.FC<ConfigExtensionDialogProps> = ({
initialText: '',
viewport: { width: 80, height: 1 },
singleLine: true,
isValidPath: () => true,
escapePastedPaths: true,
});

const mounted = useRef(true);
Expand Down
1 change: 0 additions & 1 deletion packages/cli/src/ui/components/SettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,6 @@ export function SettingsDialog({
width: viewportWidth,
height: 1,
},
isValidPath: () => false,
singleLine: true,
onChange: (text) => setSearchQuery(text),
});
Expand Down
2 changes: 0 additions & 2 deletions packages/cli/src/ui/components/shared/performance.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ describe('text-buffer performance', () => {
const { result } = renderHook(() =>
useTextBuffer({
viewport,
isValidPath: () => false,
}),
);

Expand Down Expand Up @@ -52,7 +51,6 @@ describe('text-buffer performance', () => {
useTextBuffer({
initialText,
viewport,
isValidPath: () => false,
}),
);

Expand Down
Loading
Loading