MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / FeedbackTextSection

Function FeedbackTextSection

cli/src/components/feedback-input-mode.tsx:96–148  ·  view source on GitHub ↗
({
  value,
  cursor,
  onChange,
  onCursorChange,
  onSubmit,
  placeholder,
  inputRef,
  width,
  isSubmitting = false,
})

Source from the content-addressed store, hash-verified

94}
95
96const FeedbackTextSection: React.FC<FeedbackTextSectionProps> = ({
97 value,
98 cursor,
99 onChange,
100 onCursorChange,
101 onSubmit,
102 placeholder,
103 inputRef,
104 width,
105 isSubmitting = false,
106}) => {
107 const inputFocused = useChatStore((state) => state.inputFocused)
108
109 return (
110 <>
111 {/* Top separator */}
112 <Separator width={width} widthOffset={4} />
113
114 {/* Feedback input */}
115 <box style={{ paddingTop: 0, paddingBottom: 0 }}>
116 <MultilineInput
117 value={value}
118 onChange={({ text, cursorPosition }) => {
119 onChange(text)
120 onCursorChange(cursorPosition)
121 }}
122 onSubmit={onSubmit}
123 onKeyIntercept={(key) => {
124 if (!isPlainEnterKey(key)) return false
125 // Just add newline on Enter
126 const newText = value.slice(0, cursor) + '\n' + value.slice(cursor)
127 onChange(newText)
128 onCursorChange(cursor + 1)
129 return true
130 }}
131 onPaste={createTextPasteHandler(value, cursor, ({ text, cursorPosition }) => {
132 onChange(text)
133 onCursorChange(cursorPosition)
134 })}
135 placeholder={placeholder}
136 focused={inputFocused && !isSubmitting}
137 maxHeight={5}
138 minHeight={3}
139 ref={inputRef}
140 cursorPosition={cursor}
141 />
142 </box>
143
144 {/* Bottom separator */}
145 <Separator width={width} widthOffset={4} />
146 </>
147 )
148}
149
150interface FeedbackInputModeProps {
151 value: string

Callers

nothing calls this directly

Calls 3

isPlainEnterKeyFunction · 0.90
createTextPasteHandlerFunction · 0.90
onChangeFunction · 0.85

Tested by

no test coverage detected