@@ -67,9 +67,10 @@ import globals from '../../../shared/extensionGlobals'
6767import { MynahIconsType , MynahUIDataModel , QuickActionCommand } from '@aws/mynah-ui'
6868import { LspClient } from '../../../amazonq/lsp/lspClient'
6969import { ContextCommandItem , ContextCommandItemType } from '../../../amazonq/lsp/types'
70- import { createPromptCommand , workspaceCommand } from '../../../amazonq/webview/ui/tabs/constants'
70+ import { workspaceCommand } from '../../../amazonq/webview/ui/tabs/constants'
7171import fs from '../../../shared/fs/fs'
7272import { FeatureConfigProvider , Features } from '../../../shared/featureConfig'
73+ import { i18n } from '../../../shared/i18n-helper'
7374
7475export interface ChatControllerMessagePublishers {
7576 readonly processPromptChatMessage : MessagePublisher < PromptMessage >
@@ -121,7 +122,7 @@ export interface ChatControllerMessageListeners {
121122 readonly processFileClick : MessageListener < FileClick >
122123}
123124
124- const promptFileExtension = '.prompt. md'
125+ const promptFileExtension = '.md'
125126
126127const additionalContentInnerContextLimit = 8192
127128
@@ -134,6 +135,8 @@ const getUserPromptsDirectory = () => {
134135 return path . join ( fs . getUserHomeDir ( ) , '.aws' , 'amazonq' , 'prompts' )
135136}
136137
138+ const createSavedPromptCommandId = 'create-saved-prompt'
139+
137140export class ChatController {
138141 private readonly sessionStorage : ChatSessionStorage
139142 private readonly triggerEventsStorage : TriggerEventsStorage
@@ -456,9 +459,9 @@ export class ChatController {
456459 groupName : 'Prompts' ,
457460 actions : [
458461 {
459- id : 'create-prompt' ,
462+ id : createSavedPromptCommandId ,
460463 icon : 'plus' ,
461- description : 'Create new prompt' ,
464+ description : i18n ( 'AWS.amazonq.savedPrompts.action' ) ,
462465 } ,
463466 ] ,
464467 commands : [ ] ,
@@ -503,7 +506,11 @@ export class ChatController {
503506 }
504507
505508 // Add create prompt button to the bottom of the prompts list
506- promptsCmd . children ?. [ 0 ] . commands . push ( { command : createPromptCommand , icon : 'list-add' as MynahIconsType } )
509+ promptsCmd . children ?. [ 0 ] . commands . push ( {
510+ command : i18n ( 'AWS.amazonq.savedPrompts.action' ) ,
511+ id : createSavedPromptCommandId ,
512+ icon : 'list-add' as MynahIconsType ,
513+ } )
507514
508515 const lspClientReady = await LspClient . instance . waitUntilReady ( )
509516 if ( lspClientReady ) {
@@ -542,21 +549,21 @@ export class ChatController {
542549 id : 'prompt-name' ,
543550 type : 'textinput' ,
544551 mandatory : true ,
545- title : 'Prompt name' ,
546- placeholder : 'Enter prompt name' ,
547- description : `Use this prompt by typing \`@\` followed by the prompt name. Prompt will be saved in ${ getUserPromptsDirectory ( ) } .` ,
552+ title : i18n ( 'AWS.amazonq.savedPrompts.title' ) ,
553+ placeholder : i18n ( 'AWS.amazonq.savedPrompts.placeholder' ) ,
554+ description : i18n ( 'AWS.amazonq.savedPrompts.description' ) ,
548555 } ,
549556 ] ,
550557 [
551- { id : 'cancel-create-prompt' , text : 'Cancel' , status : 'clear' } ,
552- { id : 'submit-create-prompt' , text : 'Create' , status : 'main' } ,
558+ { id : 'cancel-create-prompt' , text : i18n ( 'AWS.generic.cancel' ) , status : 'clear' } ,
559+ { id : 'submit-create-prompt' , text : i18n ( 'AWS.amazonq.savedPrompts.create' ) , status : 'main' } ,
553560 ] ,
554561 `Create a saved prompt`
555562 )
556563 }
557564
558565 private processQuickCommandGroupActionClicked ( message : QuickCommandGroupActionClick ) {
559- if ( message . actionId === 'create-prompt' ) {
566+ if ( message . actionId === createSavedPromptCommandId ) {
560567 this . handlePromptCreate ( message . tabID )
561568 }
562569 }
@@ -578,7 +585,7 @@ export class ChatController {
578585 }
579586
580587 private async processContextSelected ( message : ContextSelectedMessage ) {
581- if ( message . tabID && message . contextItem . command === createPromptCommand ) {
588+ if ( message . tabID && message . contextItem . id === createSavedPromptCommandId ) {
582589 this . handlePromptCreate ( message . tabID )
583590 }
584591 }
0 commit comments