Skip to content

Commit 2c6359a

Browse files
Merge main into feature/q-inlinechat
2 parents 887ee39 + d97a09b commit 2c6359a

File tree

3 files changed

+22
-12
lines changed

3 files changed

+22
-12
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"type" : "bugfix",
3+
"description" : "Amazon Q chat: `@workspace` command shown in all tab types"
4+
}

plugins/amazonq/mynah-ui/src/mynah-ui/ui/commands.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
33
* SPDX-License-Identifier: Apache-2.0
44
*/
5+
import { QuickActionCommandGroup } from "@aws/mynah-ui-chat"
56

67
type MessageCommand =
78
| 'chat-prompt'
@@ -47,3 +48,13 @@ type MessageCommand =
4748
| 'store-code-result-message-id'
4849

4950
export type ExtensionMessage = Record<string, any> & { command: MessageCommand }
51+
52+
export const workspaceCommand: QuickActionCommandGroup = {
53+
groupName: 'Mention code',
54+
commands: [
55+
{
56+
command: '@workspace',
57+
description: '(BETA) Reference all code in workspace.',
58+
},
59+
],
60+
}

plugins/amazonq/mynah-ui/src/mynah-ui/ui/tabs/generator.ts

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
* SPDX-License-Identifier: Apache-2.0
44
*/
55

6-
import { ChatItemType, MynahUIDataModel } from '@aws/mynah-ui-chat'
6+
import { ChatItemType, MynahUIDataModel, QuickActionCommandGroup } from '@aws/mynah-ui-chat'
77
import { TabType } from '../storages/tabsStorage'
88
import { FollowUpGenerator } from '../followUps/generator'
99
import { QuickActionGenerator } from '../quickActions/generator'
10+
import { workspaceCommand } from '../commands'
1011

1112
export interface TabDataGeneratorProps {
1213
isFeatureDevEnabled: boolean
@@ -60,6 +61,10 @@ I can help you upgrade your Java 8 and 11 codebases to Java 17.
6061
],
6162
])
6263

64+
private tabContextCommand: Map<TabType, QuickActionCommandGroup[]> = new Map([
65+
['cwc', [workspaceCommand]],
66+
])
67+
6368
constructor(props: TabDataGeneratorProps) {
6469
this.followUpsGenerator = new FollowUpGenerator()
6570
this.quickActionsGenerator = new QuickActionGenerator({
@@ -75,17 +80,7 @@ I can help you upgrade your Java 8 and 11 codebases to Java 17.
7580
'Amazon Q Developer uses generative AI. You may need to verify responses. See the [AWS Responsible AI Policy](https://aws.amazon.com/machine-learning/responsible-ai/policy/).',
7681
quickActionCommands: this.quickActionsGenerator.generateForTab(tabType),
7782
promptInputPlaceholder: this.tabInputPlaceholder.get(tabType),
78-
contextCommands: [
79-
{
80-
groupName: 'Mention code',
81-
commands: [
82-
{
83-
command: '@workspace',
84-
description: '(BETA) Reference all code in workspace.',
85-
},
86-
],
87-
},
88-
],
83+
contextCommands: this.tabContextCommand.get(tabType),
8984
chatItems: needWelcomeMessages
9085
? [
9186
{

0 commit comments

Comments
 (0)