Skip to content

Commit 4e45d2a

Browse files
committed
fix: scroll freeze
1 parent 34658d2 commit 4e45d2a

File tree

2 files changed

+40
-38
lines changed

2 files changed

+40
-38
lines changed

client/web/angular-customer-app/src/app/chatbot/chatbot.component.html

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,24 @@
1818
<div class="order-bar">
1919
<mat-expansion-panel
2020
class="order-expansion-panel"
21-
[expanded]="chatService.order().length > 0" >
21+
[expanded]="chatService.order().length > 0"
22+
>
2223
<mat-expansion-panel-header class="order-panel-header">
2324
<mat-panel-title class="order-title-in-header">
24-
Your order
25-
@if (chatService.order().length > 0) {
26-
<span>({{ chatService.order().length }} item{{ chatService.order().length === 1 ? '' : 's' }})</span>
25+
Your order @if (chatService.order().length > 0) {
26+
<span
27+
>({{ chatService.order().length }} item{{
28+
chatService.order().length === 1 ? "" : "s"
29+
}})</span
30+
>
2731
}
2832
</mat-panel-title>
2933
</mat-expansion-panel-header>
30-
34+
3135
<div class="order-details-content">
3236
<div class="order-text-actual">
33-
{{ currentOrder() }} </div>
37+
{{ currentOrder() }}
38+
</div>
3439
</div>
3540
</mat-expansion-panel>
3641
</div>
@@ -69,25 +74,23 @@
6974
</div>
7075
} }
7176
</div>
72-
73-
<div class="suggestions-container">
74-
<div class="quick-replies">
75-
@for (response of chatService.suggestedResponses(); track response;
76-
let index = $index) {
77-
<button
78-
mat-stroked-button
79-
class="quick-reply-chip"
80-
(click)="ask(response)"
81-
>
82-
<mat-icon fontSet="material-symbols-outlined"
83-
>prompt_suggestion</mat-icon
84-
>{{ response }}
85-
</button>
86-
}
87-
</div>
77+
</div>
78+
<div class="suggestions-container">
79+
<div class="quick-replies">
80+
@for (response of chatService.suggestedResponses(); track response; let
81+
index = $index) {
82+
<button
83+
mat-stroked-button
84+
class="quick-reply-chip"
85+
(click)="ask(response)"
86+
>
87+
<mat-icon fontSet="material-symbols-outlined"
88+
>prompt_suggestion</mat-icon
89+
>{{ response }}
90+
</button>
91+
}
8892
</div>
8993
</div>
90-
9194
<form class="chat-input-bar" (ngSubmit)="ask()">
9295
@if (chatService.error()) {
9396
<pre class="error-message">{{ chatService.error()?.text }}</pre>

client/web/angular-customer-app/src/app/chatbot/chatbot.component.scss

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
@use "sass:color";
1617

1718
$primary-font-color: #333;
1819
$secondary-font-color: #555;
@@ -56,15 +57,15 @@
5657
flex-direction: column;
5758
align-items: center;
5859
height: 100%;
59-
width: 100%;
60+
width: 100%;
6061
}
6162

6263
.centered-chat-column {
6364
display: flex;
6465
flex-direction: column;
6566
width: 100%;
6667
max-width: 900px;
67-
height: 100%;
68+
height: 100%;
6869
}
6970

7071
.order-bar {
@@ -77,7 +78,7 @@
7778
.order-display-container {
7879
display: flex;
7980
align-items: center;
80-
background-color: darken($background-color-page, 3%);
81+
background-color: color.adjust($background-color-page, $lightness: -5%);
8182
border: 1px solid $border-color-light;
8283
border-radius: 24px;
8384
padding: 6px 16px;
@@ -89,36 +90,34 @@
8990
position: absolute;
9091
top: -10px;
9192
left: 15px;
92-
background-color: darken($background-color-page, 3%);
93+
background-color: color.adjust($background-color-page, $lightness: -5%);
9394
padding: 0 4px;
9495
font-weight: 500;
9596
}
9697

9798
.order-text {
9899
flex-grow: 1;
99100
font-size: 1em;
100-
padding: 8px;
101+
padding: 8px 0;
101102
min-height: 24px;
102103
line-height: 1.5;
103104
}
104105
}
105106
}
106107

107108
.chat-content-area {
108-
flex-grow: 1;
109+
flex: 1 0 0;
109110
display: flex;
110111
flex-direction: column;
111112
padding: 16px 24px 0;
112113
width: 100%;
113114
box-sizing: border-box;
114-
overflow: hidden;
115+
overflow-y: scroll;
115116
}
116117

117118
.messages {
118-
flex-grow: 1;
119119
display: flex;
120120
flex-direction: column-reverse;
121-
overflow-y: auto;
122121
padding-right: 8px;
123122
margin-bottom: 16px;
124123

@@ -228,7 +227,7 @@
228227
color: $secondary-font-color;
229228
margin: 16px 0;
230229
span {
231-
background-color: darken($background-color-page, 5%);
230+
background-color: color.adjust($background-color-page, $lightness: -5%);
232231
padding: 4px 12px;
233232
border-radius: 12px;
234233
}
@@ -291,7 +290,7 @@
291290
font-size: 0.8em;
292291
padding: 3px 8px;
293292
border-radius: 8px;
294-
color: darken($primary-font-color, 10%);
293+
color: color.adjust($primary-font-color, $lightness: -10%);
295294
&.special {
296295
background-color: $tag-special-bg;
297296
}
@@ -328,8 +327,8 @@
328327
}
329328

330329
&:hover {
331-
background-color: darken(white, 3%);
332-
border-color: darken($border-color-light, 5%);
330+
background-color: color.adjust(white, $lightness: -5%);
331+
border-color: color.adjust($border-color-light, $lightness: -5%);
333332
}
334333
}
335334
}
@@ -428,7 +427,7 @@
428427
color: $add-btn-icon-color;
429428
}
430429
&:hover:not(:disabled) {
431-
background-color: darken($add-btn-bg, 5%);
430+
background-color: color.adjust($add-btn-bg, $lightness: -5%);
432431
}
433432
}
434433

@@ -439,7 +438,7 @@
439438
color: $send-btn-icon-color;
440439
}
441440
&:hover:not(:disabled) {
442-
background-color: darken($send-btn-bg, 8%);
441+
background-color: color.adjust($send-btn-bg, $lightness: -10%);
443442
}
444443
}
445444

0 commit comments

Comments
 (0)