File tree Expand file tree Collapse file tree 2 files changed +13
-9
lines changed
codewhispererChat/controllers/chat/messenger Expand file tree Collapse file tree 2 files changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -207,16 +207,14 @@ export const createMynahUI = (
207207 } ,
208208 }
209209 }
210- if (
211- tab ?. type === 'cwc' &&
212- messageData . codeBlockActions [ 'insert-to-cursor' ] === null &&
213- messageData . codeBlockActions [ 'copy' ] === null
214- ) {
215- return {
210+ if ( tab ?. type === 'cwc' && messageData . codeBlockActions [ 'insert-to-cursor' ] === null ) {
211+ const actions : Record < string , undefined > = {
216212 'insert-to-cursor' : undefined ,
217- // eslint-disable-next-line prettier/prettier
218- copy : undefined ,
219213 }
214+ if ( messageData . codeBlockActions [ 'copy' ] === null ) {
215+ actions . copy = undefined
216+ }
217+ return actions
220218 }
221219 // Show only "Copy" option for codeblocks in Q Test Tab
222220 if ( tab ?. type === 'testgen' ) {
Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ import {
5454 MynahIconsType ,
5555 DetailedList ,
5656 MynahUIDataModel ,
57+ CodeBlockActions ,
5758} from '@aws/mynah-ui'
5859import { Database } from '../../../../shared/db/chatDb/chatDb'
5960import { TabType } from '../../../../amazonq/webview/ui/storages/tabsStorage'
@@ -477,7 +478,11 @@ export class Messenger {
477478 if ( this . isTriggerCancelled ( triggerID ) ) {
478479 return
479480 }
480-
481+ let codeBlockActions : CodeBlockActions | null = { }
482+ if ( session . pairProgrammingModeOn ) {
483+ // eslint-disable-next-line unicorn/no-null
484+ codeBlockActions = { 'insert-to-cursor' : null }
485+ }
481486 this . dispatcher . sendChatMessage (
482487 new ChatMessage (
483488 {
@@ -492,6 +497,7 @@ export class Messenger {
492497 userIntent : triggerPayload . userIntent ,
493498 codeBlockLanguage : codeBlockLanguage ,
494499 contextList : undefined ,
500+ codeBlockActions,
495501 } ,
496502 tabID
497503 )
You can’t perform that action at this time.
0 commit comments