Skip to content

Commit 9db4cf8

Browse files
Copilotjustschen
andauthored
Keep the chat request edit input opaque over Agents Window backgrounds (#334021)
* Initial plan * Keep the chat request edit input opaque over Agents Window backgrounds Co-authored-by: justschen <54879025+justschen@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: justschen <54879025+justschen@users.noreply.github.com>
1 parent de41bad commit 9db4cf8

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

‎src/vs/sessions/contrib/chat/browser/media/chatView.css‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,13 @@
7373
background-image: linear-gradient(var(--vscode-chat-requestBubbleHoverBackground), var(--vscode-chat-requestBubbleHoverBackground));
7474
}
7575

76+
/* The edit input takes the place of the request bubble, so it needs the same opaque base under the translucent bubble tint. */
77+
.agent-sessions-workbench .part.sessionspart.has-chat-background .chat-view .interactive-session .interactive-input-part.editing .chat-input-container,
78+
.agent-sessions-workbench .part.sessionspart.has-chat-background .chat-view .interactive-session .interactive-request.editing .interactive-input-part .chat-input-container {
79+
background-color: var(--session-view-background);
80+
background-image: linear-gradient(var(--vscode-chat-requestBubbleBackground), var(--vscode-chat-requestBubbleBackground));
81+
}
82+
7683
.agent-sessions-workbench .interactive-session {
7784
max-width: none;
7885
}

‎src/vs/sessions/contrib/chat/test/browser/chatView.test.ts‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,47 @@ suite('Sessions - Chat View', () => {
504504
});
505505
});
506506

507+
test('keeps the request edit input opaque over the chat background', () => {
508+
const workbench = dom.$('.monaco-workbench.agent-sessions-workbench');
509+
workbench.style.setProperty('--session-view-background', '#202020');
510+
workbench.style.setProperty('--vscode-chat-requestBubbleBackground', 'rgba(255, 255, 255, 0.3)');
511+
const appendEditInput = (part: HTMLElement) => {
512+
const chatView = dom.append(part, dom.$('.chat-view'));
513+
const session = dom.append(chatView, dom.$('.interactive-session'));
514+
const request = dom.append(session, dom.$('.interactive-item-container.interactive-request.editing'));
515+
const editContainer = dom.append(request, dom.$('.chat-edit-input-container'));
516+
const inlineInputPart = dom.append(editContainer, dom.$('.interactive-input-part'));
517+
const composerInputPart = dom.append(session, dom.$('.interactive-input-part.editing'));
518+
return {
519+
inline: dom.append(inlineInputPart, dom.$('.chat-input-container')),
520+
composer: dom.append(composerInputPart, dom.$('.chat-input-container')),
521+
};
522+
};
523+
const background = appendEditInput(dom.append(workbench, dom.$('.part.sessionspart.has-chat-background')));
524+
const plain = appendEditInput(dom.append(workbench, dom.$('.part.sessionspart')));
525+
dom.getWindow(workbench).document.body.appendChild(workbench);
526+
disposables.add(toDisposable(() => workbench.remove()));
527+
528+
const inlineStyle = dom.getWindow(background.inline).getComputedStyle(background.inline);
529+
const composerStyle = dom.getWindow(background.composer).getComputedStyle(background.composer);
530+
const plainInlineStyle = dom.getWindow(plain.inline).getComputedStyle(plain.inline);
531+
assert.deepStrictEqual({
532+
inlineBackgroundColor: inlineStyle.backgroundColor,
533+
inlineBackgroundImage: inlineStyle.backgroundImage,
534+
composerBackgroundColor: composerStyle.backgroundColor,
535+
composerBackgroundImage: composerStyle.backgroundImage,
536+
plainInlineBackgroundColor: plainInlineStyle.backgroundColor,
537+
plainInlineBackgroundImage: plainInlineStyle.backgroundImage,
538+
}, {
539+
inlineBackgroundColor: 'rgb(32, 32, 32)',
540+
inlineBackgroundImage: 'linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3))',
541+
composerBackgroundColor: 'rgb(32, 32, 32)',
542+
composerBackgroundImage: 'linear-gradient(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.3))',
543+
plainInlineBackgroundColor: 'rgba(255, 255, 255, 0.3)',
544+
plainInlineBackgroundImage: 'none',
545+
});
546+
});
547+
507548
test('applies a borderless translucent side fade to the complete assistant response', () => {
508549
const workbench = dom.$('.monaco-workbench.agent-sessions-workbench');
509550
workbench.style.setProperty('--session-view-background', '#ffffff');

0 commit comments

Comments
 (0)