Skip to content

Commit 9597f25

Browse files
committed
fix(dev): update strings
1 parent 20e5493 commit 9597f25

File tree

5 files changed

+52
-30
lines changed

5 files changed

+52
-30
lines changed

packages/core/package.nls.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,7 @@
298298
"AWS.amazonq.featureDev.pillText.generatingCode": "Generating code...",
299299
"AWS.amazonq.featureDev.pillText.requestingChanges": "Requesting changes ...",
300300
"AWS.amazonq.featureDev.pillText.insertCode": "Accept code",
301-
"AWS.amazonq.featureDev.pillText.stoppingCodeGeneration": "Stopping code generation ...",
302-
"AWS.amazonq.featureDev.pillText.stoppedCodeGeneration": "The code generation has stopped.",
301+
"AWS.amazonq.featureDev.pillText.stoppingCodeGeneration": "Stopping code generation...",
303302
"AWS.amazonq.featureDev.pillText.sendFeedback": "Send feedback",
304303
"AWS.amazonq.featureDev.pillText.selectFiles": "Select files for context",
305304
"AWS.amazonq.featureDev.pillText.retry": "Retry",
@@ -316,7 +315,7 @@
316315
"AWS.amazonq.featureDev.answer.sessionClosed": "Okay, I've ended this chat session. You can open a new tab to chat or start another workflow.",
317316
"AWS.amazonq.featureDev.answer.newTaskChanges": "What new task would you like to work on?",
318317
"AWS.amazonq.featureDev.placeholder.chatInputDisabled": "Chat input is disabled",
319-
"AWS.amazonq.featureDev.placeholder.additionalImprovements": "Choose an option to proceed",
318+
"AWS.amazonq.featureDev.placeholder.additionalImprovements": "Describe your task or issue in detail",
320319
"AWS.amazonq.featureDev.placeholder.feedback": "Provide feedback or comments",
321320
"AWS.amazonq.featureDev.placeholder.describe": "Describe your task or issue in detail",
322321
"AWS.amazonq.featureDev.placeholder.sessionClosed": "Open a new chat tab to continue"

packages/core/src/amazonq/webview/ui/texts/constants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ export const uiComponentsTexts = {
1919
save: 'Save',
2020
cancel: 'Cancel',
2121
submit: 'Submit',
22-
stopGenerating: 'Stop generating',
22+
stopGenerating: 'Stop',
2323
copyToClipboard: 'Copied to clipboard',
2424
noMoreTabsTooltip: 'You can only open ten conversation tabs at a time.',
2525
codeSuggestionWithReferenceTitle: 'Some suggestions contain code with references.',

packages/core/src/amazonqFeatureDev/controllers/chat/controller.ts

Lines changed: 46 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -450,8 +450,13 @@ export class FeatureDevController {
450450
// Finish processing the event
451451

452452
if (session?.state?.tokenSource?.token.isCancellationRequested) {
453+
this.workOnNewTask(
454+
session,
455+
session.state.codeGenerationRemainingIterationCount || session.state?.currentIteration,
456+
session.state.codeGenerationTotalIterationCount,
457+
session?.state?.tokenSource?.token.isCancellationRequested
458+
)
453459
this.disposeToken(session)
454-
this.workOnNewTask(session)
455460
} else {
456461
this.messenger.sendAsyncEventProgress(tabID, false, undefined)
457462

@@ -472,28 +477,41 @@ export class FeatureDevController {
472477
}
473478
}
474479
}
475-
private workOnNewTask(message: any) {
476-
this.messenger.sendAnswer({
477-
message: i18n('AWS.amazonq.featureDev.pillText.stoppedCodeGeneration'),
478-
type: 'answer-part',
479-
tabID: message.tabID,
480-
})
481-
this.messenger.sendAnswer({
482-
type: 'system-prompt',
483-
tabID: message.tabID,
484-
followUps: [
485-
{
486-
pillText: i18n('AWS.amazonq.featureDev.pillText.newTask'),
487-
type: FollowUpTypes.NewTask,
488-
status: 'info',
489-
},
490-
{
491-
pillText: i18n('AWS.amazonq.featureDev.pillText.closeSession'),
492-
type: FollowUpTypes.CloseSession,
493-
status: 'info',
494-
},
495-
],
496-
})
480+
private workOnNewTask(
481+
message: any,
482+
remainingIterations?: number,
483+
totalIterations?: number,
484+
isStoppedGeneration: boolean = false
485+
) {
486+
if (isStoppedGeneration) {
487+
this.messenger.sendAnswer({
488+
message:
489+
remainingIterations === 0
490+
? "I stopped generating your code. You don't have more iterations left, however, you can start a new session."
491+
: `I stopped generating your code. If you want to continue working on this task, provide another description. ${!totalIterations ? `You have started ${remainingIterations} code generations.` : `You have ${remainingIterations} out of ${totalIterations} code generations left.`}`,
492+
type: 'answer-part',
493+
tabID: message.tabID,
494+
})
495+
}
496+
497+
if ((remainingIterations === 0 && isStoppedGeneration) || !isStoppedGeneration) {
498+
this.messenger.sendAnswer({
499+
type: 'system-prompt',
500+
tabID: message.tabID,
501+
followUps: [
502+
{
503+
pillText: i18n('AWS.amazonq.featureDev.pillText.newTask'),
504+
type: FollowUpTypes.NewTask,
505+
status: 'info',
506+
},
507+
{
508+
pillText: i18n('AWS.amazonq.featureDev.pillText.closeSession'),
509+
type: FollowUpTypes.CloseSession,
510+
status: 'info',
511+
},
512+
],
513+
})
514+
}
497515

498516
// Ensure that chat input is enabled so that they can provide additional iterations if they choose
499517
this.messenger.sendChatInputEnabled(message.tabID, true)
@@ -528,7 +546,11 @@ export class FeatureDevController {
528546
canBeVoted: true,
529547
})
530548

531-
this.workOnNewTask(message)
549+
this.workOnNewTask(
550+
message,
551+
session.state.codeGenerationRemainingIterationCount,
552+
session.state.codeGenerationTotalIterationCount
553+
)
532554
} catch (err: any) {
533555
this.messenger.sendErrorMessage(
534556
createUserFacingErrorMessage(`Failed to insert code changes: ${err.message}`),

packages/core/src/amazonqFeatureDev/session/sessionState.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ export class CodeGenState extends CodeGenBase implements SessionState {
278278
public deletedFiles: DeletedFileInfo[],
279279
public references: CodeReference[],
280280
tabID: string,
281-
private currentIteration: number,
281+
public currentIteration: number,
282282
public uploadHistory: UploadHistory,
283283
public codeGenerationRemainingIterationCount?: number,
284284
public codeGenerationTotalIterationCount?: number
@@ -485,7 +485,7 @@ export class PrepareCodeGenState implements SessionState {
485485
public deletedFiles: DeletedFileInfo[],
486486
public references: CodeReference[],
487487
public tabID: string,
488-
private currentIteration: number,
488+
public currentIteration: number,
489489

490490
public codeGenerationRemainingIterationCount?: number,
491491
public codeGenerationTotalIterationCount?: number,

packages/core/src/amazonqFeatureDev/types.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export interface SessionState {
6161
readonly references?: CodeReference[]
6262
readonly phase?: SessionStatePhase
6363
readonly uploadId: string
64+
readonly currentIteration?: number
6465
currentCodeGenerationId?: string
6566
tokenSource?: CancellationTokenSource
6667
readonly codeGenerationId?: string

0 commit comments

Comments
 (0)