Skip to content
Merged
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
71 changes: 24 additions & 47 deletions plugins/amazonq/mynah-ui/src/mynah-ui/ui/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -453,54 +453,31 @@ export const createMynahUI = (ideApi: any, featureDevInitEnabled: boolean, codeT
content: 'Thanks for your feedback.',
})
},
onCodeBlockActionClicked: (
tabId: string,
messageId: string,
actionId: string,
data?: string,
code?: string,
type?: CodeSelectionType,
referenceTrackerInformation?: ReferenceTrackerInformation[],
eventId?: string,
codeBlockIndex?: number,
totalCodeBlocks?: number
onCodeInsertToCursorPosition: connector.onCodeInsertToCursorPosition,
onCopyCodeToClipboard: (
tabId,
messageId,
code,
type,
referenceTrackerInfo,
eventId,
codeBlockIndex,
totalCodeBlocks
) => {
switch (actionId) {
case 'insert-to-cursor':
connector.onCodeInsertToCursorPosition(
tabId,
messageId,
code,
type,
referenceTrackerInformation,
eventId,
codeBlockIndex,
totalCodeBlocks,
responseMetadata.get(messageId)?.[0] ?? undefined,
responseMetadata.get(messageId)?.[1] ?? undefined
)
break
case 'copy':
connector.onCopyCodeToClipboard(
tabId,
messageId,
code,
type,
referenceTrackerInformation,
eventId,
codeBlockIndex,
totalCodeBlocks,
responseMetadata.get(messageId)?.[0] ?? undefined,
responseMetadata.get(messageId)?.[1] ?? undefined
)
mynahUI.notify({
type: NotificationType.SUCCESS,
content: 'Selected code is copied to clipboard',
})
break
default:
break
}
connector.onCopyCodeToClipboard(
tabId,
messageId,
code,
type,
referenceTrackerInfo,
eventId,
codeBlockIndex,
totalCodeBlocks
)
mynahUI.notify({
type: NotificationType.SUCCESS,
content: 'Selected code is copied to clipboard',
})
},
onChatItemEngagement: connector.triggerSuggestionEngagement,
onSourceLinkClick: (tabId, messageId, link, mouseEvent) => {
Expand Down
Loading