@@ -714,11 +714,15 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
714714 value = { mode }
715715 disabled = { textAreaDisabled }
716716 onChange = { ( e ) => {
717- const newMode = e . target . value as Mode
718- setMode ( newMode )
717+ const value = e . target . value
718+ if ( value === "prompts-action" ) {
719+ window . postMessage ( { type : "action" , action : "promptsButtonClicked" } )
720+ return
721+ }
722+ setMode ( value as Mode )
719723 vscode . postMessage ( {
720724 type : "mode" ,
721- text : newMode ,
725+ text : value ,
722726 } )
723727 } }
724728 style = { {
@@ -737,6 +741,10 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
737741 { mode . name }
738742 </ option >
739743 ) ) }
744+ < option disabled style = { { borderTop : "1px solid var(--vscode-dropdown-border)" } } >
745+ ────
746+ </ option >
747+ < option value = "prompts-action" > Edit...</ option >
740748 </ select >
741749 < div style = { caretContainerStyle } >
742750 < CaretIcon />
@@ -753,20 +761,25 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
753761 overflow : "hidden" ,
754762 } } >
755763 < select
756- value = { currentApiConfigName }
764+ value = { currentApiConfigName || "" }
757765 disabled = { textAreaDisabled }
758- onChange = { ( e ) =>
766+ onChange = { ( e ) => {
767+ const value = e . target . value
768+ if ( value === "settings-action" ) {
769+ window . postMessage ( { type : "action" , action : "settingsButtonClicked" } )
770+ return
771+ }
759772 vscode . postMessage ( {
760773 type : "loadApiConfiguration" ,
761- text : e . target . value ,
774+ text : value ,
762775 } )
763- }
776+ } }
764777 style = { {
765778 ...selectStyle ,
766779 width : "100%" ,
767780 textOverflow : "ellipsis" ,
768781 } } >
769- { ( listApiConfigMeta || [ ] ) ? .map ( ( config ) => (
782+ { ( listApiConfigMeta || [ ] ) . map ( ( config ) => (
770783 < option
771784 key = { config . name }
772785 value = { config . name }
@@ -777,6 +790,10 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
777790 { config . name }
778791 </ option >
779792 ) ) }
793+ < option disabled style = { { borderTop : "1px solid var(--vscode-dropdown-border)" } } >
794+ ────
795+ </ option >
796+ < option value = "settings-action" > Edit...</ option >
780797 </ select >
781798 < div style = { caretContainerStyle } >
782799 < CaretIcon />
@@ -806,14 +823,18 @@ const ChatTextArea = forwardRef<HTMLTextAreaElement, ChatTextAreaProps>(
806823 role = "button"
807824 aria-label = "enhance prompt"
808825 data-testid = "enhance-prompt-button"
809- className = { `input-icon-button ${ textAreaDisabled ? "disabled" : "" } codicon codicon-sparkle` }
826+ className = { `input-icon-button ${
827+ textAreaDisabled ? "disabled" : ""
828+ } codicon codicon-sparkle`}
810829 onClick = { ( ) => ! textAreaDisabled && handleEnhancePrompt ( ) }
811830 style = { { fontSize : 16.5 } }
812831 />
813832 ) }
814833 </ div >
815834 < span
816- className = { `input-icon-button ${ shouldDisableImages ? "disabled" : "" } codicon codicon-device-camera` }
835+ className = { `input-icon-button ${
836+ shouldDisableImages ? "disabled" : ""
837+ } codicon codicon-device-camera`}
817838 onClick = { ( ) => ! shouldDisableImages && onSelectImages ( ) }
818839 style = { { fontSize : 16.5 } }
819840 />
0 commit comments