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

Function ChatInputBar

cli/src/components/chat-input-bar.tsx:77–469  ·  view source on GitHub ↗
({
  inputValue,
  cursorPosition,
  setInputValue,
  inputFocused,
  inputRef,
  inputPlaceholder,
  lastEditDueToNav,
  agentMode,
  toggleAgentMode,
  setAgentMode,
  hasSlashSuggestions,
  hasMentionSuggestions,
  hasSuggestionMenu,
  slashSuggestionItems,
  agentSuggestionItems,
  fileSuggestionItems,
  slashSelectedIndex,
  agentSelectedIndex,
  onSlashItemClick,
  onMentionItemClick,
  theme,
  terminalHeight,
  separatorWidth,
  shouldCenterInputVertically,
  inputBoxTitle,
  isCompactHeight,
  isNarrowWidth,
  feedbackMode,
  handleExitFeedback,
  publishMode,
  handleExitPublish,
  handlePublish,
  handleSubmit,
  onPaste,
  onInterruptStream,
}: ChatInputBarProps)

Source from the content-addressed store, hash-verified

75}
76
77export const ChatInputBar = ({
78 inputValue,
79 cursorPosition,
80 setInputValue,
81 inputFocused,
82 inputRef,
83 inputPlaceholder,
84 lastEditDueToNav,
85 agentMode,
86 toggleAgentMode,
87 setAgentMode,
88 hasSlashSuggestions,
89 hasMentionSuggestions,
90 hasSuggestionMenu,
91 slashSuggestionItems,
92 agentSuggestionItems,
93 fileSuggestionItems,
94 slashSelectedIndex,
95 agentSelectedIndex,
96 onSlashItemClick,
97 onMentionItemClick,
98 theme,
99 terminalHeight,
100 separatorWidth,
101 shouldCenterInputVertically,
102 inputBoxTitle,
103 isCompactHeight,
104 isNarrowWidth,
105 feedbackMode,
106 handleExitFeedback,
107 publishMode,
108 handleExitPublish,
109 handlePublish,
110 handleSubmit,
111 onPaste,
112 onInterruptStream,
113}: ChatInputBarProps) => {
114 const inputMode = useChatStore((state) => state.inputMode)
115 const setInputMode = useChatStore((state) => state.setInputMode)
116
117 const modeConfig = getInputModeConfig(inputMode)
118 const askUserState = useChatStore((state) => state.askUserState)
119 const hasAnyPreview = hasSuggestionMenu
120
121 // Increase menu size on larger screen heights
122 const normalModeMaxVisible = terminalHeight > 35 ? 15 : 10
123 const { submitAnswers, skip } = useAskUserBridge()
124 const [askUserTitle] = React.useState(' Some questions for you ')
125
126 // Shared key intercept handler for suggestion menu navigation and history navigation
127 const handleKeyIntercept = useEvent(
128 (key: {
129 name?: string
130 sequence?: string
131 shift?: boolean
132 ctrl?: boolean
133 meta?: boolean
134 option?: boolean

Callers

nothing calls this directly

Calls 4

getInputModeConfigFunction · 0.90
useAskUserBridgeFunction · 0.90
useEventFunction · 0.90

Tested by

no test coverage detected