55 VSCodeRadio ,
66 VSCodeTextArea ,
77 VSCodeLink ,
8+ VSCodeTextField ,
89} from "@vscode/webview-ui-toolkit/react"
910import { Trans } from "react-i18next"
1011import { ChevronDown , X } from "lucide-react"
@@ -106,6 +107,9 @@ const ModesView = ({ onDone }: ModesViewProps) => {
106107 if ( updatedPrompt . roleDefinition === getRoleDefinition ( mode ) ) {
107108 delete updatedPrompt . roleDefinition
108109 }
110+ if ( updatedPrompt . description === getDescription ( mode ) ) {
111+ delete updatedPrompt . description
112+ }
109113 if ( updatedPrompt . whenToUse === getWhenToUse ( mode ) ) {
110114 delete updatedPrompt . whenToUse
111115 }
@@ -195,6 +199,7 @@ const ModesView = ({ onDone }: ModesViewProps) => {
195199 // State for create mode dialog
196200 const [ newModeName , setNewModeName ] = useState ( "" )
197201 const [ newModeSlug , setNewModeSlug ] = useState ( "" )
202+ const [ newModeDescription , setNewModeDescription ] = useState ( "" )
198203 const [ newModeRoleDefinition , setNewModeRoleDefinition ] = useState ( "" )
199204 const [ newModeWhenToUse , setNewModeWhenToUse ] = useState ( "" )
200205 const [ newModeCustomInstructions , setNewModeCustomInstructions ] = useState ( "" )
@@ -212,6 +217,7 @@ const ModesView = ({ onDone }: ModesViewProps) => {
212217 // Reset form fields
213218 setNewModeName ( "" )
214219 setNewModeSlug ( "" )
220+ setNewModeDescription ( "" )
215221 setNewModeGroups ( availableGroups )
216222 setNewModeRoleDefinition ( "" )
217223 setNewModeWhenToUse ( "" )
@@ -732,8 +738,7 @@ const ModesView = ({ onDone }: ModesViewProps) => {
732738 < div className = "text-sm text-vscode-descriptionForeground mb-2" >
733739 { t ( "prompts:description.description" ) }
734740 </ div >
735- < VSCodeTextArea
736- resize = "vertical"
741+ < VSCodeTextField
737742 value = { ( ( ) => {
738743 const customMode = findModeBySlug ( visualMode , customModes )
739744 const prompt = customModePrompts ?. [ visualMode ] as PromptComponent
@@ -759,8 +764,7 @@ const ModesView = ({ onDone }: ModesViewProps) => {
759764 }
760765 } }
761766 className = "w-full"
762- rows = { 1 }
763- data-testid = { `${ getCurrentMode ( ) ?. slug || "code" } -description-textarea` }
767+ data-testid = { `${ getCurrentMode ( ) ?. slug || "code" } -description-textfield` }
764768 />
765769 </ div >
766770
@@ -1248,6 +1252,20 @@ const ModesView = ({ onDone }: ModesViewProps) => {
12481252 ) }
12491253 </ div >
12501254
1255+ < div className = "mb-4" >
1256+ < div className = "font-bold mb-1" > { t ( "prompts:createModeDialog.description.label" ) } </ div >
1257+ < div className = "text-[13px] text-vscode-descriptionForeground mb-2" >
1258+ { t ( "prompts:createModeDialog.description.description" ) }
1259+ </ div >
1260+ < VSCodeTextField
1261+ value = { newModeDescription }
1262+ onChange = { ( e ) => {
1263+ setNewModeDescription ( ( e . target as HTMLInputElement ) . value )
1264+ } }
1265+ className = "w-full"
1266+ />
1267+ </ div >
1268+
12511269 < div className = "mb-4" >
12521270 < div className = "font-bold mb-1" > { t ( "prompts:createModeDialog.whenToUse.label" ) } </ div >
12531271 < div className = "text-[13px] text-vscode-descriptionForeground mb-2" >
0 commit comments