Skip to content

Commit 0ec7fcc

Browse files
fix(chat): Add programmer card on top of the page. (aws#7041)
## Problem We want to show the programmer card on top of the page. And change the welcome message ## Solution ![image](https://github.com/user-attachments/assets/b119a626-6519-4700-bc07-299db32de135) --- - Treat all work as PUBLIC. Private `feature/x` branches will not be squash-merged at release time. - Your code changes must meet the guidelines in [CONTRIBUTING.md](https://github.com/aws/aws-toolkit-vscode/blob/master/CONTRIBUTING.md#guidelines). - License: I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 4cc64fc commit 0ec7fcc

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

packages/core/resources/css/amazonq-webview.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,6 @@ div.mynah-card.padding-large {
130130
}
131131

132132
.mynah-chat-wrapper {
133-
padding: 0.75rem 1.25rem !important; /* 12px top/bottom, 20px left/right */
133+
padding: 0.75rem 1.25rem;
134134
box-sizing: border-box;
135135
}

packages/core/src/amazonq/webview/ui/tabs/generator.ts

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ export class TabDataGenerator {
5656
if (tabType === 'welcome') {
5757
return {}
5858
}
59+
const programmerModeCard: ChatItem | undefined = {
60+
type: ChatItemType.ANSWER,
61+
title: 'NEW FEATURE',
62+
header: {
63+
icon: 'code-block',
64+
iconStatus: 'primary',
65+
body: '## Pair programmer mode',
66+
},
67+
fullWidth: true,
68+
canBeDismissed: true,
69+
body: 'Pair code with Amazon Q, your virtual pair programmer that can work alongside you autonomously making real-time code changes on your behalf. \n\n Switch off pair programmer mode to get read-only responses from Q.',
70+
}
5971

6072
const regionProfileCard: ChatItem | undefined =
6173
this.regionProfile === undefined
@@ -67,6 +79,15 @@ export class TabDataGenerator {
6779
messageId: 'regionProfile',
6880
}
6981

82+
const welcomeMessage = `Hi! I'm Amazon Q.
83+
84+
You can ask me to:
85+
• Create new projects and files
86+
• Make changes to your codebase
87+
• Explain how to do things
88+
89+
Enter \`/\` to view quick actions. Use \`@\` to add saved prompts, files, folders, or your entire workspace as context.`
90+
7091
const tabData: MynahUIDataModel = {
7192
tabTitle: taskName ?? TabTypeDataMap[tabType].title,
7293
promptInputInfo:
@@ -76,10 +97,11 @@ export class TabDataGenerator {
7697
contextCommands: this.getContextCommands(tabType),
7798
chatItems: needWelcomeMessages
7899
? [
100+
...(tabType === 'cwc' || tabType === 'unknown' ? [programmerModeCard] : []),
79101
...(regionProfileCard ? [regionProfileCard] : []),
80102
{
81103
type: ChatItemType.ANSWER,
82-
body: isSMUS ? qChatIntroMessageForSMUS : TabTypeDataMap[tabType].welcome,
104+
body: isSMUS ? qChatIntroMessageForSMUS : welcomeMessage,
83105
},
84106
{
85107
type: ChatItemType.ANSWER,
@@ -88,7 +110,7 @@ export class TabDataGenerator {
88110
]
89111
: [...(regionProfileCard ? [regionProfileCard] : [])],
90112
promptInputOptions:
91-
tabType === 'cwc'
113+
tabType === 'cwc' || tabType === 'unknown'
92114
? [
93115
{
94116
type: 'switch',

0 commit comments

Comments
 (0)