@@ -64,11 +64,6 @@ export interface IInlineChatWidgetConstructionOptions {
64
64
*/
65
65
statusMenuId : MenuId | { menu : MenuId ; options : IWorkbenchButtonBarOptions } ;
66
66
67
- /**
68
- * The men that rendered in the lower right corner, use for feedback
69
- */
70
- feedbackMenuId ?: MenuId ;
71
-
72
67
/**
73
68
* The options for the chat widget
74
69
*/
@@ -97,9 +92,9 @@ export class InlineChatWidget {
97
92
h ( 'div.accessibleViewer@accessibleViewer' ) ,
98
93
h ( 'div.status@status' , [
99
94
h ( 'div.label.info.hidden@infoLabel' ) ,
100
- h ( 'div.actions.hidden@statusToolbar' ) ,
95
+ h ( 'div.actions.text-style.hidden@toolbar1' ) ,
96
+ h ( 'div.actions.button-style.hidden@toolbar2' ) ,
101
97
h ( 'div.label.status.hidden@statusLabel' ) ,
102
- h ( 'div.actions.hidden@feedbackToolbar' ) ,
103
98
] ) ,
104
99
]
105
100
) ;
@@ -200,46 +195,34 @@ export class InlineChatWidget {
200
195
201
196
const statusMenuId = options . statusMenuId instanceof MenuId ? options . statusMenuId : options . statusMenuId . menu ;
202
197
203
- if ( this . _configurationService . getValue ( InlineChatConfigKeys . ExpTextButtons ) ) {
204
- // TEXT-ONLY bar
205
- const statusToolbarMenu = scopedInstaService . createInstance ( MenuWorkbenchToolBar , this . _elements . statusToolbar , statusMenuId , {
206
- hiddenItemStrategy : HiddenItemStrategy . NoHide ,
207
- telemetrySource : options . chatWidgetViewOptions ?. menus ?. telemetrySource ,
208
- actionViewItemProvider : action => action instanceof MenuItemAction ? this . _instantiationService . createInstance ( TextOnlyMenuEntryActionViewItem , action , { conversational : true } ) : undefined ,
209
- toolbarOptions : { primaryGroup : '0_main' } ,
210
- menuOptions : { renderShortTitle : true } ,
211
- label : true ,
212
- icon : false
213
- } ) ;
214
- this . _store . add ( statusToolbarMenu . onDidChangeMenuItems ( ( ) => this . _onDidChangeHeight . fire ( ) ) ) ;
215
- this . _store . add ( statusToolbarMenu ) ;
216
-
217
- } else {
218
- // BUTTON bar
219
- const statusMenuOptions = options . statusMenuId instanceof MenuId ? undefined : options . statusMenuId . options ;
220
- const statusButtonBar = scopedInstaService . createInstance ( MenuWorkbenchButtonBar , this . _elements . statusToolbar , statusMenuId , {
221
- toolbarOptions : { primaryGroup : '0_main' } ,
222
- telemetrySource : options . chatWidgetViewOptions ?. menus ?. telemetrySource ,
223
- menuOptions : { renderShortTitle : true } ,
224
- ...statusMenuOptions ,
225
- } ) ;
226
- this . _store . add ( statusButtonBar . onDidChange ( ( ) => this . _onDidChangeHeight . fire ( ) ) ) ;
227
- this . _store . add ( statusButtonBar ) ;
228
- }
229
-
230
- const workbenchToolbarOptions = {
198
+ // TEXT-ONLY bar
199
+ const statusToolbarMenu = scopedInstaService . createInstance ( MenuWorkbenchToolBar , this . _elements . toolbar1 , statusMenuId , {
231
200
hiddenItemStrategy : HiddenItemStrategy . NoHide ,
232
- toolbarOptions : {
233
- primaryGroup : ( ) => true ,
234
- useSeparatorsInPrimaryActions : true
235
- }
236
- } ;
201
+ telemetrySource : options . chatWidgetViewOptions ?. menus ?. telemetrySource ,
202
+ actionViewItemProvider : action => action instanceof MenuItemAction ? this . _instantiationService . createInstance ( TextOnlyMenuEntryActionViewItem , action , { conversational : true } ) : undefined ,
203
+ toolbarOptions : { primaryGroup : '0_main' } ,
204
+ menuOptions : { renderShortTitle : true } ,
205
+ label : true ,
206
+ icon : false
207
+ } ) ;
208
+ this . _store . add ( statusToolbarMenu . onDidChangeMenuItems ( ( ) => this . _onDidChangeHeight . fire ( ) ) ) ;
209
+ this . _store . add ( statusToolbarMenu ) ;
210
+
211
+ // BUTTON bar
212
+ const statusMenuOptions = options . statusMenuId instanceof MenuId ? undefined : options . statusMenuId . options ;
213
+ const statusButtonBar = scopedInstaService . createInstance ( MenuWorkbenchButtonBar , this . _elements . toolbar2 , statusMenuId , {
214
+ toolbarOptions : { primaryGroup : '0_main' } ,
215
+ telemetrySource : options . chatWidgetViewOptions ?. menus ?. telemetrySource ,
216
+ menuOptions : { renderShortTitle : true } ,
217
+ ...statusMenuOptions ,
218
+ } ) ;
219
+ this . _store . add ( statusButtonBar . onDidChange ( ( ) => this . _onDidChangeHeight . fire ( ) ) ) ;
220
+ this . _store . add ( statusButtonBar ) ;
221
+
222
+ const toggleToolbar = ( ) => this . _elements . status . classList . toggle ( 'text' , this . _configurationService . getValue ( InlineChatConfigKeys . ExpTextButtons ) ) ;
223
+ this . _store . add ( this . _configurationService . onDidChangeConfiguration ( e => e . affectsConfiguration ( InlineChatConfigKeys . ExpTextButtons ) && toggleToolbar ( ) ) ) ;
224
+ toggleToolbar ( ) ;
237
225
238
- if ( options . feedbackMenuId ) {
239
- const feedbackToolbar = this . _instantiationService . createInstance ( MenuWorkbenchToolBar , this . _elements . feedbackToolbar , options . feedbackMenuId , { ...workbenchToolbarOptions , hiddenItemStrategy : HiddenItemStrategy . Ignore } ) ;
240
- this . _store . add ( feedbackToolbar . onDidChangeMenuItems ( ( ) => this . _onDidChangeHeight . fire ( ) ) ) ;
241
- this . _store . add ( feedbackToolbar ) ;
242
- }
243
226
244
227
this . _store . add ( this . _configurationService . onDidChangeConfiguration ( e => {
245
228
if ( e . affectsConfiguration ( AccessibilityVerbositySettingId . InlineChat ) ) {
@@ -402,8 +385,8 @@ export class InlineChatWidget {
402
385
403
386
updateToolbar ( show : boolean ) {
404
387
this . _elements . root . classList . toggle ( 'toolbar' , show ) ;
405
- this . _elements . statusToolbar . classList . toggle ( 'hidden' , ! show ) ;
406
- this . _elements . feedbackToolbar . classList . toggle ( 'hidden' , ! show ) ;
388
+ this . _elements . toolbar1 . classList . toggle ( 'hidden' , ! show ) ;
389
+ this . _elements . toolbar2 . classList . toggle ( 'hidden' , ! show ) ;
407
390
this . _elements . status . classList . toggle ( 'actions' , show ) ;
408
391
this . _elements . infoLabel . classList . toggle ( 'hidden' , show ) ;
409
392
this . _onDidChangeHeight . fire ( ) ;
@@ -533,8 +516,8 @@ export class InlineChatWidget {
533
516
534
517
reset ( this . _elements . statusLabel ) ;
535
518
this . _elements . statusLabel . classList . toggle ( 'hidden' , true ) ;
536
- this . _elements . statusToolbar . classList . add ( 'hidden' ) ;
537
- this . _elements . feedbackToolbar . classList . add ( 'hidden' ) ;
519
+ this . _elements . toolbar1 . classList . add ( 'hidden' ) ;
520
+ this . _elements . toolbar2 . classList . add ( 'hidden' ) ;
538
521
this . updateInfo ( '' ) ;
539
522
540
523
this . chatWidget . setModel ( this . _defaultChatModel , { } ) ;
0 commit comments