Fix thumbnail loading and startup gallery refresh.

Refresh gallery metadata after thumbnail generation so new thumb URLs are available immediately, and lazy-load gallery thumbnails with IntersectionObserver to avoid fetching all images on initial page load.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-03 00:16:38 +12:00
parent 45b31be9a7
commit a9095727bf
3 changed files with 55 additions and 1 deletions

View File

@@ -22,7 +22,9 @@ templ GalleryGrid(images []gallery.Image) {
>
if img.ThumbURL != "" {
<img
src={ img.ThumbURL }
src="data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs="
data-src={ img.ThumbURL }
class="lazy-thumb"
alt={ fmt.Sprintf("%s — %s", gallery.AlbumLabel(img.Album), formatDate(img.Date)) }
loading="lazy"
decoding="async"