Skip to content

Commit cd40c00

Browse files
authored
fix some implicit context ui (microsoft#256759)
* fix some implicit context ui * remove button title
1 parent ae3ade7 commit cd40c00

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/vs/workbench/contrib/chat/browser/attachments/implicitContextAttachment.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,8 @@ export class ImplicitContextAttachmentWidget extends Disposable {
7575

7676
const uriLabel = this.labelService.getUriLabel(file, { relative: true });
7777
const currentFile = localize('openEditor', "Current {0} context", attachmentTypeName);
78-
const inactive = localize('enableHint', "disabled");
79-
const currentFileHint = currentFile + (this.attachment.enabled || this.attachment.isSelection ? '' : ` (${inactive})`);
78+
const inactive = localize('enableHint', "Enable current {0} context", attachmentTypeName);
79+
const currentFileHint = this.attachment.enabled || this.attachment.isSelection ? currentFile : inactive;
8080
const title = `${currentFileHint}\n${uriLabel}`;
8181

8282
label.setFile(file, {
@@ -94,7 +94,7 @@ export class ImplicitContextAttachmentWidget extends Disposable {
9494

9595
if (isSuggestedEnabled) {
9696
if (!this.attachment.isSelection) {
97-
const buttonMsg = this.attachment.enabled ? localize('disable', "Disable current {0} context", attachmentTypeName) : localize('enable', "Enable current {0} context", attachmentTypeName);
97+
const buttonMsg = this.attachment.enabled ? localize('disable', "Disable current {0} context", attachmentTypeName) : '';
9898
const toggleButton = this.renderDisposables.add(new Button(this.domNode, { supportIcons: true, title: buttonMsg }));
9999
toggleButton.icon = this.attachment.enabled ? Codicon.x : Codicon.plus;
100100
this.renderDisposables.add(toggleButton.onDidClick((e) => {

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1256,6 +1256,7 @@ have to be updated for changes to the rules above, or to support more deeply nes
12561256
}
12571257

12581258
.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-button.codicon.codicon-plus {
1259+
padding: 0 5px 0 3px;
12591260
font-size: 12px;
12601261
}
12611262

@@ -1266,6 +1267,11 @@ have to be updated for changes to the rules above, or to support more deeply nes
12661267
background: var(--vscode-toolbar-hoverBackground);
12671268
}
12681269

1270+
.interactive-session .chat-attached-context .chat-attached-context-attachment.implicit.disabled .monaco-button:hover {
1271+
cursor: pointer;
1272+
background: transparent;
1273+
}
1274+
12691275
.interactive-session .chat-attached-context .chat-attached-context-attachment .monaco-icon-label-container {
12701276
display: flex;
12711277

0 commit comments

Comments
 (0)