@@ -410,7 +410,8 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
410410 const selectableOptions = options . filter (
411411 ( option ) =>
412412 option . type !== ContextMenuOptionType . URL &&
413- option . type !== ContextMenuOptionType . NoResults ,
413+ option . type !== ContextMenuOptionType . NoResults &&
414+ option . type !== ContextMenuOptionType . SectionHeader ,
414415 )
415416
416417 if ( selectableOptions . length === 0 ) return - 1 // No selectable options
@@ -443,7 +444,8 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
443444 if (
444445 selectedOption &&
445446 selectedOption . type !== ContextMenuOptionType . URL &&
446- selectedOption . type !== ContextMenuOptionType . NoResults
447+ selectedOption . type !== ContextMenuOptionType . NoResults &&
448+ selectedOption . type !== ContextMenuOptionType . SectionHeader
447449 ) {
448450 handleMentionSelect ( selectedOption . type , selectedOption . value )
449451 }
@@ -559,7 +561,8 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
559561 // Handle slash command - request fresh commands
560562 const query = newValue
561563 setSearchQuery ( query )
562- setSelectedMenuIndex ( 0 )
564+ // Set to first selectable item (skip section headers)
565+ setSelectedMenuIndex ( 1 ) // Section header is at 0, first command is at 1
563566 // Request commands fresh each time slash menu is shown
564567 vscode . postMessage ( { type : "requestCommands" } )
565568 } else {
0 commit comments