@@ -729,60 +729,57 @@ const ModesView = ({ onDone }: ModesViewProps) => {
729729 </ div >
730730
731731 { /* Description section */ }
732- { /* Only show description for custom modes */ }
733- { visualMode && findModeBySlug ( visualMode , customModes ) && (
734- < div className = "mb-4" >
735- < div className = "flex justify-between items-center mb-1" >
736- < div className = "font-bold" > { t ( "prompts:description.title" ) } </ div >
737- { ! findModeBySlug ( visualMode , customModes ) && (
738- < Button
739- variant = "ghost"
740- size = "icon"
741- onClick = { ( ) => {
742- const currentMode = getCurrentMode ( )
743- if ( currentMode ?. slug ) {
744- handleAgentReset ( currentMode . slug , "description" )
745- }
746- } }
747- title = { t ( "prompts:description.resetToDefault" ) }
748- data-testid = "description-reset" >
749- < span className = "codicon codicon-discard" > </ span >
750- </ Button >
751- ) }
752- </ div >
753- < div className = "text-sm text-vscode-descriptionForeground mb-2" >
754- { t ( "prompts:description.description" ) }
755- </ div >
756- < VSCodeTextField
757- value = { ( ( ) => {
758- const customMode = findModeBySlug ( visualMode , customModes )
759- const prompt = customModePrompts ?. [ visualMode ] as PromptComponent
760- return customMode ?. description ?? prompt ?. description ?? getDescription ( visualMode )
761- } ) ( ) }
762- onChange = { ( e ) => {
763- const value =
764- ( e as unknown as CustomEvent ) ?. detail ?. target ?. value ||
765- ( ( e as any ) . target as HTMLTextAreaElement ) . value
766- const customMode = findModeBySlug ( visualMode , customModes )
767- if ( customMode ) {
768- // For custom modes, update the JSON file
769- updateCustomMode ( visualMode , {
770- ...customMode ,
771- description : value . trim ( ) || undefined ,
772- source : customMode . source || "global" ,
773- } )
774- } else {
775- // For built-in modes, update the prompts
776- updateAgentPrompt ( visualMode , {
777- description : value . trim ( ) || undefined ,
778- } )
779- }
780- } }
781- className = "w-full"
782- data-testid = { `${ getCurrentMode ( ) ?. slug || "code" } -description-textfield` }
783- />
732+ < div className = "mb-4" >
733+ < div className = "flex justify-between items-center mb-1" >
734+ < div className = "font-bold" > { t ( "prompts:description.title" ) } </ div >
735+ { ! findModeBySlug ( visualMode , customModes ) && (
736+ < Button
737+ variant = "ghost"
738+ size = "icon"
739+ onClick = { ( ) => {
740+ const currentMode = getCurrentMode ( )
741+ if ( currentMode ?. slug ) {
742+ handleAgentReset ( currentMode . slug , "description" )
743+ }
744+ } }
745+ title = { t ( "prompts:description.resetToDefault" ) }
746+ data-testid = "description-reset" >
747+ < span className = "codicon codicon-discard" > </ span >
748+ </ Button >
749+ ) }
784750 </ div >
785- ) }
751+ < div className = "text-sm text-vscode-descriptionForeground mb-2" >
752+ { t ( "prompts:description.description" ) }
753+ </ div >
754+ < VSCodeTextField
755+ value = { ( ( ) => {
756+ const customMode = findModeBySlug ( visualMode , customModes )
757+ const prompt = customModePrompts ?. [ visualMode ] as PromptComponent
758+ return customMode ?. description ?? prompt ?. description ?? getDescription ( visualMode )
759+ } ) ( ) }
760+ onChange = { ( e ) => {
761+ const value =
762+ ( e as unknown as CustomEvent ) ?. detail ?. target ?. value ||
763+ ( ( e as any ) . target as HTMLTextAreaElement ) . value
764+ const customMode = findModeBySlug ( visualMode , customModes )
765+ if ( customMode ) {
766+ // For custom modes, update the JSON file
767+ updateCustomMode ( visualMode , {
768+ ...customMode ,
769+ description : value . trim ( ) || undefined ,
770+ source : customMode . source || "global" ,
771+ } )
772+ } else {
773+ // For built-in modes, update the prompts
774+ updateAgentPrompt ( visualMode , {
775+ description : value . trim ( ) || undefined ,
776+ } )
777+ }
778+ } }
779+ className = "w-full"
780+ data-testid = { `${ getCurrentMode ( ) ?. slug || "code" } -description-textfield` }
781+ />
782+ </ div >
786783
787784 { /* When to Use section */ }
788785 < div className = "mb-4" >
0 commit comments