({
debug,
ideSelection,
toolPermissionContext,
setToolPermissionContext,
apiKeyStatus,
commands,
agents,
isLoading,
verbose,
messagesRef,
hasMessages,
hasAssistantMessages,
lastAssistantMessageId,
lastApiUsageKey,
onAutoUpdaterResult,
autoUpdaterResult,
input,
onInputChange,
mode,
onModeChange,
stashedPrompt,
setStashedPrompt,
submitCount,
onShowMessageSelector,
onMessageActionsEnter,
mcpClients,
pastedContents,
setPastedContents,
vimMode,
setVimMode,
showBashesDialog,
setShowBashesDialog,
onExit,
getToolUseContext,
onSubmit: onSubmitProp,
onAgentSubmit,
isSearchingHistory,
setIsSearchingHistory,
onDismissSideQuestion,
isSideQuestionVisible,
helpOpen,
setHelpOpen,
hasSuppressedDialogs,
isLocalJSXCommandActive = false,
insertTextRef,
voiceInterimRange
}: Props)
| 224 | const PROMPT_FOOTER_LINES = 5; |
| 225 | const MIN_INPUT_VIEWPORT_LINES = 3; |
| 226 | function PromptInput({ |
| 227 | debug, |
| 228 | ideSelection, |
| 229 | toolPermissionContext, |
| 230 | setToolPermissionContext, |
| 231 | apiKeyStatus, |
| 232 | commands, |
| 233 | agents, |
| 234 | isLoading, |
| 235 | verbose, |
| 236 | messagesRef, |
| 237 | hasMessages, |
| 238 | hasAssistantMessages, |
| 239 | lastAssistantMessageId, |
| 240 | lastApiUsageKey, |
| 241 | onAutoUpdaterResult, |
| 242 | autoUpdaterResult, |
| 243 | input, |
| 244 | onInputChange, |
| 245 | mode, |
| 246 | onModeChange, |
| 247 | stashedPrompt, |
| 248 | setStashedPrompt, |
| 249 | submitCount, |
| 250 | onShowMessageSelector, |
| 251 | onMessageActionsEnter, |
| 252 | mcpClients, |
| 253 | pastedContents, |
| 254 | setPastedContents, |
| 255 | vimMode, |
| 256 | setVimMode, |
| 257 | showBashesDialog, |
| 258 | setShowBashesDialog, |
| 259 | onExit, |
| 260 | getToolUseContext, |
| 261 | onSubmit: onSubmitProp, |
| 262 | onAgentSubmit, |
| 263 | isSearchingHistory, |
| 264 | setIsSearchingHistory, |
| 265 | onDismissSideQuestion, |
| 266 | isSideQuestionVisible, |
| 267 | helpOpen, |
| 268 | setHelpOpen, |
| 269 | hasSuppressedDialogs, |
| 270 | isLocalJSXCommandActive = false, |
| 271 | insertTextRef, |
| 272 | voiceInterimRange |
| 273 | }: Props): React.ReactNode { |
| 274 | recordRenderTrace('PromptInput'); |
| 275 | // Synchronous mode ref prevents race between onChange mode switch |
| 276 | // and onSubmit reading a stale closure-captured mode variable. React |
| 277 | // may not have committed the setMode state update before Enter fires. |
| 278 | const modeRef = useRef(mode) |
| 279 | modeRef.current = mode |
| 280 | const mainLoopModel = useMainLoopModel(); |
| 281 | // A local-jsx command (e.g., /mcp while agent is running) renders a full- |
| 282 | // screen dialog on top of PromptInput via the immediate-command path with |
| 283 | // shouldHidePromptInput: false. Those dialogs don't register in the overlay |
nothing calls this directly
no test coverage detected