Skip to content

Commit 2b707f4

Browse files
authored
Merge pull request #526 from GetStream/perf-message-list
Perf message list
2 parents 1ab3e26 + 2828b5d commit 2b707f4

23 files changed

+390
-151
lines changed

.github/workflows/workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- beta
77
- test
88
- theming-v2
9-
- support-angular-17
9+
- perf-message-list
1010
pull_request:
1111
branches:
1212
- master

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
"prerelease": true
5353
},
5454
{
55-
"name": "support-angular-17",
55+
"name": "perf-message-list",
5656
"prerelease": true
5757
}
5858
],

projects/customizations-example/src/app/app.component.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
let-enabledMessageActions="enabledMessageActions"
3636
let-mode="mode"
3737
let-customActions="customActions"
38+
let-isHighlighted="isHighlighted"
3839
>
3940
<div>
4041
<stream-message
@@ -43,6 +44,7 @@
4344
[enabledMessageActions]="enabledMessageActions"
4445
[mode]="mode"
4546
[customActions]="customActions"
47+
[isHighlighted]="isHighlighted"
4648
></stream-message>
4749
</div>
4850
</ng-template>

projects/stream-chat-angular/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stream-chat-angular",
3-
"version": "4.55.1",
3+
"version": "4.56.0-perf-message-list.2",
44
"description": "Angular components to create chat conversations or livestream style chat",
55
"author": "GetStream",
66
"homepage": "https://getstream.io/chat/",
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export const version = '4.55.1';
1+
export const version = '4.56.0-perf-message-list.2';

projects/stream-chat-angular/src/lib/attachment-configuration.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ export class AttachmentConfigurationService<
228228
sizeRestriction = undefined;
229229
if (displayWarning) {
230230
console.warn(
231-
`Invalid value set for height/max-height and/or max-width for HTML element, this can cause scrolling issues inside the message list, more info https://getstream.io/chat/docs/sdk/angular/components/AttachmentListComponent/#image-and-video-sizing`
231+
`Invalid value set for height/max-height and/or max-width for HTML element, this can cause scrolling issues inside the message list, more info https://getstream.io/chat/docs/sdk/angular/components/AttachmentListComponent/#image-and-video-sizing, attachment URL: ${url.toString()}`
232232
);
233233
}
234234
}

projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,8 @@
106106
"
107107
>
108108
<img
109+
fetchpriority="low"
110+
loading="lazy"
109111
#imgElement
110112
[src]="
111113
getImageAttachmentConfiguration(
@@ -334,6 +336,8 @@
334336
class="str-chat__message-attachment-card--header"
335337
>
336338
<img
339+
fetchpriority="low"
340+
loading="lazy"
337341
data-testclass="card-img"
338342
alt="{{ attachmentConfiguration.url }}"
339343
src="{{ attachmentConfiguration.url }}"

projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.spec.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
import { ComponentFixture, TestBed } from '@angular/core/testing';
1+
import {
2+
ComponentFixture,
3+
TestBed,
4+
fakeAsync,
5+
tick,
6+
} from '@angular/core/testing';
27
import { By } from '@angular/platform-browser';
38
import { TranslateModule } from '@ngx-translate/core';
49
import { ModalComponent } from '../modal/modal.component';
@@ -46,10 +51,12 @@ describe('AttachmentListComponent', () => {
4651
TestBed.inject(StreamI18nService).setTranslation();
4752
});
4853

49-
beforeEach(() => {
54+
beforeEach(fakeAsync(() => {
5055
fixture = TestBed.createComponent(AttachmentListComponent);
5156
component = fixture.componentInstance;
5257
nativeElement = fixture.nativeElement as HTMLElement;
58+
fixture.detectChanges();
59+
tick();
5360
queryAttachments = () =>
5461
Array.from(
5562
nativeElement.querySelectorAll(
@@ -70,7 +77,6 @@ describe('AttachmentListComponent', () => {
7077
Array.from(nativeElement.querySelectorAll('[data-testclass="url-link"]'));
7178
queryCardImages = () =>
7279
Array.from(nativeElement.querySelectorAll('[data-testclass="card-img"]'));
73-
fixture.detectChanges();
7480
queryActions = () =>
7581
Array.from(
7682
nativeElement.querySelectorAll('[data-testclass="attachment-action"]')
@@ -102,7 +108,7 @@ describe('AttachmentListComponent', () => {
102108
'[data-testclass="video-attachment-parent"]'
103109
)
104110
);
105-
});
111+
}));
106112

107113
it('should display received #attachments ordered', () => {
108114
component.attachments = [];

projects/stream-chat-angular/src/lib/attachment-list/attachment-list.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ export class AttachmentListComponent implements OnChanges {
7474
) {
7575
this.themeVersion = themeService.themeVersion;
7676
}
77-
7877
ngOnChanges(changes: SimpleChanges): void {
7978
if (changes.attachments) {
8079
const images = this.attachments.filter(this.isImage);

projects/stream-chat-angular/src/lib/avatar/avatar.component.html

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,18 @@
1616
>
1717
<img
1818
*ngIf="(imageUrl || fallbackChannelImage) && !isError; else fallback"
19-
class="str-chat__avatar-image str-chat__avatar-image{{
20-
isLoaded ? ' str-chat__avatar-image--loaded' : ''
21-
}}"
19+
class="str-chat__avatar-image str-chat__avatar-image"
2220
src="{{ imageUrl || fallbackChannelImage }}"
2321
alt="{{ initials }}"
2422
data-testid="avatar-img"
25-
(load)="isLoaded = true"
2623
(error)="isError = true"
2724
[style]="{
2825
flexBasis: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',
2926
height: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')',
3027
objectFit: 'cover',
3128
width: 'calc(var(--str-chat__spacing-px, 1px) * ' + size + ')'
3229
}"
30+
fetchpriority="high"
3331
/>
3432
<ng-template #fallback>
3533
<div

0 commit comments

Comments
 (0)