feat: lazy load thumbnails on people and place list (#23682)

perf(web): lazy load thumbnails on people and place list
This commit is contained in:
Lukas 2025-11-07 21:22:02 +01:00 committed by GitHub
parent 93ab42fa24
commit c935ae47d0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 0 deletions

View file

@ -20,6 +20,7 @@
hiddenIconClass?: string;
class?: ClassValue;
brokenAssetClass?: ClassValue;
preload?: boolean;
onComplete?: ((errored: boolean) => void) | undefined;
}
@ -38,6 +39,7 @@
onComplete = undefined,
class: imageClass = '',
brokenAssetClass = '',
preload = true,
}: Props = $props();
let loaded = $state(false);
@ -92,6 +94,7 @@
{title}
class={['object-cover', optionalClasses, imageClass]}
draggable="false"
loading={preload ? 'eager' : 'lazy'}
/>
{/if}

View file

@ -157,6 +157,7 @@
altText={person.name}
widthStyle="100%"
hiddenIconClass="text-white group-hover:text-black transition-colors"
preload={false}
/>
{#if person.name}
<span class="absolute bottom-2 start-0 w-full select-text px-1 text-center font-medium text-white">

View file

@ -52,6 +52,7 @@
title={person.name}
widthStyle="100%"
circle
preload={false}
/>
{#if person.isFavorite}
<div class="absolute top-4 start-4">

View file

@ -49,6 +49,7 @@
src={getAssetThumbnailUrl({ id: item.id, size: AssetMediaSize.Thumbnail })}
alt={city}
class="object-cover w-39 h-39"
loading="lazy"
/>
</div>
<span