Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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."
}
4 changes: 2 additions & 2 deletions packages/core/src/amazonq/webview/ui/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,18 +90,18 @@ export const createMynahUI = (
// eslint-disable-next-line prefer-const
let messageController: MessageController

// @ts-ignore
let featureConfigs: Map<string, FeatureContext> = tryNewMap(featureConfigsSerialized)

function shouldDisplayDiff(messageData: any) {
const isEnabled = featureConfigs.get('ViewDiffInChat')?.variation === 'TREATMENT'
const tab = tabsStorage.getTab(messageData?.tabID || '')
const allowedCommands = [
'aws.amazonq.refactorCode',
'aws.amazonq.fixCode',
'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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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'
}
Expand Down
Loading