Skip to content

Commit

Permalink
improve layout of the prompt attachment (#239514)
Browse files Browse the repository at this point in the history
* [ui]: improve layout of the prompt attachment

* [ui]: remove redundant outline style for monaco button

* [ui]: remove redundant CSS styles
  • Loading branch information
legomushroom authored Feb 3, 2025
1 parent 541aae4 commit 4b9eb5a
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,15 @@ export class InstructionsAttachmentWidget extends Disposable {
this._register(this.hoverService.setupManagedHover(getDefaultHoverDelegate('element'), hintElement, title));

// create the `remove` button
const removeButton = this.renderDisposables.add(new Button(this.domNode, { supportIcons: true, title: localize('remove', "Remove") }));
const removeButton = this.renderDisposables.add(
new Button(
this.domNode,
{
supportIcons: true,
title: localize('remove', "Remove"),
},
),
);
removeButton.icon = Codicon.x;
this.renderDisposables.add(removeButton.onDidClick((e) => {
e.stopPropagation();
Expand Down
19 changes: 19 additions & 0 deletions src/vs/workbench/contrib/chat/browser/media/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -968,6 +968,7 @@ have to be updated for changes to the rules above, or to support more deeply nes
.chat-attached-context .chat-prompt-instructions-attachment .chat-implicit-hint {
opacity: 0.7;
font-size: .9em;
margin-top: -0.5px;
}
.chat-attached-context .chat-prompt-instructions-attachment.warning {
color: var(--vscode-notificationsWarningIcon-foreground);
Expand All @@ -979,6 +980,20 @@ have to be updated for changes to the rules above, or to support more deeply nes
border-style: dashed;
opacity: 0.75;
}
.chat-attached-context .chat-prompt-instructions-attachment .monaco-button {
border-left: 1px solid var(--vscode-chat-requestBorder, var(--vscode-input-background, transparent));
margin-left: 3px;
}
.chat-attached-context .chat-prompt-instructions-attachment.error .monaco-button,
.chat-attached-context .chat-prompt-instructions-attachment.warning .monaco-button {
border-left-color: currentColor;
}
.chat-attached-context .chat-prompt-instructions-attachment:focus .monaco-button {
border-color: var(--vscode-focusBorder);
}
.chat-attached-context .chat-prompt-instructions-attachment .monaco-icon-label-container {
margin-top: -0.1em;
}
/*
* This overly-specific CSS selector is needed to beat priority of some
* styles applied on the the `.chat-attached-context-attachment` element.
Expand All @@ -987,6 +1002,10 @@ have to be updated for changes to the rules above, or to support more deeply nes
.chat-attached-context .chat-prompt-instructions-attachments .chat-prompt-instructions-attachment.warning.implicit {
border: 1px solid currentColor;
}
.chat-attached-context .chat-prompt-instructions-attachments .chat-prompt-instructions-attachment.implicit .monaco-button {
padding-left: 2px;
padding-right: 2px;
}
/*
* If in one of the non-normal states, make sure the `main icon` of
* the component has the same color as the component itself
Expand Down

0 comments on commit 4b9eb5a

Please sign in to comment.