@@ -5,6 +5,7 @@ import { routeUserPrompt } from './commands/router'
55import { AgentModeToggle } from './components/agent-mode-toggle'
66import { BuildModeButtons } from './components/build-mode-buttons'
77import { LoginModal } from './components/login-modal'
8+ import { MessageRenderer } from './components/message-renderer'
89import {
910 MultilineInput ,
1011 type MultilineInputHandle ,
@@ -20,7 +21,6 @@ import { useElapsedTime } from './hooks/use-elapsed-time'
2021import { useInputHistory } from './hooks/use-input-history'
2122import { useKeyboardHandlers } from './hooks/use-keyboard-handlers'
2223import { useMessageQueue } from './hooks/use-message-queue'
23- import { MessageRenderer } from './components/message-renderer'
2424import { useChatScrollbox } from './hooks/use-scroll-management'
2525import { useSendMessage } from './hooks/use-send-message'
2626import { useSuggestionEngine } from './hooks/use-suggestion-engine'
@@ -39,7 +39,7 @@ import { BORDER_CHARS } from './utils/ui-constants'
3939import type { SendMessageTimerEvent } from './hooks/use-send-message'
4040import type { ContentBlock } from './types/chat'
4141import type { SendMessageFn } from './types/contracts/send-message'
42- import type { ScrollBoxRenderable } from '@opentui/core'
42+ import type { KeyEvent , ScrollBoxRenderable } from '@opentui/core'
4343
4444const MAX_VIRTUALIZED_TOP_LEVEL = 60
4545const VIRTUAL_OVERSCAN = 12
@@ -387,14 +387,12 @@ export const Chat = ({
387387 } , [ agentMatches . length , agentSelectedIndex ] )
388388
389389 const handleSlashMenuKey = useCallback (
390- (
391- key : any ,
392- ) : boolean => {
390+ ( key : KeyEvent ) : boolean => {
393391 if ( ! slashContext . active || slashMatches . length === 0 ) {
394392 return false
395393 }
396394
397- const hasModifier = Boolean ( key . ctrl || key . meta || key . alt || key . option )
395+ const hasModifier = Boolean ( key . ctrl || key . meta || key . option )
398396
399397 function selectCurrent ( ) : boolean {
400398 const selected = slashMatches [ slashSelectedIndex ] ?? slashMatches [ 0 ]
@@ -412,7 +410,11 @@ export const Chat = ({
412410 )
413411 const replacement = `/${ selected . id } `
414412 const newValue = before + replacement + after
415- setInputValue ( { text : newValue , cursorPosition : before . length + replacement . length , lastEditDueToNav : false } )
413+ setInputValue ( {
414+ text : newValue ,
415+ cursorPosition : before . length + replacement . length ,
416+ lastEditDueToNav : false ,
417+ } )
416418 setSlashSelectedIndex ( 0 )
417419 return true
418420 }
@@ -468,14 +470,12 @@ export const Chat = ({
468470 )
469471
470472 const handleAgentMenuKey = useCallback (
471- (
472- key : any ,
473- ) : boolean => {
473+ ( key : KeyEvent ) : boolean => {
474474 if ( ! mentionContext . active || agentMatches . length === 0 ) {
475475 return false
476476 }
477477
478- const hasModifier = Boolean ( key . ctrl || key . meta || key . alt || key . option )
478+ const hasModifier = Boolean ( key . ctrl || key . meta || key . option )
479479
480480 function selectCurrent ( ) : boolean {
481481 const selected = agentMatches [ agentSelectedIndex ] ?? agentMatches [ 0 ]
@@ -494,7 +494,8 @@ export const Chat = ({
494494 )
495495 const replacement = `@${ selected . displayName } `
496496 const newValue = before + replacement + after
497- setInputValue ( { text : newValue ,
497+ setInputValue ( {
498+ text : newValue ,
498499 cursorPosition : before . length + replacement . length ,
499500 lastEditDueToNav : false ,
500501 } )
@@ -553,9 +554,7 @@ export const Chat = ({
553554 )
554555
555556 const handleSuggestionMenuKey = useCallback (
556- (
557- key : any ,
558- ) : boolean => {
557+ ( key : KeyEvent ) : boolean => {
559558 if ( handleSlashMenuKey ( key ) ) {
560559 return true
561560 }
@@ -748,8 +747,6 @@ export const Chat = ({
748747 topLevelMessages . length - virtualTopLevelMessages . length ,
749748 )
750749
751-
752-
753750 const virtualizationNotice =
754751 shouldVirtualize && hiddenTopLevelCount > 0 ? (
755752 < text
0 commit comments