Skip to content

Commit

Permalink
Amazon Q:
Browse files Browse the repository at this point in the history
1) Context menu title text changed

2) Max tab number changed to 10

3) Follow-up title text changed

4) Handling cases when we don't have available tabs to place onboarding or context menu action messages

5) Placeholders text changed

6) Feedback reaction text changed
  • Loading branch information
ppiliaev committed Nov 15, 2023
1 parent 98c5f2e commit 7fdeb01
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 17 deletions.
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ src/shared/telemetry/service-2.json
src/testFixtures/**
*.d.ts
*.gen.ts
src/testFixtures/**
dist/**
types/*.d.ts
src.gen/**
src.gen/**
2 changes: 1 addition & 1 deletion package.nls.json
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@
"AWS.developerTools.explorerTitle": "Developer Tools",
"AWS.cwl.limit.desc": "Maximum amount of log entries pulled per request from CloudWatch Logs (max 10000)",
"AWS.samcli.deploy.bucket.recentlyUsed": "Buckets recently used for SAM deployments",
"AWS.submenu.amazonqEditorContextSubmenu.title": "Amazon Q (Preview)",
"AWS.submenu.amazonqEditorContextSubmenu.title": "Send to Amazon Q",
"AWS.submenu.auth.title": "Authentication",
"AWS.generic.create": "Create...",
"AWS.generic.save": "Save",
Expand Down
11 changes: 6 additions & 5 deletions src/amazonq/webview/ui/apps/cwChatConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,9 +203,10 @@ export class Connector {
},
messageData.command
)
if (triggerTabID !== undefined) {
this.sendTriggerTabIDReceived(messageData.triggerID, triggerTabID)
}
this.sendTriggerTabIDReceived(
messageData.triggerID,
triggerTabID !== undefined ? triggerTabID : 'no-available-tabs'
)
}

private sendTriggerTabIDReceived = async (triggerID: string, tabID: string): Promise<void> => {
Expand All @@ -229,7 +230,7 @@ export class Connector {
const followUps =
messageData.followUps !== undefined && messageData.followUps.length > 0
? {
text: 'Would you like to follow up with one of these?',
text: 'Suggested follow up questions:',
options: messageData.followUps,
}
: undefined
Expand Down Expand Up @@ -276,7 +277,7 @@ export class Connector {
followUp:
messageData.followUps !== undefined && messageData.followUps.length > 0
? {
text: 'Would you like to follow up with one of these?',
text: 'Suggested follow up questions:',
options: messageData.followUps,
}
: undefined,
Expand Down
4 changes: 0 additions & 4 deletions src/amazonq/webview/ui/feedback/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,6 @@ export const feedbackOptions = [
value: 'harmful-content',
label: 'Harmful content',
},
{
value: 'overlap',
label: 'Overlaps with existing content',
},
{
value: 'incorrect-syntax',
label: 'Incorrect syntax',
Expand Down
2 changes: 1 addition & 1 deletion src/amazonq/webview/ui/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ ${message}`,
store: tabDataGenerator.getTabData('unknown', true),
},
config: {
maxTabs: 10000,
maxTabs: 10,
feedbackOptions: feedbackOptions,
texts: uiComponentsTexts,
},
Expand Down
2 changes: 1 addition & 1 deletion src/amazonq/webview/ui/messages/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ export class MessageController {
content: uiComponentsTexts.noMoreTabsTooltip,
type: NotificationType.WARNING,
})
return
return undefined
} else {
this.mynahUI.addChatItem(newTabID, {
type: ChatItemType.ANSWER_STREAM,
Expand Down
4 changes: 2 additions & 2 deletions src/amazonq/webview/ui/tabs/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ export class TabDataGenerator {
])

private tabInputPlaceholder: Map<TabType, string> = new Map([
['unknown', 'Ask a question or "/" for capabilities'],
['cwc', 'Ask a question or "/" for capabilities'],
['unknown', 'Ask a question or enter "/" for actions'],
['cwc', 'Ask a question or enter "/" for actions'],
['wb', 'What problem do you want to fix?'],
])

Expand Down
2 changes: 1 addition & 1 deletion src/amazonq/webview/ui/texts/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export const uiComponentsTexts = {
feedbackFormTitle: 'Report an issue',
feedbackFormOptionsLabel: 'What type of issue would you like to report?',
feedbackFormCommentLabel: 'Description of issue (optional):',
feedbackThanks: 'Thanks!',
feedbackThanks: 'Thanks for your feedback!',
feedbackReportButtonLabel: 'Report an issue',
codeSuggestions: 'Code Suggestions',
files: 'file(s)',
Expand Down
5 changes: 5 additions & 0 deletions src/codewhispererChat/controllers/chat/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,11 @@ export class ChatController {
if (triggerEvent === undefined) {
return
}

if (triggerEvent.tabID === 'no-available-tabs') {
return
}

if (triggerEvent.tabID === undefined) {
setTimeout(() => {
this.generateResponse(triggerPayload, triggerID)
Expand Down

0 comments on commit 7fdeb01

Please sign in to comment.