diff --git a/packages/amazonq/.changes/next-release/Feature-4eed9d3c-8ada-44de-9621-fb34fbbc9e15.json b/packages/amazonq/.changes/next-release/Feature-4eed9d3c-8ada-44de-9621-fb34fbbc9e15.json new file mode 100644 index 00000000000..9ba30d72858 --- /dev/null +++ b/packages/amazonq/.changes/next-release/Feature-4eed9d3c-8ada-44de-9621-fb34fbbc9e15.json @@ -0,0 +1,4 @@ +{ + "type": "Feature", + "description": "Allow users to View and Apply diff when they explictily send code to Amazon Q using - Fix, Refactor, Optimize and Send To Prompt." +} diff --git a/packages/core/src/amazonq/webview/ui/main.ts b/packages/core/src/amazonq/webview/ui/main.ts index c8dd8370044..db9035b2517 100644 --- a/packages/core/src/amazonq/webview/ui/main.ts +++ b/packages/core/src/amazonq/webview/ui/main.ts @@ -90,10 +90,10 @@ export const createMynahUI = ( // eslint-disable-next-line prefer-const let messageController: MessageController + // @ts-ignore let featureConfigs: Map = tryNewMap(featureConfigsSerialized) function shouldDisplayDiff(messageData: any) { - const isEnabled = featureConfigs.get('ViewDiffInChat')?.variation === 'TREATMENT' const tab = tabsStorage.getTab(messageData?.tabID || '') const allowedCommands = [ 'aws.amazonq.refactorCode', @@ -101,7 +101,7 @@ export const createMynahUI = ( 'aws.amazonq.optimizeCode', 'aws.amazonq.sendToPrompt', ] - if (isEnabled && tab?.type === 'cwc' && allowedCommands.includes(tab.lastCommand || '')) { + if (tab?.type === 'cwc' && allowedCommands.includes(tab.lastCommand || '')) { return true } return false diff --git a/packages/core/src/codewhispererChat/controllers/chat/telemetryHelper.ts b/packages/core/src/codewhispererChat/controllers/chat/telemetryHelper.ts index 1f01f17bb33..c6e12d601c2 100644 --- a/packages/core/src/codewhispererChat/controllers/chat/telemetryHelper.ts +++ b/packages/core/src/codewhispererChat/controllers/chat/telemetryHelper.ts @@ -358,6 +358,10 @@ export class CWCTelemetryHelper { return 'UPVOTE' case 'downvote': return 'DOWNVOTE' + case 'acceptDiff': + return 'ACCEPT_DIFF' + case 'viewDiff': + return 'VIEW_DIFF' default: return 'UNKNOWN' }