Skip to content

fix(loop): thumbnails and lazy images for pages Load More adds - #344

Merged
nk-o merged 1 commit into
masterfrom
loop-fu-s6b-pages
Sep 25, 2026
Merged

nk-o merged 1 commit into
masterfrom
loop-fu-s6b-pages

Conversation

@nk-o

@nk-o nk-o commented Sep 25, 2026

Copy link
Copy Markdown
Collaborator

Load More and infinite scroll parse the fetched page with DOMParser, which runs without scripts. It reads the <noscript> copy of every lazy image as real markup, so each appended page loaded its images twice, once at once and once lazily. On a dev page, one Load More added 4 extra image requests. The parsed page now drops its noscript nodes before the items move over. Router swaps (filter, sort, numbered pages) were never affected.

Carousel Thumbnails also stopped at the first page, which the docs listed as a limit ("do not combine the two"). The strip the server rendered for the fetched page is now moved over with its buttons renumbered, so every appended slide has a thumbnail, and Back removes them with the rest of the Load More.

The noscript test needs lazy images on screen. The tests site has the plugin's lazy loading off, so the first version of the test passed without the fix. It now uses one column, so the items below the first row load lazily, and it fails without the fix.

Checks: lint 0, lint:php 0, PHPUnit 450 OK, e2e 208 passed.

- Carousel Thumbnails take the strip the fetched page rendered, so
  every appended slide has its thumbnail.
- The parsed page drops noscript copies: DOMParser runs without
  scripts and turned them into images that loaded at once.
@nk-o
nk-o merged commit af79957 into master Sep 25, 2026
7 checks passed
@nk-o
nk-o deleted the loop-fu-s6b-pages branch September 25, 2026 15:56
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