Skip to content

Commit

Permalink
Merge pull request #196333 from microsoft/ddossett/zestful-roadrunner
Browse files Browse the repository at this point in the history
Update chat avatar styles
  • Loading branch information
daviddossett authored Oct 24, 2023
2 parents 8aab366 + eb6ffc2 commit 9e597d3
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 8 deletions.
6 changes: 3 additions & 3 deletions build/lib/stylelint/vscode-known-variables.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
"--vscode-charts-purple",
"--vscode-charts-red",
"--vscode-charts-yellow",
"--vscode-chat-avatarBackground",
"--vscode-chat-avatarForeground",
"--vscode-chat-requestBorder",
"--vscode-chat-slashCommandBackground",
"--vscode-chat-slashCommandForeground",
Expand Down Expand Up @@ -696,8 +698,6 @@
"--vscode-tree-indentGuidesStroke",
"--vscode-tree-tableColumnsBorder",
"--vscode-tree-tableOddRowsBackground",
"--vscode-voiceRecording-background",
"--vscode-voiceRecording-dimmedBackground",
"--vscode-walkThrough-embeddedEditorBackground",
"--vscode-walkthrough-stepTitle-foreground",
"--vscode-welcomePage-background",
Expand Down Expand Up @@ -784,4 +784,4 @@
"--z-index-notebook-sticky-scroll",
"--zoom-factor"
]
}
}
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/chat/browser/chatListRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ export class ChatListItemRenderer extends Disposable implements ITreeRenderer<Ch
avatarImgIcon.src = FileAccess.uriToBrowserUri(element.avatarIconUri).toString(true);
templateData.avatarContainer.replaceChildren(dom.$('.avatar', undefined, avatarImgIcon));
} else {
const defaultIcon = isRequestVM(element) ? Codicon.account : Codicon.hubot;
const defaultIcon = isRequestVM(element) ? Codicon.account : Codicon.copilot;
const avatarIcon = dom.$(ThemeIcon.asCSSSelector(defaultIcon));
templateData.avatarContainer.replaceChildren(dom.$('.avatar.codicon-avatar', undefined, avatarIcon));
}
Expand Down
6 changes: 4 additions & 2 deletions src/vs/workbench/contrib/chat/browser/media/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,11 @@
width: 24px;
height: 24px;
border-radius: 50%;
outline: 1px solid var(--vscode-chat-requestBorder)
}

.interactive-item-container .header .avatar.codicon-avatar {
background: var(--vscode-badge-background);
background: var(--vscode-chat-avatarBackground);
}

.interactive-item-container .header .avatar+.avatar {
Expand All @@ -108,7 +109,8 @@
}

.interactive-item-container .header .avatar .codicon {
color: var(--vscode-badge-foreground) !important;
color: var(--vscode-chat-avatarForeground);
font-size: 14px;
}

.monaco-list-row:not(.focused) .interactive-item-container:not(:hover) .header .monaco-toolbar,
Expand Down
16 changes: 14 additions & 2 deletions src/vs/workbench/contrib/chat/common/chatColors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

import { Color, RGBA } from 'vs/base/common/color';
import { localize } from 'vs/nls';
import { badgeBackground, badgeForeground, registerColor } from 'vs/platform/theme/common/colorRegistry';
import { badgeBackground, badgeForeground, contrastBorder, foreground, registerColor } from 'vs/platform/theme/common/colorRegistry';

export const chatRequestBorder = registerColor(
'chat.requestBorder',
{ dark: new Color(new RGBA(255, 255, 255, 0.10)), light: new Color(new RGBA(0, 0, 0, 0.10)), hcDark: null, hcLight: null, },
{ dark: new Color(new RGBA(255, 255, 255, 0.10)), light: new Color(new RGBA(0, 0, 0, 0.10)), hcDark: contrastBorder, hcLight: contrastBorder, },
localize('chat.requestBorder', 'The border color of a chat request.')
);

Expand All @@ -24,3 +24,15 @@ export const chatSlashCommandForeground = registerColor(
{ dark: badgeForeground, light: badgeForeground, hcDark: Color.black, hcLight: badgeForeground },
localize('chat.slashCommandForeground', 'The foreground color of a chat slash command.')
);

export const chatAvatarBackground = registerColor(
'chat.avatarBackground',
{ dark: '#1f1f1f', light: '#f2f2f2', hcDark: Color.black, hcLight: Color.white, },
localize('chat.avatarBackground', 'The background color of a chat avatar.')
);

export const chatAvatarForeground = registerColor(
'chat.avatarForeground',
{ dark: foreground, light: foreground, hcDark: foreground, hcLight: foreground, },
localize('chat.avatarForeground', 'The foreground color of a chat avatar.')
);

0 comments on commit 9e597d3

Please sign in to comment.