Skip to content

Commit 83f8803

Browse files
Samiya CaurDevtools-frontend LUCI CQ
authored andcommitted
[AI Assistance] Add a border to input-form to separate it better from the messages
Bug: 373832540 Change-Id: Ifeee52a2aca9f94f6ef704a0124562150ac645b1 Fixed: 373832540 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6088295 Auto-Submit: Samiya Caur <[email protected]> Reviewed-by: Ergün Erdoğmuş <[email protected]> Reviewed-by: Peter Müller <[email protected]> Commit-Queue: Samiya Caur <[email protected]>
1 parent 019eeaa commit 83f8803

File tree

3 files changed

+57
-0
lines changed

3 files changed

+57
-0
lines changed

front_end/panels/ai_assistance/components/ChatView.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1159,6 +1159,9 @@ export class ChatView extends HTMLElement {
11591159
// clang-format off
11601160
return html`
11611161
<form class="input-form" @submit=${this.#handleSubmit}>
1162+
<div class="input-form-shadow-container">
1163+
<div class="input-form-shadow"></div>
1164+
</div>
11621165
${this.#props.state !== State.CONSENT_VIEW ? html`
11631166
<div class="input-header">
11641167
<div class="header-link-container">

front_end/panels/ai_assistance/components/chatView.css

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,28 @@
6161
@container (height < 224px) {
6262
position: static;
6363
}
64+
65+
& .input-form-shadow-container {
66+
position: absolute;
67+
top: 0;
68+
left: -2px; /* Needed for aligning with other divider lines */
69+
width: calc(100% + 4px); /* Needed for extending the divider line to the edges */
70+
height: var(--sys-size-4);
71+
72+
& .input-form-shadow {
73+
height: 100%;
74+
box-shadow: 0 -3px 2px -2px var(--app-color-ai-assistance-input-divider);
75+
animation: reveal;
76+
/* stylelint-disable-next-line property-no-unknown */
77+
animation-timeline: --scroll-timeline;
78+
animation-fill-mode: both;
79+
80+
--visibility-if-can-scroll: var(--can-scroll) visible;
81+
--visibility-if-cant-scroll: hidden;
82+
83+
visibility: var(--visibility-if-can-scroll, var(--visibility-if-cant-scroll));
84+
}
85+
}
6486
}
6587

6688
.chat-readonly-container {
@@ -504,6 +526,12 @@ main {
504526
fixes the `.input-form` jumping on scroll issue.
505527
*/
506528
transform: translateZ(1px);
529+
530+
/* stylelint-disable-next-line property-no-unknown */
531+
scroll-timeline: --scroll-timeline y;
532+
animation: detect-scroll;
533+
/* stylelint-disable-next-line property-no-unknown */
534+
animation-timeline: --scroll-timeline;
507535
}
508536

509537
.empty-state-container {
@@ -652,3 +680,19 @@ main {
652680
display: flex;
653681
gap: var(--sys-size-4);
654682
}
683+
684+
@keyframes reveal {
685+
0%,
686+
99% {
687+
opacity: 100%;
688+
}
689+
690+
100% {
691+
opacity: 0%;
692+
}
693+
}
694+
695+
@keyframes detect-scroll {
696+
from,
697+
to { --can-scroll: ; }
698+
}

front_end/ui/legacy/themeColors.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,11 @@
396396
* Colors for element panel sidebar subtitle
397397
*/
398398
--app-color-element-sidebar-subtitle: var(--ref-palette-neutral50);
399+
400+
/**
401+
* Color for input driver for AI assistance chat
402+
*/
403+
--app-color-ai-assistance-input-divider: rgb(0 0 0 / 10%);
399404
}
400405

401406
:root.baseline-default {
@@ -779,4 +784,9 @@
779784
* Colors for element panel sidebar subtitle
780785
*/
781786
--app-color-element-sidebar-subtitle: var(--sys-color-token-subtle);
787+
788+
/**
789+
* Color for input driver for AI assistance chat
790+
*/
791+
--app-color-ai-assistance-input-divider: rgb(255 255 255 / 15%);
782792
}

0 commit comments

Comments
 (0)