@@ -397,57 +397,59 @@ const InputMessage = observer((props: any) => {
397397 marginTop : 5 ,
398398 } }
399399 >
400- < Menu
401- width = { chat . chatPanelWidth - 10 }
402- position = "bottom-start"
403- shadow = "sm"
404- withArrow
405- styles = { menuStyles }
406- disabled = { contextMenus . length === 0 }
407- >
408- < Menu . Target >
409- < ActionIcon
410- radius = "xl"
411- variant = "default"
412- disabled = { generating || chat . disabled }
413- className = { classes . actionIcon }
414- >
415- < IconTextPlus size = "1rem" />
416- </ ActionIcon >
417- </ Menu . Target >
418- < Menu . Dropdown >
419- < ScrollArea . Autosize placeholder = "" type = "always" mah = { 240 } >
420- { [ ...contextMenus ]
421- . sort ( ( a , b ) => {
422- if ( a . name === "<custom command>" ) {
423- return 1 ; // Placing '<custom command>' at the end
424- } else if ( b . name === "<custom command>" ) {
425- return - 1 ; // Placing '<custom command>' at the front
426- } else {
427- return ( a . name || "" ) . localeCompare ( b . name || "" ) ; // Sorting alphabetically for other cases
428- }
429- } )
430- . map ( ( { pattern, description, name } , index ) => {
431- return (
432- < Menu . Item
433- key = { `contexts-menus-${ index } ` }
434- icon = { contextMenuIcon ( name ) }
435- onClick = { ( ) => {
436- handleContextClick ( name ) ;
437- } }
438- >
439- { name }
440- < Text
441- sx = { { fontSize : "9pt" , color : theme . colors . gray [ 6 ] } }
400+ { ! showTopic && (
401+ < Menu
402+ width = { chat . chatPanelWidth - 10 }
403+ position = "bottom-start"
404+ shadow = "sm"
405+ withArrow
406+ styles = { menuStyles }
407+ disabled = { contextMenus . length === 0 }
408+ >
409+ < Menu . Target >
410+ < ActionIcon
411+ radius = "xl"
412+ variant = "default"
413+ disabled = { generating || chat . disabled }
414+ className = { classes . actionIcon }
415+ >
416+ < IconTextPlus size = "1rem" />
417+ </ ActionIcon >
418+ </ Menu . Target >
419+ < Menu . Dropdown >
420+ < ScrollArea . Autosize placeholder = "" type = "always" mah = { 240 } >
421+ { [ ...contextMenus ]
422+ . sort ( ( a , b ) => {
423+ if ( a . name === "<custom command>" ) {
424+ return 1 ; // Placing '<custom command>' at the end
425+ } else if ( b . name === "<custom command>" ) {
426+ return - 1 ; // Placing '<custom command>' at the front
427+ } else {
428+ return ( a . name || "" ) . localeCompare ( b . name || "" ) ; // Sorting alphabetically for other cases
429+ }
430+ } )
431+ . map ( ( { pattern, description, name } , index ) => {
432+ return (
433+ < Menu . Item
434+ key = { `contexts-menus-${ index } ` }
435+ icon = { contextMenuIcon ( name ) }
436+ onClick = { ( ) => {
437+ handleContextClick ( name ) ;
438+ } }
442439 >
443- { description }
444- </ Text >
445- </ Menu . Item >
446- ) ;
447- } ) }
448- </ ScrollArea . Autosize >
449- </ Menu . Dropdown >
450- </ Menu >
440+ { name }
441+ < Text
442+ sx = { { fontSize : "9pt" , color : theme . colors . gray [ 6 ] } }
443+ >
444+ { description }
445+ </ Text >
446+ </ Menu . Item >
447+ ) ;
448+ } ) }
449+ </ ScrollArea . Autosize >
450+ </ Menu . Dropdown >
451+ </ Menu >
452+ ) }
451453 < Menu
452454 position = "bottom-start"
453455 withArrow
@@ -484,14 +486,14 @@ const InputMessage = observer((props: any) => {
484486 </ Menu >
485487 { showTopic && (
486488 < >
487- < Topic
488- styleName = { classes . actionIcon }
489- disabled = { generating || chat . disabled }
490- />
491489 < AddTopic
492490 buttonStyles = { buttonStyles }
493491 disabled = { generating || chat . disabled }
494492 />
493+ < Topic
494+ styleName = { classes . actionIcon }
495+ disabled = { generating || chat . disabled }
496+ />
495497 </ >
496498 ) }
497499 </ Group >
0 commit comments