Skip to content

Commit

Permalink
fix(amazonq): prompt to choose a folder for /doc aws#6159
Browse files Browse the repository at this point in the history
## Problem
When a user clicks the "Change folder" button when creating or updating
a README, the "Generating answer..." loading text appears, even though
there is no answer being generated, since we are waiting for the user to
choose a folder.
This is an especially confusing UX if the user is connected to an SSH host.

## Solution
When the user clicks the "Change folder" button, send a "Choose a folder
to continue" message in the chat.
  • Loading branch information
avi-alpert authored Dec 5, 2024
1 parent 24b1585 commit 83aac85
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"type": "Bug Fix",
"description": "Amazon Q /doc: Prompt user to choose a folder in chat"
}
2 changes: 2 additions & 0 deletions packages/core/package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,8 @@
"AWS.amazonq.doc.answer.generating": "Generating documentation",
"AWS.amazonq.doc.answer.creating": "Okay, I'm creating a README for your project. This may take a few minutes.",
"AWS.amazonq.doc.answer.updating": "Okay, I'm updating the README to reflect your code changes. This may take a few minutes.",
"AWS.amazonq.doc.answer.chooseFolder": "Choose a folder to continue.",
"AWS.amazonq.doc.error.noFolderSelected": "It looks like you didn't choose a folder. Choose a folder to continue.",
"AWS.amazonq.doc.error.contentLengthError": "Your workspace is too large for me to review. Your workspace must be within the quota, even if you choose a smaller folder. For more information on quotas, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html#quotas\" target=\"_blank\">Amazon Q Developer documentation.</a>",
"AWS.amazonq.doc.error.readmeTooLarge": "The README in your folder is too large for me to review. Try reducing the size of your README, or choose a folder with a smaller README. For more information on quotas, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html#quotas\" target=\"_blank\">Amazon Q Developer documentation.</a>",
"AWS.amazonq.doc.error.workspaceEmpty": "The folder you chose did not contain any source files in a supported language. Choose another folder and try again. For more information on supported languages, see the <a href=\"https://docs.aws.amazon.com/amazonq/latest/qdeveloper-ug/doc-generation.html\" target=\"_blank\">Amazon Q Developer documentation.</a>",
Expand Down
11 changes: 9 additions & 2 deletions packages/core/src/amazonqDoc/controllers/chat/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,17 @@ export class DocController {
}

/** Prompts user to choose a folder in current workspace for README creation/update.
* After user chooses a folder, displays confimraiton message to user with selected path.
* After user chooses a folder, displays confirmation message to user with selected path.
*
*/
private async folderSelector(data: any) {
this.messenger.sendAnswer({
type: 'answer',
tabID: data.tabID,
message: i18n('AWS.amazonq.doc.answer.chooseFolder'),
disableChatInput: true,
})

const uri = await createSingleFileDialog({
canSelectFolders: true,
canSelectFiles: false,
Expand All @@ -133,7 +140,7 @@ export class DocController {
this.messenger.sendAnswer({
type: 'answer',
tabID: data.tabID,
message: 'No folder was selected, please try again.',
message: i18n('AWS.amazonq.doc.error.noFolderSelected'),
followUps: retryFollowUps,
disableChatInput: true,
})
Expand Down

0 comments on commit 83aac85

Please sign in to comment.