Skip to content

Commit 4c9de9e

Browse files
joyceerhllramos15
andauthored
fix: improve presentation of chat related file suggestions (microsoft#242354)
* fix: improve presentation of chat related file suggestions * Pin extractor version --------- Co-authored-by: Logan Ramos <[email protected]>
1 parent 355e73c commit 4c9de9e

File tree

3 files changed

+11
-12
lines changed

3 files changed

+11
-12
lines changed

.github/workflows/telemetry.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
node-version: 'lts/*'
1515

1616
- name: 'Run vscode-telemetry-extractor'
17-
run: 'npx --package=@vscode/telemetry-extractor --yes vscode-telemetry-extractor -s .'
17+
run: 'npx --package=@vscode/telemetry-extractor@1.14.0 --yes vscode-telemetry-extractor -s .'
1818
env:
1919
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

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

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,7 @@ import { EditorOptions } from '../../../../editor/common/config/editorOptions.js
3333
import { IDimension } from '../../../../editor/common/core/dimension.js';
3434
import { IPosition } from '../../../../editor/common/core/position.js';
3535
import { IRange, Range } from '../../../../editor/common/core/range.js';
36-
import { ILanguageService } from '../../../../editor/common/languages/language.js';
3736
import { ITextModel } from '../../../../editor/common/model.js';
38-
import { getIconClasses } from '../../../../editor/common/services/getIconClasses.js';
3937
import { IModelService } from '../../../../editor/common/services/model.js';
4038
import { ITextModelService } from '../../../../editor/common/services/resolverService.js';
4139
import { CopyPasteController } from '../../../../editor/contrib/dropOrPasteInto/browser/copyPasteController.js';
@@ -337,7 +335,6 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
337335
getContribsInputState: () => any,
338336
@IChatWidgetHistoryService private readonly historyService: IChatWidgetHistoryService,
339337
@IModelService private readonly modelService: IModelService,
340-
@ILanguageService private readonly languageService: ILanguageService,
341338
@IInstantiationService private readonly instantiationService: IInstantiationService,
342339
@IContextKeyService private readonly contextKeyService: IContextKeyService,
343340
@IConfigurationService private readonly configurationService: IConfigurationService,
@@ -729,8 +726,8 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
729726
dom.h('.chat-input-container@inputContainer', [
730727
dom.h('.chat-attachments-container@attachmentsContainer', [
731728
dom.h('.chat-attachment-toolbar@attachmentToolbar'),
732-
dom.h('.chat-attached-context@attachedContextContainer'),
733729
dom.h('.chat-related-files@relatedFilesContainer'),
730+
dom.h('.chat-attached-context@attachedContextContainer'),
734731
]),
735732
dom.h('.chat-editor-container@editorContainer'),
736733
dom.h('.chat-input-toolbars@inputToolbars'),
@@ -1422,7 +1419,7 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
14221419
hoverDelegate
14231420
}));
14241421
uriLabel.label = this.labelService.getUriBasenameLabel(uri);
1425-
uriLabel.element.classList.add('monaco-icon-label', ...getIconClasses(this.modelService, this.languageService, uri, FileKind.FILE));
1422+
uriLabel.element.classList.add('monaco-icon-label');
14261423
uriLabel.element.title = localize('suggeste.title', "{0} - {1}", this.labelService.getUriLabel(uri, { relative: true }), metadata.description ?? '');
14271424

14281425
this._chatEditsActionsDisposables.add(uriLabel.onDidClick(() => {
@@ -1449,10 +1446,10 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
14491446
sep.classList.add('separator');
14501447

14511448
const group = document.createElement('span');
1452-
group.classList.add('monaco-button-dropdown', 'sidebyside-button', 'show-file-icons');
1453-
group.appendChild(uriLabel.element);
1454-
group.appendChild(sep);
1449+
group.classList.add('monaco-button-dropdown', 'sidebyside-button');
14551450
group.appendChild(addButton.element);
1451+
group.appendChild(sep);
1452+
group.appendChild(uriLabel.element);
14561453
dom.append(anchor, group);
14571454

14581455
this._chatEditsActionsDisposables.add(toDisposable(() => {

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ have to be updated for changes to the rules above, or to support more deeply nes
700700
flex-wrap: wrap;
701701
align-items: center;
702702
gap: 4px;
703-
width: 100%;
704703
}
705704

706705
.chat-related-files .monaco-button-dropdown .monaco-text-button {
@@ -725,18 +724,20 @@ have to be updated for changes to the rules above, or to support more deeply nes
725724
border-style: dashed;
726725
align-items: center;
727726
overflow: hidden;
728-
padding: 0 0 0 2px;
729727
gap: 2px;
728+
padding: 0 4px;
730729
}
731730

732731
.chat-related-files .monaco-button.codicon.codicon-add {
733732
display: flex;
734733
flex-direction: column;
735734
color: var(--vscode-descriptionForeground);
736735
padding-top: 3px;
736+
margin-left: -4px;
737+
padding-left: 4px;
737738
font-size: 14px; /* The + codicon is large, make it look more like the x codicon */
738739
height: calc(100% - 3px);
739-
width: 20px;
740+
width: 17px;
740741
outline-offset: -2px !important;
741742
}
742743

@@ -1136,6 +1137,7 @@ have to be updated for changes to the rules above, or to support more deeply nes
11361137
.action-item.chat-attached-context-attachment.chat-add-files .action-label {
11371138
color: var(--vscode-descriptionForeground);
11381139
font-family: unset;
1140+
gap: 5px;
11391141
}
11401142

11411143
.action-item.chat-attached-context-attachment.chat-add-files .action-label.codicon::before {

0 commit comments

Comments
 (0)