Skip to content

feat: detect images without explicit width/height (CLS)#32

Merged
yuripinto merged 1 commit into
mainfrom
feat/image-dimensions-detection
Jun 4, 2026
Merged

feat: detect images without explicit width/height (CLS)#32
yuripinto merged 1 commit into
mainfrom
feat/image-dimensions-detection

Conversation

@yuripinto

Copy link
Copy Markdown
Owner

What

Wave 2 / Block 2.1 — an <img> with no width/height attribute reflows as it loads, causing Cumulative Layout Shift (CLS), a Core Web Vitals signal.

New images_missing_dimensions (LOW), reported with the count: "N of M images have no width/height".

How

  • The extraction pass already walks every <img> for alt text; _image_stats now also counts images missing a usable width or height (empty string counts as missing).
  • ExtractedPage gains images_missing_dimensions; new depth-style column + additive migration; persistence threaded.

Image byte-weight (the other half of Block 2.1) needs HEAD requests / network I/O and was intentionally deferred per scope decision.

Tests

Extraction test (sized vs width-only vs none vs empty), detector test (flagged + clean), migration column assertion. Full suite: 225 passed. ruff clean.

An <img> with no width/height attribute reflows as it loads, causing
Cumulative Layout Shift (CLS), a Core Web Vitals signal. The extraction
pass already walks every <img> for alt text; it now also counts images
missing a usable width or height.

- ExtractedPage gains images_missing_dimensions; new column + additive
  migration; persistence threaded.
- images_missing_dimensions (LOW) fires when any image lacks a dimension.

Image byte-weight (needs HEAD requests) is intentionally deferred.
@yuripinto
yuripinto merged commit ba58c03 into main Jun 4, 2026
4 checks passed
@yuripinto
yuripinto deleted the feat/image-dimensions-detection branch June 4, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant