Skip to content

Commit fa3a9be

Browse files
committed
fix: removing the migration of /agents ux
1 parent a942068 commit fa3a9be

File tree

10 files changed

+3
-115
lines changed

10 files changed

+3
-115
lines changed

packages/amazonq/src/app/amazonqScan/app.ts

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,14 @@
44
*/
55

66
import * as vscode from 'vscode'
7-
import {
8-
AmazonQAppInitContext,
9-
MessagePublisher,
10-
MessageListener,
11-
focusAmazonQPanel,
12-
DefaultAmazonQAppInitContext,
13-
} from 'aws-core-vscode/amazonq'
7+
import { AmazonQAppInitContext, MessageListener } from 'aws-core-vscode/amazonq'
148
import { AuthUtil, codeScanState, onDemandFileScanState } from 'aws-core-vscode/codewhisperer'
159
import { ScanChatControllerEventEmitters, ChatSessionManager } from 'aws-core-vscode/amazonqScan'
1610
import { ScanController } from './chat/controller/controller'
1711
import { AppToWebViewMessageDispatcher } from './chat/views/connector/connector'
1812
import { Messenger } from './chat/controller/messenger/messenger'
1913
import { UIMessageListener } from './chat/views/actions/uiMessageListener'
2014
import { debounce } from 'lodash'
21-
import { Commands, placeholder } from 'aws-core-vscode/shared'
22-
import { codeReviewInChat } from './models/constants'
2315

