perf: enable lazy loading for avatars and thumbnails

Added `loading="lazy"` and `decoding="async"` attributes to dynamically created `<img>` elements in:
- `js/historyView.js` (avatars)
- `js/ui/subscriptionHistoryController.js` (channel icons)
- `js/searchView.js` (added `decoding="async"`)
- `js/ui/profileModal/ProfileDirectMessageRenderer.js` (attachment previews, avatars)
- `js/ui/profileModalController.js` (attachment previews, saved profile avatars)

This reduces initial page load impact and bandwidth usage by deferring off-screen image loading.

Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
google-labs-jules[bot]andPR0M3TH3AN committed 2026-02-12 16:56:06 +00:00
1 parent 216361ed77
commit df62585106
6 files changed
+62

No files matched your search

+2
View File
@@ -255,6 +255,8 @@ export class SubscriptionHistoryController {
const img = document.createElement("img");
img.src = avatar;
img.loading = "lazy";
img.decoding = "async";
img.className = "w-8 h-8 rounded-full object-cover bg-surface-2";
img.onerror = function () {
this.src = "assets/svg/default-profile.svg";