Skip to content

Commit 30c8369

Browse files
refactor(components): rename Input component to ChatInput
- Rename Input.tsx to ChatInput.tsx - Rename Input.test.tsx to ChatInput.test.tsx - Update component name from Input to ChatInput - Update all imports and references - Update mock in Chat.test.tsx
1 parent 42d4d0a commit 30c8369

4 files changed

Lines changed: 13 additions & 11 deletions

File tree

src/components/Chat/Chat.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ vi.mock('../../utils', async () => ({
9494
},
9595
}));
9696

97-
vi.mock('./Input', () => ({
98-
Input: (props: {
97+
vi.mock('./ChatInput', () => ({
98+
ChatInput: (props: {
9999
history?: string[];
100100
onSubmit?: (value: string) => void;
101101
onInterrupt?: () => void;

src/components/Chat/Chat.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ import { Messages } from '../Messages';
99
import { TURN_ABORTED_MESSAGE } from '../Messages/constants';
1010
import { PlanApproval } from '../PlanApproval';
1111
import { ToolApproval } from '../ToolApproval';
12+
import { ChatInput } from './ChatInput';
1213
import {
1314
ACTION_NOT_PERFORMED,
1415
INTERRUPT_REASON,
1516
PLAN_CHECKLIST_REMINDER,
1617
PLAN_EXECUTION_REMINDER,
1718
} from './constants';
18-
import { Input } from './Input';
1919
import { hasExecutablePlan } from './plan';
2020

2121
interface Props {
@@ -592,7 +592,7 @@ export function Chat({
592592

593593
{!pendingPlan && !pendingToolCall && (
594594
<Box marginTop={1}>
595-
<Input
595+
<ChatInput
596596
history={history}
597597
isDisabled={isLoading}
598598
onInterrupt={handleInterrupt}
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -214,11 +214,11 @@ vi.mock('./FileSuggestions', () => ({
214214
},
215215
}));
216216

217-
import { Input } from './Input';
217+
import { ChatInput } from './ChatInput';
218218

219-
describe('Input', () => {
220-
function renderInput(props: Partial<ComponentProps<typeof Input>> = {}) {
221-
return render(<Input history={[]} onSubmit={vi.fn()} {...props} />);
219+
describe('ChatInput', () => {
220+
function renderInput(props: Partial<ComponentProps<typeof ChatInput>> = {}) {
221+
return render(<ChatInput history={[]} onSubmit={vi.fn()} {...props} />);
222222
}
223223

224224
beforeEach(() => {
@@ -628,7 +628,7 @@ describe('Input', () => {
628628
stdin.write(KEY.ENTER);
629629
await time.tick();
630630

631-
rerender(<Input history={[]} onSubmit={onSubmit} />);
631+
rerender(<ChatInput history={[]} onSubmit={onSubmit} />);
632632
await time.tick();
633633

634634
stdin.write(KEY.UP);
@@ -649,7 +649,9 @@ describe('Input', () => {
649649
await time.tick();
650650
expect(lastFrame()).toContain('session one prompt');
651651

652-
rerender(<Input history={['session two prompt']} onSubmit={onSubmit} />);
652+
rerender(
653+
<ChatInput history={['session two prompt']} onSubmit={onSubmit} />,
654+
);
653655
await time.tick();
654656

655657
expect(lastFrame()).toContain('Ask anything... (/ commands, @ files)');
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function hasFileSuggestionQuery(input: string): boolean {
2323
return /(^|.)@\S+/.test(input);
2424
}
2525

26-
export function Input({
26+
export function ChatInput({
2727
history: sessionHistory,
2828
isDisabled = false,
2929
onInterrupt,

0 commit comments

Comments
 (0)