Skip to content

Commit 14593a9

Browse files
committed
fix(dev): update messaging for total iterations
1 parent 904b4d6 commit 14593a9

File tree

1 file changed

+9
-3
lines changed
  • packages/core/src/amazonqFeatureDev/controllers/chat

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ import { openDeletedDiff, openDiff } from '../../../amazonq/commons/diff'
4747
import { i18n } from '../../../shared/i18n-helper'
4848
import globals from '../../../shared/extensionGlobals'
4949

50+
export const TotalSteps = 3
51+
5052
export interface ChatControllerEventEmitters {
5153
readonly processHumanChatMessage: EventEmitter<any>
5254
readonly followUpClicked: EventEmitter<any>
@@ -454,8 +456,9 @@ export class FeatureDevController {
454456
if (session?.state?.tokenSource?.token.isCancellationRequested) {
455457
this.workOnNewTask(
456458
session,
457-
session.state.codeGenerationRemainingIterationCount || session.state?.currentIteration,
458-
session.state.codeGenerationTotalIterationCount,
459+
session.state.codeGenerationRemainingIterationCount ||
460+
TotalSteps - (session.state?.currentIteration || 0),
461+
session.state.codeGenerationTotalIterationCount || TotalSteps,
459462
session?.state?.tokenSource?.token.isCancellationRequested
460463
)
461464
this.disposeToken(session)
@@ -490,7 +493,7 @@ export class FeatureDevController {
490493
message:
491494
remainingIterations === 0
492495
? "I stopped generating your code. You don't have more iterations left, however, you can start a new session."
493-
: `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.`}`,
496+
: `I stopped generating your code. If you want to continue working on this task, provide another description. You have ${remainingIterations} out of ${totalIterations} code generations left.`,
494497
type: 'answer-part',
495498
tabID: message.tabID,
496499
})
@@ -513,6 +516,9 @@ export class FeatureDevController {
513516
},
514517
],
515518
})
519+
this.messenger.sendChatInputEnabled(message.tabID, false)
520+
this.messenger.sendUpdatePlaceholder(message.tabID, i18n('AWS.amazonq.featureDev.pillText.selectOption'))
521+
return
516522
}
517523

518524
// Ensure that chat input is enabled so that they can provide additional iterations if they choose

0 commit comments

Comments
 (0)