Commit 9e37bf55 authored by jan.koester's avatar jan.koester
Browse files

image widget: add width/height attributes for CLS fix, bump changelog to 20260426+1

parent 523e2db4
Loading
Loading
Loading
Loading
+10 −0
Changes for debian/changelog: 10 added lines, 0 removed lines.
Original line number Diff line number Diff line
blogi (20260426+1) unstable; urgency=medium

  * Performance: O(1) theme asset lookup via unordered_map instead of linear search
  * Performance: pre-compute lowercase paths at startup, eliminate per-request allocations
  * Performance: direct pointer streaming in Response() instead of substr copies
  * Add loading="lazy" to all content images (except above-the-fold banner)
  * Fix CLS: set width/height HTML attributes on image widgets for aspect-ratio hints

 -- Jan Koester <jan.koester@tuxist.de>  Sat, 26 Apr 2026 12:00:00 +0200

blogi (20260419+2) unstable; urgency=medium

  * Fix filebrowser treeview duplication by setting columnCount to 1,
+6 −0
Changes for editor/widgets/image/image.cpp: 6 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -491,6 +491,12 @@ extern "C" {
                img.setAttribute("alt", alt.c_str());
                img.setAttribute("class", responsiveClass.c_str());

                // Set intrinsic width/height attributes for CLS prevention (aspect-ratio hint)
                if (realWidth > 0 && realHeight > 0) {
                    img.setAttribute("width", std::to_string(realWidth).c_str());
                    img.setAttribute("height", std::to_string(realHeight).c_str());
                }

                // Compute effective width/height, auto-calculating from aspect ratio
                std::string effWidth = width;
                std::string effHeight = height;