Skip to content

Commit a4dedf6

Browse files
authored
Chat FU: rework styles after design review (#31627)
1 parent 74aaa63 commit a4dedf6

29 files changed

Lines changed: 204 additions & 32 deletions

File tree

e2e/testcafe-devextreme/tests/editors/chat/data/index.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,10 @@ export const generateFileMessage = (author: User, longText = false): Message =>
107107
author,
108108
attachments,
109109
});
110+
111+
export const generateFileMessageWithoutText = (author: User): Message => ({
112+
text: '',
113+
timestamp,
114+
author,
115+
attachments,
116+
});
29.2 KB
Loading
370 Bytes
Loading

e2e/testcafe-devextreme/tests/editors/chat/messageBubble.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
generateImageMessage,
66
generateMessages,
77
generateFileMessage,
8+
generateFileMessageWithoutText,
89
} from './data';
910
import url from '../../../helpers/getPageUrl';
1011
import { createWidget } from '../../../helpers/createWidget';
@@ -70,6 +71,13 @@ test('Chat: messagebubble with images and files', async (t) => {
7071
});
7172
await testScreenshot(t, takeScreenshot, 'Bubbles with files.png', { element: '#chat' });
7273

74+
await chat.option({
75+
width: 600,
76+
height: 600,
77+
items: [generateFileMessageWithoutText(user)],
78+
});
79+
await testScreenshot(t, takeScreenshot, 'Bubble with files without text.png', { element: '#chat' });
80+
7381
await t.expect(compareResults.isValid()).ok(compareResults.errorMessages());
7482
}).before(async () => {
7583
await appendElementTo('#container', 'div', 'chat');

packages/devextreme-scss/scss/widgets/base/_fileUploader.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,14 @@
110110
height: 28px;
111111
margin-right: 10px;
112112

113+
&.dx-fileuploader-cancel-button-position-end {
114+
margin-right: 0;
115+
margin-left: 4px;
116+
}
117+
113118
&.dx-state-invisible {
114119
margin-right: 0;
120+
margin-left: 0;
115121
}
116122
}
117123
}
@@ -214,6 +220,11 @@
214220
.dx-fileuploader-file-container .dx-fileuploader-button {
215221
margin-left: 10px;
216222
margin-right: 0;
223+
224+
&.dx-fileuploader-cancel-button-position-end {
225+
margin-left: 0;
226+
margin-right: 4px;
227+
}
217228
}
218229

219230
.dx-fileuploader-file-name,

packages/devextreme-scss/scss/widgets/base/chat/layout/chat-fileview/_mixins.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
$chat-file-secondary-font-size,
99
$chat-file-secondary-color,
1010
$chat-file-base-section-gap,
11-
$chat-file-file-size-max-width
11+
$chat-file-size-max-width,
12+
$chat-file-icon-font-size,
1213
) {
1314
.dx-chat-file {
1415
width: $chat-file-container-width;
@@ -25,6 +26,7 @@
2526

2627
.dx-icon {
2728
color: $chat-file-secondary-color;
29+
font-size: $chat-file-icon-font-size;
2830
}
2931
}
3032

@@ -34,7 +36,7 @@
3436
}
3537

3638
.dx-chat-file-size {
37-
max-width: $chat-file-file-size-max-width;
39+
max-width: $chat-file-size-max-width;
3840
margin-inline-end: $chat-file-base-section-gap;
3941
font-size: $chat-file-secondary-font-size;
4042
color: $chat-file-secondary-color;

packages/devextreme-scss/scss/widgets/base/chat/layout/chat-messagebox/_mixins.scss

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
$textarea-padding,
77
$toolbar-min-height,
88
$chat-file-container-width,
9-
$messagebox-file-container-padding,
10-
$messagebox-file-container-padding-top,
9+
$messagebox-files-container-padding,
10+
$messagebox-files-container-padding-top,
11+
$messagebox-file-background-color,
1112
) {
1213
.dx-chat-messagebox {
1314
padding: $messagebox-padding;
@@ -34,10 +35,14 @@
3435
}
3536

3637
.dx-fileuploader-files-container {
37-
padding: $messagebox-file-container-padding;
38-
padding-top: $messagebox-file-container-padding-top;
38+
padding: $messagebox-files-container-padding;
39+
padding-top: $messagebox-files-container-padding-top;
3940
gap: $gap;
4041
grid-template-columns: repeat(auto-fit, $chat-file-container-width);
42+
43+
.dx-fileuploader-file-container {
44+
background-color: $messagebox-file-background-color;
45+
}
4146
}
4247
}
4348

