Skip to content

Commit fef30b5

Browse files
committed
refactor(cli): remove deprecated width prop from MultilineInput
1 parent fe436ad commit fef30b5

File tree

6 files changed

+0
-26
lines changed

6 files changed

+0
-26
lines changed

cli/src/chat.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1216,7 +1216,6 @@ export const Chat = ({
12161216
inputFocused={inputFocused}
12171217
inputRef={inputRef}
12181218
inputPlaceholder={inputPlaceholder}
1219-
inputWidth={inputWidth}
12201219
lastEditDueToNav={lastEditDueToNav}
12211220
agentMode={agentMode}
12221221
toggleAgentMode={toggleAgentMode}

cli/src/components/ask-user/components/other-text-input.tsx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,11 @@ import { createTextPasteHandler } from '../../../utils/strings'
1313

1414
import type { InputValue } from '../../../state/chat-store'
1515

16-
// Width taken by symbol + "Other:" label + padding
17-
const LABEL_WIDTH = 10
18-
1916
export interface OtherTextInputProps {
2017
text: string
2118
isFocused: boolean
2219
hasText: boolean
2320
isSelected: boolean
24-
width: number
2521
cursorPosition: number
2622
onClick: () => void
2723
onMouseOver: () => void
@@ -34,7 +30,6 @@ export const OtherTextInput: React.FC<OtherTextInputProps> = ({
3430
isFocused,
3531
hasText,
3632
isSelected,
37-
width,
3833
cursorPosition,
3934
onClick,
4035
onMouseOver,
@@ -45,9 +40,6 @@ export const OtherTextInput: React.FC<OtherTextInputProps> = ({
4540

4641
const placeholder = 'Type your own answer...'
4742

48-
// Calculate available width for the input (full width minus label and padding)
49-
const inputWidth = Math.max(10, width - LABEL_WIDTH)
50-
5143
// Intercept navigation keys that should be handled by the ask-user form
5244
const handleKeyIntercept = (key: KeyEvent): boolean => {
5345
// Let Up/Down/Tab be handled by the form's navigation
@@ -106,7 +98,6 @@ export const OtherTextInput: React.FC<OtherTextInputProps> = ({
10698
focused={isFocused}
10799
maxHeight={3}
108100
minHeight={1}
109-
width={inputWidth}
110101
cursorPosition={cursorPosition}
111102
/>
112103
</box>

cli/src/components/ask-user/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ export interface MultipleChoiceFormProps {
2727
onOtherTextChange: (questionIndex: number, text: string) => void
2828
onSubmit: (finalAnswers?: (number | number[])[], finalOtherTexts?: string[]) => void
2929
onQuestionChange?: (currentIndex: number, totalQuestions: number, isOnConfirmScreen: boolean) => void
30-
width: number
3130
}
3231

3332
export const MultipleChoiceForm: React.FC<MultipleChoiceFormProps> = ({
@@ -38,7 +37,6 @@ export const MultipleChoiceForm: React.FC<MultipleChoiceFormProps> = ({
3837
onOtherTextChange,
3938
onSubmit,
4039
onQuestionChange,
41-
width,
4240
}) => {
4341
const theme = useTheme()
4442
const [currentQuestionIndex, setCurrentQuestionIndex] = useState(0)
@@ -270,7 +268,6 @@ export const MultipleChoiceForm: React.FC<MultipleChoiceFormProps> = ({
270268
}
271269
hasText={!!otherTexts[currentQuestionIndex]?.trim()}
272270
isSelected={false}
273-
width={width}
274271
cursorPosition={
275272
otherCursorPositions[currentQuestionIndex] ??
276273
(otherTexts[currentQuestionIndex] || '').length

cli/src/components/chat-input-bar.tsx

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ interface ChatInputBarProps {
2828
inputFocused: boolean
2929
inputRef: React.MutableRefObject<MultilineInputHandle | null>
3030
inputPlaceholder: string
31-
inputWidth: number
3231
lastEditDueToNav: boolean
3332

3433
// Agent mode
@@ -71,7 +70,6 @@ export const ChatInputBar = ({
7170
inputFocused,
7271
inputRef,
7372
inputPlaceholder,
74-
inputWidth,
7573
lastEditDueToNav,
7674
agentMode,
7775
toggleAgentMode,
@@ -237,8 +235,6 @@ export const ChatInputBar = ({
237235
submitAnswers(answers)
238236
}
239237

240-
// Adjust input width based on mode configuration
241-
const adjustedInputWidth = inputWidth - modeConfig.widthAdjustment
242238
const effectivePlaceholder =
243239
inputMode === 'default' ? inputPlaceholder : modeConfig.placeholder
244240
const borderColor = theme[modeConfig.color]
@@ -275,7 +271,6 @@ export const ChatInputBar = ({
275271
)
276272
}
277273
}}
278-
width={inputWidth}
279274
/>
280275
</box>
281276
)
@@ -333,7 +328,6 @@ export const ChatInputBar = ({
333328
placeholder={effectivePlaceholder}
334329
focused={inputFocused && !feedbackMode}
335330
maxHeight={compactMaxHeight}
336-
width={adjustedInputWidth}
337331
ref={inputRef}
338332
cursorPosition={cursorPosition}
339333
/>
@@ -416,7 +410,6 @@ export const ChatInputBar = ({
416410
placeholder={effectivePlaceholder}
417411
focused={inputFocused && !feedbackMode}
418412
maxHeight={Math.floor(terminalHeight / 2)}
419-
width={adjustedInputWidth}
420413
ref={inputRef}
421414
cursorPosition={cursorPosition}
422415
/>

cli/src/components/feedback-input-mode.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ const FeedbackTextSection: React.FC<FeedbackTextSectionProps> = ({
9090
width,
9191
}) => {
9292
const inputFocused = useChatStore((state) => state.inputFocused)
93-
const inputWidth = Math.max(1, width - FEEDBACK_CONTAINER_HORIZONTAL_INSET)
9493

9594
return (
9695
<>
@@ -123,8 +122,6 @@ const FeedbackTextSection: React.FC<FeedbackTextSectionProps> = ({
123122
focused={inputFocused}
124123
maxHeight={5}
125124
minHeight={3}
126-
width={inputWidth}
127-
128125
ref={inputRef}
129126
cursorPosition={cursor}
130127
/>

cli/src/components/multiline-input.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ interface MultilineInputProps {
128128
shouldBlinkCursor?: boolean
129129
maxHeight?: number
130130
minHeight?: number
131-
/** @deprecated This prop is no longer used but kept for backwards compatibility */
132-
width?: number
133131
cursorPosition: number
134132
}
135133

@@ -151,7 +149,6 @@ export const MultilineInput = forwardRef<
151149
shouldBlinkCursor,
152150
maxHeight = 5,
153151
minHeight = 1,
154-
// width is deprecated and no longer used
155152
onKeyIntercept,
156153
cursorPosition,
157154
}: MultilineInputProps,

0 commit comments

Comments
 (0)