2416
export function init(appContext: AmazonQAppInitContext) {
2517
const scanChatControllerEventEmitters: ScanChatControllerEventEmitters = {
@@ -50,8 +42,6 @@ export function init(appContext: AmazonQAppInitContext) {
5042
webViewMessageListener: new MessageListener<any>(scanChatUIInputEventEmitter),
5143
})
5244

53-
appContext.registerWebViewToAppMessagePublisher(new MessagePublisher<any>(scanChatUIInputEventEmitter), 'review')
54-
5545
const debouncedEvent = debounce(async () => {
5646
const authenticated = (await AuthUtil.instance.getChatAuthState()).amazonQ === 'connected'
5747
let authenticatingSessionID = ''
@@ -75,20 +65,6 @@ export function init(appContext: AmazonQAppInitContext) {
7565
return debouncedEvent()
7666
})
7767

78-
if (!codeReviewInChat) {
79-
Commands.register('aws.amazonq.security.scan-statusbar', async () => {
80-
if (AuthUtil.instance.isConnectionExpired()) {
81-
await AuthUtil.instance.notifyReauthenticate()
82-
}
83-
return focusAmazonQPanel.execute(placeholder, 'amazonq.security.scan').then(() => {
84-
DefaultAmazonQAppInitContext.instance.getAppsToWebViewMessagePublisher().publish({
85-
sender: 'amazonqCore',
86-
command: 'review',
87-
})
88-
})
89-
})
90-
}
91-
9268
codeScanState.setChatControllers(scanChatControllerEventEmitters)
9369
onDemandFileScanState.setChatControllers(scanChatControllerEventEmitters)
9470
}

packages/amazonq/src/app/chat/activation.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ export async function activate(context: ExtensionContext) {
1717
context.subscriptions.push(
1818
amazonq.focusAmazonQChatWalkthrough.register(),
1919
amazonq.walkthroughInlineSuggestionsExample.register(),
20-
amazonq.walkthroughSecurityScanExample.register(),
2120
amazonq.openAmazonQWalkthrough.register(),
2221
amazonq.listCodeWhispererCommandsWalkthrough.register(),
2322
amazonq.focusAmazonQPanel.register(),

packages/amazonq/src/lsp/chat/commands.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import { CodeScanIssue, AuthUtil } from 'aws-core-vscode/codewhisperer'
1010
import { getLogger } from 'aws-core-vscode/shared'
1111
import * as vscode from 'vscode'
1212
import * as path from 'path'
13-
import { codeReviewInChat } from '../../app/amazonqScan/models/constants'
1413
import { telemetry, AmazonqCodeReviewTool } from 'aws-core-vscode/telemetry'
1514

1615
/**
@@ -68,11 +67,6 @@ export function registerCommands(provider: AmazonQChatViewProvider) {
6867
registerShellCommandShortCut('aws.amazonq.rejectCmdExecution', 'reject-shell-command', provider),
6968
registerShellCommandShortCut('aws.amazonq.stopCmdExecution', 'stop-shell-command', provider)
7069
)
71-
if (codeReviewInChat) {
72-
globals.context.subscriptions.push(
73-
registerGenericCommand('aws.amazonq.security.scan-statusbar', 'Review', provider)
74-
)
75-
}
7670
}
7771

7872
async function handleIssueCommand(

packages/core/package.nls.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,6 @@
145145
"AWS.command.amazonq.optimizeCode": "Optimize",
146146
"AWS.command.amazonq.sendToPrompt": "Send to prompt",
147147
"AWS.command.amazonq.generateUnitTests": "Generate Tests",
148-
"AWS.command.amazonq.security.scan": "Run Project Review",
149-
"AWS.command.amazonq.security.fileScan": "Run File Review",
150148
"AWS.command.amazonq.generateFix": "Fix",
151149
"AWS.command.amazonq.viewDetails": "View Details",
152150
"AWS.command.amazonq.explainIssue": "Explain",

packages/core/src/amazonq/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export {
1313
focusAmazonQChatWalkthrough,
1414
openAmazonQWalkthrough,
1515
walkthroughInlineSuggestionsExample,
16-
walkthroughSecurityScanExample,
1716
} from './onboardingPage/walkthrough'
1817
export { api } from './extApi'
1918
export { AmazonQChatViewProvider } from './webview/webView'

packages/core/src/amazonq/onboardingPage/walkthrough.ts

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import { focusAmazonQPanel } from '../../codewhispererChat/commands/registerComm
77
import globals, { isWeb } from '../../shared/extensionGlobals'
88
import { VSCODE_EXTENSION_ID } from '../../shared/extensions'
99
import { getLogger } from '../../shared/logger/logger'
10-
import { localize } from '../../shared/utilities/vsCodeUtils'
1110
import { Commands, placeholder } from '../../shared/vscode/commands2'
1211
import vscode from 'vscode'
1312

@@ -66,11 +65,3 @@ fake_users = [
6665
})
6766
}
6867
)
69-
70-
export const walkthroughSecurityScanExample = Commands.declare(
71-
`_aws.amazonq.walkthrough.securityScanExample`,
72-
() => async () => {
73-
const filterText = localize('AWS.command.amazonq.security.scan', 'Run Project Review')
74-
void vscode.commands.executeCommand('workbench.action.quickOpen', `> ${filterText}`)
75-
}
76-
)

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

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -15,58 +15,17 @@ export interface QuickActionGeneratorProps {
1515

1616
export class QuickActionGenerator {
1717
private isGumbyEnabled: boolean
18-
private isScanEnabled: boolean
1918
private disabledCommands: string[]
2019

2120
constructor(props: QuickActionGeneratorProps) {
2221
this.isGumbyEnabled = props.isGumbyEnabled
23-
this.isScanEnabled = props.isScanEnabled
2422
this.disabledCommands = props.disableCommands ?? []
2523
}
2624

2725
public generateForTab(tabType: TabType): QuickActionCommandGroup[] {
28-
// TODO: Update acc to UX
2926
const quickActionCommands = [
3027
{
3128
commands: [
32-
...(!this.disabledCommands.includes('/dev')
33-
? [
34-
{
35-
command: '/dev',
36-
icon: MynahIcons.CODE_BLOCK,
37-
placeholder: 'Describe your task or issue in as much detail as possible',
38-
description: 'Generate code to make a change in your project',
39-
},
40-
]
41-
: []),
42-
...(!this.disabledCommands.includes('/test')
43-
? [
44-
{
45-
command: '/test',
46-
icon: MynahIcons.CHECK_LIST,
47-
placeholder: 'Specify a function(s) in the current file (optional)',
48-
description: 'Generate unit tests for selected code',
49-
},
50-
]
51-
: []),
52-
...(this.isScanEnabled && !this.disabledCommands.includes('/review')
53-
? [
54-
{
55-
command: '/review',
56-
icon: MynahIcons.BUG,
57-
description: 'Identify and fix code issues before committing',
58-
},
59-
]
60-
: []),
61-
...(!this.disabledCommands.includes('/doc')
62-
? [
63-
{
64-
command: '/doc',
65-
icon: MynahIcons.FILE,
66-
description: 'Generate documentation',
67-
},
68-
]
69-
: []),
7029
...(this.isGumbyEnabled && !this.disabledCommands.includes('/transform')
7130
? [
7231
{

packages/core/src/codewhisperer/ui/codeWhispererNodes.ts

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
selectRegionProfileCommand,
2222
} from '../commands/basicCommands'
2323
import { CodeWhispererCommandDeclarations } from '../commands/gettingStartedPageCommands'
24-
import { CodeScansState, codeScanState, RegionProfile } from '../models/model'
24+
import { CodeScansState, RegionProfile } from '../models/model'
2525
import { getNewCustomizationsAvailable, getSelectedCustomization } from '../util/customizationUtil'
2626
import { cwQuickPickSource } from '../commands/types'
2727
import { AuthUtil } from '../util/authUtil'
@@ -70,25 +70,6 @@ export function createOpenReferenceLog(): DataQuickPickItem<'openReferenceLog'>
7070
} as DataQuickPickItem<'openReferenceLog'>
7171
}
7272

73-
export function createSecurityScan(): DataQuickPickItem<'securityScan'> {
74-
const label = `Full project scan is now /review!`
75-
const icon = codeScanState.getIconForButton()
76-
const description = 'Open in Chat Panel'
77-
78-
return {
79-
data: 'securityScan',
80-
label: codicon`${icon} ${label}`,
81-
description: description,
82-
onClick: () =>
83-
vscode.commands.executeCommand(
84-
'aws.amazonq.security.scan-statusbar',
85-
placeholder,
86-
'cwQuickPickSource',
87-
true
88-
),
89-
} as DataQuickPickItem<'securityScan'>
90-
}
91-
9273
export function createReconnect(): DataQuickPickItem<'reconnect'> {
9374
const label = localize('aws.amazonq.reconnectNode.label', 'Re-authenticate to connect')
9475
const icon = addColor(getIcon('vscode-debug-disconnect'), 'notificationsErrorIcon.foreground')

packages/core/src/codewhisperer/ui/statusBarMenu.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import {
2121
createAutoScans,
2222
createSignIn,
2323
switchToAmazonQNode,
24-
createSecurityScan,
2524
createSelectRegionProfileNode,
2625
} from './codeWhispererNodes'
2726
import { hasVendedIamCredentials, hasVendedCredentialsFromMetadata } from '../../auth/auth'
@@ -52,12 +51,7 @@ function getAmazonQCodeWhispererNodes() {
5251
if (hasVendedIamCredentials()) {
5352
return [createFreeTierLimitMet(), createOpenReferenceLog()]
5453
}
55-
return [
56-
createFreeTierLimitMet(),
57-
createOpenReferenceLog(),
58-
createSeparator('Other Features'),
59-
createSecurityScan(),
60-
]
54+
return [createFreeTierLimitMet(), createOpenReferenceLog(), createSeparator('Other Features')]
6155
}
6256

6357
if (hasVendedIamCredentials()) {
@@ -74,7 +68,6 @@ function getAmazonQCodeWhispererNodes() {
7468
// Security scans
7569
createSeparator('Code Reviews'),
7670
...(AuthUtil.instance.isBuilderIdInUse() ? [] : [createAutoScans(autoScansEnabled)]),
77-
createSecurityScan(),
7871

7972
// Amazon Q + others
8073
createSeparator('Other Features'),

packages/core/src/test/codewhisperer/commands/basicCommands.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import {
4343
createManageSubscription,
4444
createOpenReferenceLog,
4545
createReconnect,
46-
createSecurityScan,
4746
createSelectCustomization,
4847
createSeparator,
4948
createSettingsNode,
@@ -506,7 +505,6 @@ describe('CodeWhisperer-basicCommands', function () {
506505
createOpenReferenceLog(),
507506
createGettingStarted(),
508507
createSeparator('Code Reviews'),
509-
createSecurityScan(),
510508
createSeparator('Other Features'),
511509
switchToAmazonQNode(),
512510
createSeparator('Connect / Help'),

0 commit comments

Comments
 (0)