packages/devextreme-scss/scss/widgets/base/chat/layout/chat-messagebubble/_index.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ $chat-messagebubble-max-height-image: 400px !default;
2626
&.dx-has-image {
2727
padding: $chat-messagebubble-padding-image;
2828
}
29+
30+
.dx-chat-messagebubble-content:empty {
31+
display: none;
32+
}
2933
}
3034

3135
.dx-chat-messagegroup-alignment-start {

packages/devextreme-scss/scss/widgets/fluent/chat/_colors.scss

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
@use "../sizes" as *;
33
@use "../colors" as *;
44
@use "../textEditor/colors" as *;
5+
@use "../button/colors" as *;
56

67
// adduse
78

@@ -17,6 +18,7 @@ $chat-background-color: $base-bg !default;
1718
*/
1819
$chat-border-color: $base-border-color !default;
1920
$chat-messagebox-border-color: $chat-border-color !default;
21+
$chat-messagebox-file-background-color: $button-normal-text-hover-bg !default;
2022
$chat-message-editing-preview-accent-color: $base-accent !default;
2123
$chat-message-editing-preview-cancel-button-color: $texteditor-label-color !default;
2224

@@ -141,7 +143,7 @@ $chat-file-secondary-color: null !default;
141143
$chat-typingindicator-circle-bg-color-center: darken($base-bg, 56.08) !default;
142144

143145
$chat-file-container-box-shadow: 0 0 2px 0 color.change($base-shadow-color, $alpha: 0.12), 0 1px 2px 0 color.change($base-shadow-color, $alpha: 0.14) !default;
144-
$chat-file-secondary-color: lighten($base-text-color, 29.80) !default;
146+
$chat-file-secondary-color: $base-icon-color !default;
145147

146148
@if $color == "blue" {
147149
$chat-bubble-background-color-primary: lighten(desaturate(adjust-hue($base-accent, 3.8), 11.4), 55.5) !default;
@@ -171,7 +173,7 @@ $chat-file-secondary-color: null !default;
171173
$chat-typingindicator-circle-bg-color-center: lighten($base-bg, 43.92) !default;
172174

173175
$chat-file-container-box-shadow: 0 0 2px 0 color.change($base-shadow-color, $alpha: 0.28), 0 1px 2px 0 color.change($base-shadow-color, $alpha: 0.32) !default;
174-
$chat-file-secondary-color: darken($base-text-color, 40.00) !default;
176+
$chat-file-secondary-color: $base-icon-color !default;
175177
}
176178

177179
/**

packages/devextreme-scss/scss/widgets/fluent/chat/_index.scss

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,8 @@
2626
$chat-file-secondary-font-size,
2727
$chat-file-secondary-color,
2828
$chat-file-base-section-gap,
29-
$chat-file-file-size-max-width,
29+
$chat-file-size-max-width,
30+
$chat-file-icon-font-size,
3031
);
3132
@include chat-fileview(
3233
$chat-file-view-items-gap,
@@ -47,8 +48,9 @@
4748
$chat-messagebox-textarea-padding,
4849
$chat-messagebox-toolbar-min-height,
4950
$chat-file-container-width,
50-
$chat-messagebox-file-container-padding,
51-
$chat-messagebox-file-container-padding-top,
51+
$chat-messagebox-files-container-padding,
52+
$chat-messagebox-files-container-padding-top,
53+
$chat-messagebox-file-background-color,
5254
);
5355
@include chat-messagebubble(
5456
$chat-bubble-padding,

0 commit comments

Comments
 (0)