Skip to content

Commit e5d157c

Browse files
authored
Inline chat fixes (microsoft#218318)
* fix microsoft#218059 * Change enablement of "Toggle Changes" instead of visibility mitigates/fixes microsoft#218099 * have padding per part (actions, input, list) fixes microsoft#218083 * fixes microsoft#218021 * fix notebook button groups for inline chat * tweak inline chat content widget when text btn are enabled
1 parent 979ad0a commit e5d157c

File tree

8 files changed

+37
-18
lines changed

8 files changed

+37
-18
lines changed

src/vs/workbench/contrib/chat/browser/chatListRenderer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
255255
// | value
256256
// -----------------------------------------------------
257257
const lhsContainer = dom.append(rowContainer, $('.column.left'));
258-
const rhsContainer = dom.append(rowContainer, $('.column'));
258+
const rhsContainer = dom.append(rowContainer, $('.column.right'));
259259

260260
headerParent = lhsContainer;
261261
detailContainerParent = rhsContainer;

src/vs/workbench/contrib/chat/browser/media/chat.css

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,14 @@
348348
}
349349

350350
.interactive-item-container.minimal .column.left {
351-
width: 20px;
352351
padding-top: 2px;
352+
display: inline-block;
353+
flex-grow: 0;
354+
}
355+
356+
.interactive-item-container.minimal .column.right {
357+
display: inline-block;
358+
flex-grow: 1;
353359
}
354360

355361
.interactive-item-container.minimal .user > .username {

src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -525,9 +525,9 @@ export class ToggleDiffForChange extends AbstractInlineChatAction {
525525
},
526526
menu: {
527527
id: MENU_INLINE_CHAT_WIDGET_STATUS,
528-
group: 'more',
529-
when: ContextKeyExpr.and(CTX_INLINE_CHAT_EDIT_MODE.isEqualTo(EditMode.Live), CTX_INLINE_CHAT_CHANGE_HAS_DIFF),
530-
order: 10,
528+
group: 'zzz',
529+
when: ContextKeyExpr.and(CTX_INLINE_CHAT_EDIT_MODE.isEqualTo(EditMode.Live)),
530+
order: 1,
531531
}
532532
});
533533
}

src/vs/workbench/contrib/inlineChat/browser/inlineChatContentWidget.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ export class InlineChatContentWidget implements IContentWidget {
101101
this._domNode.appendChild(this._inputContainer);
102102

103103
this._toolbarContainer.classList.add('toolbar');
104-
if (!configurationService.getValue<boolean>(InlineChatConfigKeys.ExpTextButtons)) {
105-
this._toolbarContainer.style.display = 'none';
106-
this._domNode.style.paddingBottom = '6px';
104+
if (configurationService.getValue<boolean>(InlineChatConfigKeys.ExpTextButtons)) {
105+
this._toolbarContainer.style.display = 'inherit';
106+
this._domNode.style.paddingBottom = '4px';
107107
}
108108
this._domNode.appendChild(this._toolbarContainer);
109109

@@ -188,7 +188,6 @@ export class InlineChatContentWidget implements IContentWidget {
188188
this._focusNext = true;
189189

190190
this._editor.revealRangeNearTopIfOutsideViewport(Range.fromPositions(position), ScrollType.Immediate);
191-
this._widget.inputEditor.setValue('');
192191

193192
const wordInfo = this._editor.getModel()?.getWordAtPosition(position);
194193

@@ -202,6 +201,7 @@ export class InlineChatContentWidget implements IContentWidget {
202201
if (this._visible) {
203202
this._visible = false;
204203
this._editor.removeContentWidget(this);
204+
this._widget.inputEditor.setValue('');
205205
this._widget.saveState();
206206
this._widget.setVisible(false);
207207
}

src/vs/workbench/contrib/inlineChat/browser/inlineChatWidget.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export class InlineChatWidget {
361361
}
362362

363363
protected _getExtraHeight(): number {
364-
return 4 /* padding */ + 2 /*border*/ + 12 /*shadow*/;
364+
return 4 /* padding */ + 2 /*border*/ + 4 /*shadow*/;
365365
}
366366

367367
updateProgress(show: boolean) {

src/vs/workbench/contrib/inlineChat/browser/media/inlineChat.css

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,16 @@
1313

1414
.monaco-workbench .inline-chat {
1515
color: inherit;
16-
padding: 0 8px;
1716
border-radius: 4px;
1817
border: 1px solid var(--vscode-inlineChat-border);
1918
box-shadow: 0 2px 4px 0 var(--vscode-widget-shadow);
20-
margin-top: 8px;
2119
background: var(--vscode-inlineChat-background);
2220
}
2321

22+
.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-input-part {
23+
padding: 4px 6px 0 6px;
24+
}
25+
2426
.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-input-part .interactive-execute-toolbar {
2527
margin-bottom: 1px;
2628
}
@@ -35,8 +37,10 @@
3537
}
3638

3739
.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.interactive-item-compact {
38-
padding: 2px 0;
3940
gap: 6px;
41+
padding-top: 2px;
42+
padding-right: 20px;
43+
padding-left: 6px;
4044
}
4145

4246
.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.interactive-item-compact .header .avatar {
@@ -53,6 +57,10 @@
5357
border: none;
5458
}
5559

60+
.monaco-workbench .inline-chat .chat-widget .interactive-session .interactive-list .interactive-item-container.minimal > .header {
61+
right: 10px;
62+
}
63+
5664
/* progress bit */
5765

5866
.monaco-workbench .inline-chat .progress {
@@ -66,10 +74,11 @@
6674

6775
/* status */
6876

69-
.monaco-workbench .inline-chat .status {
77+
.monaco-workbench .inline-chat > .status {
7078
display: flex;
7179
justify-content: space-between;
7280
align-items: center;
81+
padding: 4px 6px 0 6px
7382
}
7483

7584
.monaco-workbench .inline-chat .status .actions.hidden {
@@ -147,7 +156,6 @@
147156

148157
display: flex;
149158
height: 18px;
150-
padding: 3px 0; /* makes space for action focus borders: https://github.com/microsoft/vscode-copilot/issues/5814 */
151159

152160
.actions-container {
153161
gap: 3px

src/vs/workbench/contrib/inlineChat/browser/media/inlineChatContentWidget.css

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
.monaco-workbench .inline-chat-content-widget {
77
z-index: 50;
8-
padding: 6px 6px 0px 6px;
8+
padding: 6px;
99
border-radius: 4px;
1010
background-color: var(--vscode-inlineChat-background);
1111
box-shadow: 0 4px 8px var(--vscode-inlineChat-shadow);
@@ -23,3 +23,8 @@
2323
.monaco-workbench .inline-chat-content-widget.interactive-session .interactive-input-part.compact {
2424
padding: 0;
2525
}
26+
27+
.monaco-workbench .inline-chat-content-widget.interactive-session .toolbar {
28+
display: none;
29+
padding-top: 4px;
30+
}

src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ registerAction2(class extends NotebookAction {
258258
menu: [
259259
{
260260
id: MENU_CELL_CHAT_WIDGET_STATUS,
261-
group: 'inline',
261+
group: '0_main',
262262
order: 0,
263263
when: CTX_INLINE_CHAT_RESPONSE_TYPE.notEqualsTo(InlineChatResponseType.Messages),
264264
}
@@ -286,7 +286,7 @@ registerAction2(class extends NotebookAction {
286286
},
287287
menu: {
288288
id: MENU_CELL_CHAT_WIDGET_STATUS,
289-
group: 'main',
289+
group: '0_main',
290290
order: 1
291291
},
292292
f1: false

0 commit comments

Comments
 (0)