Skip to content

Commit 3acc297

Browse files
authored
fix: finalize text for feature dev ui (#1590)
Problem: - We want to update some of our ui text before launching to make everything more clear Solution: - Update it
1 parent 653e0f2 commit 3acc297

File tree

5 files changed

+27
-28
lines changed

5 files changed

+27
-28
lines changed

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

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,10 @@ export class FeatureDevController {
8888
})
8989
this.chatControllerMessageListeners.followUpClicked.event(data => {
9090
switch (data.followUp.type) {
91-
case FollowUpTypes.WriteCode:
92-
return this.writeCodeClicked(data)
93-
case FollowUpTypes.AcceptCode:
94-
return this.acceptCode(data)
91+
case FollowUpTypes.GenerateCode:
92+
return this.generateCodeClicked(data)
93+
case FollowUpTypes.InsertCode:
94+
return this.insertCode(data)
9595
case FollowUpTypes.ProvideFeedbackAndRegenerateCode:
9696
return this.provideFeedbackAndRegenerateCode(data)
9797
case FollowUpTypes.Retry:
@@ -249,10 +249,10 @@ export class FeatureDevController {
249249
// Ensure that the loading icon stays showing
250250
this.messenger.sendAsyncEventProgress(tabID, true, 'Ok, let me create a plan. This may take a few minutes.')
251251

252-
this.messenger.sendUpdatePlaceholder(tabID, 'Generating implementation plan ...')
252+
this.messenger.sendUpdatePlaceholder(tabID, 'Generating plan ...')
253253

254254
const interactions = await session.send(message)
255-
this.messenger.sendUpdatePlaceholder(tabID, 'Add more detail to iterate on the approach')
255+
this.messenger.sendUpdatePlaceholder(tabID, 'How can this plan be improved?')
256256

257257
// Resolve the "..." with the content
258258
this.messenger.sendAnswer({
@@ -265,8 +265,7 @@ export class FeatureDevController {
265265
this.messenger.sendAnswer({
266266
type: 'answer',
267267
tabID,
268-
message:
269-
'Would you like me to generate a suggestion for this? You will be able to review a file diff before inserting code in your project.',
268+
message: `Would you like to generate a suggestion for this? You’ll review a file diff before inserting into your project.`,
270269
})
271270

272271
// Follow up with action items and complete the request stream
@@ -288,7 +287,7 @@ export class FeatureDevController {
288287
this.messenger.sendAsyncEventProgress(
289288
tabID,
290289
true,
291-
`This may take a few minutes. I will send a notification when it's complete if you navigate away from this panel`
290+
`This may take a few minutes. I will send a notification when it's complete if you navigate away from this panel, but please keep the tab open.`
292291
)
293292

294293
try {
@@ -297,7 +296,7 @@ export class FeatureDevController {
297296
type: 'answer-stream',
298297
tabID,
299298
})
300-
this.messenger.sendUpdatePlaceholder(tabID, 'Writing code ...')
299+
this.messenger.sendUpdatePlaceholder(tabID, 'Generating code ...')
301300
await session.send(message)
302301
const filePaths = session.state.filePaths ?? []
303302
const deletedFiles = session.state.deletedFiles ?? []
@@ -367,7 +366,7 @@ export class FeatureDevController {
367366
}
368367

369368
// TODO add type
370-
private async writeCodeClicked(message: any) {
369+
private async generateCodeClicked(message: any) {
371370
let session
372371
try {
373372
session = await this.sessionStorage.getSession(message.tabID)
@@ -387,7 +386,7 @@ export class FeatureDevController {
387386
}
388387

389388
// TODO add type
390-
private async acceptCode(message: any) {
389+
private async insertCode(message: any) {
391390
let session
392391
try {
393392
session = await this.sessionStorage.getSession(message.tabID)
@@ -396,7 +395,7 @@ export class FeatureDevController {
396395
enabled: true,
397396
result: 'Succeeded',
398397
})
399-
await session.acceptChanges()
398+
await session.insertChanges()
400399

401400
this.messenger.sendAnswer({
402401
type: 'answer',
@@ -426,7 +425,7 @@ export class FeatureDevController {
426425
this.messenger.sendUpdatePlaceholder(message.tabID, 'Provide input on additional improvements')
427426
} catch (err: any) {
428427
this.messenger.sendErrorMessage(
429-
createUserFacingErrorMessage(`Failed to accept code changes: ${err.message}`),
428+
createUserFacingErrorMessage(`Failed to insert code changes: ${err.message}`),
430429
message.tabID,
431430
this.retriesRemaining(session),
432431
session?.state.phase
@@ -486,21 +485,21 @@ export class FeatureDevController {
486485
case 'Approach':
487486
return [
488487
{
489-
pillText: 'Write Code',
490-
type: FollowUpTypes.WriteCode,
488+
pillText: 'Generate code',
489+
type: FollowUpTypes.GenerateCode,
491490
status: 'info',
492491
},
493492
]
494493
case 'Codegen':
495494
return [
496495
{
497-
pillText: 'Accept changes',
498-
type: FollowUpTypes.AcceptCode,
496+
pillText: 'Insert code',
497+
type: FollowUpTypes.InsertCode,
499498
icon: 'ok' as MynahIcons,
500499
status: 'success',
501500
},
502501
{
503-
pillText: 'Provide feedback and regenerate',
502+
pillText: 'Provide feedback to regenerate',
504503
type: FollowUpTypes.ProvideFeedbackAndRegenerateCode,
505504
icon: 'refresh' as MynahIcons,
506505
status: 'info',

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ export class Session {
9898
}
9999

100100
/**
101-
* Triggered by the Write Code follow up button to move to the code generation phase
101+
* Triggered by the Generate Code follow up button to move to the code generation phase
102102
*/
103103
initCodegen(): void {
104104
this._state = new PrepareCodeGenState(
@@ -157,7 +157,7 @@ export class Session {
157157
return resp.interaction
158158
}
159159

160-
public async acceptChanges() {
160+
public async insertChanges() {
161161
for (const filePath of this.state.filePaths ?? []) {
162162
const absolutePath = path.join(filePath.workspaceFolder.uri.fsPath, filePath.relativePath)
163163

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -403,13 +403,13 @@ export class MockCodeGenState implements SessionState {
403403
type: 'system-prompt',
404404
followUps: [
405405
{
406-
pillText: 'Accept changes',
407-
type: FollowUpTypes.AcceptCode,
406+
pillText: 'Insert code',
407+
type: FollowUpTypes.InsertCode,
408408
icon: 'ok' as MynahIcons,
409409
status: 'success',
410410
},
411411
{
412-
pillText: 'Provide feedback and regenerate',
412+
pillText: 'Provide feedback to regenerate',
413413
type: FollowUpTypes.ProvideFeedbackAndRegenerateCode,
414414
icon: 'refresh' as MynahIcons,
415415
status: 'info',

packages/core/src/amazonqFeatureDev/types.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ export interface SessionStateInteraction {
2323
}
2424

2525
export enum FollowUpTypes {
26-
WriteCode = 'WriteCode',
27-
AcceptCode = 'AcceptCode',
26+
GenerateCode = 'GenerateCode',
27+
InsertCode = 'InsertCode',
2828
ProvideFeedbackAndRegenerateCode = 'ProvideFeedbackAndRegenerateCode',
2929
Retry = 'Retry',
3030
ModifyDefaultSourceFolder = 'ModifyDefaultSourceFolder',

packages/core/src/testE2E/amazonq/featureDev.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe.skip('Amazon Q Feature Dev', function () {
8181
type: FollowUpTypes.NewTask,
8282
},
8383
{
84-
type: FollowUpTypes.WriteCode,
84+
type: FollowUpTypes.GenerateCode,
8585
disabled: false,
8686
},
8787
])
@@ -123,7 +123,7 @@ describe.skip('Amazon Q Feature Dev', function () {
123123
type: FollowUpTypes.NewTask,
124124
},
125125
{
126-
type: FollowUpTypes.WriteCode,
126+
type: FollowUpTypes.GenerateCode,
127127
disabled: false,
128128
},
129129
])

0 commit comments

Comments
 (0)