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

Function processNextMessage

web/src/components/IDEDemo.tsx:282–307  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

280 }
281
282 const processNextMessage = () => {
283 if (currentMessageIndex >= messages.length) {
284 // Start typing animation after all messages are shown
285 startTypingAnimation()
286 return
287 }
288
289 const message = messages[currentMessageIndex]
290
291 if (message.startsWith('your-next-app >')) {
292 setTerminalLines((prev) => [...prev, message])
293 currentMessageIndex++
294 setTimeout(processNextMessage, 1500)
295 } else {
296 streamWords(message, () => {
297 currentMessageIndex++
298 const delay =
299 currentMessageIndex === 1
300 ? 2000
301 : currentMessageIndex === messages.length
302 ? 0
303 : 700
304 setTimeout(processNextMessage, delay)
305 })
306 }
307 }
308
309 const startTypingAnimation = () => {
310 let currentPhraseIndex = 0

Callers 1

useMessageQueueFunction · 0.85

Calls 3

startTypingAnimationFunction · 0.85
setTimeoutFunction · 0.85
streamWordsFunction · 0.85

Tested by

no test coverage detected