Skip to content

Commit 17e77fc

Browse files
committed
wip
1 parent 431ba30 commit 17e77fc

File tree

17 files changed

+332
-25
lines changed

17 files changed

+332
-25
lines changed

aws-toolkit-vscode.code-workspace

Lines changed: 23 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,24 @@
11
{
2-
"folders": [
3-
{
4-
"path": "."
5-
},
6-
{
7-
"path": "packages/toolkit"
8-
},
9-
{
10-
"path": "packages/core"
11-
},
12-
{
13-
"path": "packages/amazonq"
14-
}
15-
],
16-
"settings": {
17-
"typescript.tsdk": "node_modules/typescript/lib"
18-
}
19-
}
2+
"folders": [
3+
{
4+
"path": ".",
5+
},
6+
{
7+
"path": "packages/toolkit",
8+
},
9+
{
10+
"path": "packages/core",
11+
},
12+
{
13+
"path": "packages/amazonq",
14+
},
15+
],
16+
"settings": {
17+
"typescript.tsdk": "node_modules/typescript/lib",
18+
"workbench.colorCustomizations": {
19+
"activityBar.background": "#0E350E",
20+
"titleBar.activeBackground": "#134A14",
21+
"titleBar.activeForeground": "#F3FCF3",
22+
},
23+
},
24+
}

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/amazonq/package.json

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,11 @@
188188
},
189189
"views": {
190190
"amazonq": [
191+
{
192+
"id": "aws.amazonq.announcements",
193+
"name": "%AWS.announcements.title%",
194+
"when": "!isCloud9 && !aws.isSageMaker && aws.amazonq.showAnnouncements"
195+
},
191196
{
192197
"type": "webview",
193198
"id": "aws.amazonq.AmazonCommonAuth",
@@ -228,6 +233,11 @@
228233
]
229234
},
230235
"viewsWelcome": [
236+
{
237+
"view": "aws.amazonq.announcements",
238+
"contents": "Urgent announcement:\n[Go Goated](stuff)",
239+
"when": "!isCloud9 && !aws.isSageMaker && aws.amazonq.showAnnouncements"
240+
},
231241
{
232242
"view": "aws.amazonq.transformationProposedChangesTree",
233243
"contents": "Project transformation is complete.\n[Download Proposed Changes](command:aws.amazonq.transformationHub.reviewChanges.startReview)",
@@ -370,6 +380,13 @@
370380
"group": "cw_chat"
371381
}
372382
],
383+
"view/item/context": [
384+
{
385+
"command": "aws.amazonq.dismissNotification",
386+
"when": "viewItem == awsAmazonQWhatsNew",
387+
"group": "inline@1"
388+
}
389+
],
373390
"aws.amazonq.submenu.feedback": [
374391
{
375392
"command": "aws.amazonq.submitFeedback",
@@ -397,12 +414,29 @@
397414
]
398415
},
399416
"commands": [
417+
{
418+
"command": "aws.amazonq.dismissNotification",
419+
"title": "Dismiss",
420+
"category": "%AWS.title%",
421+
"enablement": "isCloud9 || !aws.isWebExtHost",
422+
"icon": "$(remove-close)"
423+
},
400424
{
401425
"command": "aws.amazonq.explainCode",
402426
"title": "%AWS.command.amazonq.explainCode%",
403427
"category": "%AWS.amazonq.title%",
404428
"enablement": "aws.codewhisperer.connected"
405429
},
430+
{
431+
"command": "aws.amazonq.sendEmergency",
432+
"title": "DEBUG: Send Emergency Notification",
433+
"category": "%AWS.amazonq.title%"
434+
},
435+
{
436+
"command": "aws.amazonq.sendWhatsNew",
437+
"title": "DEBUG: Send Whats New Notification",
438+
"category": "%AWS.amazonq.title%"
439+
},
406440
{
407441
"command": "aws.amazonq.security.scan",
408442
"title": "%AWS.command.amazonq.security.scan%",

packages/amazonq/src/extension.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { makeEndpointsProvider, registerGenericCommands } from 'aws-core-vscode'
2121
import { CommonAuthWebview } from 'aws-core-vscode/login'
2222
import {
2323
amazonQDiffScheme,
24+
AnnouncementsNode,
2425
DefaultAWSClientBuilder,
2526
DefaultAwsContext,
2627
ExtContext,
@@ -41,6 +42,8 @@ import {
4142
isNetworkError,
4243
messages,
4344
placeholder,
45+
refreshAnnouncements,
46+
refreshAnnouncementsRootNode,
4447
setContext,
4548
setupUninstallHandler,
4649
maybeShowMinVscodeWarning,
@@ -52,6 +55,7 @@ import * as semver from 'semver'
5255
import * as vscode from 'vscode'
5356
import { registerCommands } from './commands'
5457
import { focusAmazonQPanel } from 'aws-core-vscode/codewhispererChat'
58+
import { registerToolView } from 'aws-core-vscode/awsexplorer'
5559

5660
export const amazonQContextPrefix = 'amazonq'
5761

@@ -161,6 +165,15 @@ export async function activateAmazonQCommon(context: vscode.ExtensionContext, is
161165
}, 1000)
162166
}
163167

168+
registerToolView(
169+
{
170+
nodes: [AnnouncementsNode.instance],
171+
view: 'aws.amazonq.announcements',
172+
refreshCommands: [refreshAnnouncements, refreshAnnouncementsRootNode],
173+
},
174+
context
175+
)
176+
164177
await telemetry.auth_userState
165178
.run(async () => {
166179
telemetry.record({ passive: true })

packages/core/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"./shared": "./dist/src/shared/index.js",
1919
"./sharedNode": "./dist/src/shared/indexNode.js",
2020
"./auth": "./dist/src/auth/index.js",
21+
"./awsexplorer": "./dist/src/awsexplorer/index.js",
2122
"./amazonqGumby": "./dist/src/amazonqGumby/index.js",
2223
"./amazonqFeatureDev": "./dist/src/amazonqFeatureDev/index.js",
2324
"./codewhispererChat": "./dist/src/codewhispererChat/index.js",
@@ -27,7 +28,8 @@
2728
"./utils": "./dist/src/shared/utilities/index.js",
2829
"./feedback": "./dist/src/feedback/index.js",
2930
"./telemetry": "./dist/src/shared/telemetry/index.js",
30-
"./dev": "./dist/src/dev/index.js"
31+
"./dev": "./dist/src/dev/index.js",
32+
"./notifications": "./dist/src/notifications/index.js"
3133
},
3234
"contributes": {
3335
"icons": {

packages/core/package.nls.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"AWS.productName.cn": "Amazon Toolkit",
66
"AWS.amazonq.productName": "Amazon Q",
77
"AWS.codecatalyst.submenu.title": "Manage CodeCatalyst",
8+
"AWS.announcements.title": "Notifications",
89
"AWS.configuration.profileDescription": "The name of the credential profile to obtain credentials from.",
910
"AWS.configuration.description.lambda.recentlyUploaded": "Recently selected Lambda upload targets.",
1011
"AWS.configuration.description.ecs.openTerminalCommand": "The command to run when starting a new interactive terminal session.",

packages/core/src/amazonq/explorer/amazonQChildrenNodes.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,14 @@ import * as vscode from 'vscode'
77
import * as nls from 'vscode-nls'
88
import { Commands } from '../../shared/vscode/commands2'
99
import { getIcon } from '../../shared/icons'
10-
import { installAmazonQExtension } from '../../codewhisperer/commands/basicCommands'
1110
import { amazonQHelpUrl } from '../../shared/constants'
1211
import { cwTreeNodeSource } from '../../codewhisperer/commands/types'
1312
import { VSCODE_EXTENSION_ID } from '../../shared/extensions'
14-
import { globals, setContext } from '../../shared'
13+
import globals from '../../shared/extensionGlobals'
14+
import { setContext } from '../../shared/vscode/setContext'
1515
import { ExtStartUpSources, telemetry } from '../../shared/telemetry'
1616
import { ExtensionUse } from '../../auth/utils'
17+
import { installAmazonQExtension } from '../../codewhisperer/commands/basicCommands'
1718

1819
const localize = nls.loadMessageBundle()
1920

packages/core/src/awsexplorer/activation.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,15 @@ export async function activate(args: {
105105
})
106106
)
107107

108+
const announcementsNode: ToolView[] = []
108109
const amazonQViewNode: ToolView[] = []
109110
if (!isCloud9()) {
111+
// announcementsNode.push({
112+
// nodes: [AnnouncementsNode.instance],
113+
// view: 'aws.toolkit.announcements',
114+
// refreshCommands: [refreshAnnouncements, refreshAnnouncementsRootNode],
115+
// })
116+
110117
if (
111118
isExtensionInstalled(VSCODE_EXTENSION_ID.amazonq) ||
112119
globals.globalState.get<boolean>('aws.toolkit.amazonq.dismissed')
@@ -122,6 +129,7 @@ export async function activate(args: {
122129
})
123130
}
124131
const viewNodes: ToolView[] = [
132+
...announcementsNode,
125133
...amazonQViewNode,
126134
...codecatalystViewNode,
127135
{ nodes: [CdkRootNode.instance], view: 'aws.cdk', refreshCommands: [CdkRootNode.instance.refreshCdkExplorer] },

packages/core/src/awsexplorer/activationShared.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import * as vscode from 'vscode'
77
import { createToolView, ToolView } from './toolView'
88
import { telemetry } from '../shared/telemetry/telemetry'
99
import { CdkRootNode } from '../awsService/cdk/explorer/rootNode'
10+
import { isAmazonQ } from '../shared/extensionUtilities'
1011

1112
/**
1213
* Activates vscode Views (eg tree view) that work in any vscode environment (nodejs or browser).
@@ -15,6 +16,9 @@ export async function activateViewsShared(context: vscode.ExtensionContext): Pro
1516

1617
export function registerToolView(viewNode: ToolView, context: vscode.ExtensionContext) {
1718
const toolView = createToolView(viewNode)
19+
if (viewNode.view.includes('announcements')) {
20+
toolView.message = `New feature announcements and emergency notifications for ${isAmazonQ() ? 'Amazon Q' : 'AWS Toolkit'} will appear here.`
21+
}
1822
context.subscriptions.push(toolView)
1923
if (viewNode.view === 'aws.cdk') {
2024
// Legacy CDK behavior. Mostly useful for C9 as they do not have inline buttons.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/*!
2+
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*/
5+
6+
export { registerToolView } from './activationShared'

0 commit comments

Comments
 (0)