Skip to content

Add Infinite Scroll plugin - #811

Open
RyanAtNight wants to merge 7 commits into
stashapp:mainfrom
RyanAtNight:add-infinite-scroll
Open

RyanAtNight wants to merge 7 commits into
stashapp:mainfrom
RyanAtNight:add-infinite-scroll

Conversation

@RyanAtNight

@RyanAtNight RyanAtNight commented Nov 3, 2026 •

Copy link
Copy Markdown

Adds Infinite Scroll, a UI-only plugin that replaces page buttons with infinite scrolling in every list (scenes, images, galleries, performers, studios, tags, groups, markers) in Grid, List, Wall and Tagger views, including the lists on performer, studio, tag, group and gallery pages.

Demo: the scene Wall scrolling through 168 scenes

How it works

It adds a read policy to Apollo's cache for the find* fields, so reading any loaded page of a tracked list returns every loaded page, merged and de-duplicated. Stash's own list components then render them, which keeps selection, bulk edit, the play queue, the lightbox, random sort and the tagger working. It also patches Pagination/PaginationIndex (page buttons follow the page in view, the count shows the total), the list renderers (loading markers, position tracking, return-to-place on back) and the card components (off-screen Grid cards become same-size placeholders). If something it patches is missing, that part switches itself off and Stash's normal pagination is used.

Testing

  • Fresh installs of Stash v0.31.1, v0.32.0 and the development build (v0.32.0-1-g944dd694), no other plugins, test library generated per run: 32 automated browser checks pass on all three (every list type and view loads every item without duplicates, pinned header, back/reload keep position, old ?p= links including past-the-end, Select all, sorting, lightbox, placeholders, 576px width, every setting).
  • Daily use on a large real library (v0.31.1, ~20 other UI plugins installed).
  • Installed through Stash's package manager from a plugin source built with the same build_site.sh format.
  • Manifest validates against validator/plugin.schema.json.

LLM disclosure

Written with LLM assistance (Claude). I reviewed the code, tested it by hand in my own Stash, and take full responsibility for it, including license compliance.

🤖 Generated with Claude Code

RyanAtNight and others added 7 commits November 3, 2026 00:17
Replaces page buttons with infinite scrolling in every list and view.
Source: https://github.com/RyanAtNight/StashInfiniteScroll

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the page translated by the browser, scrolling a list could show
"Something went wrong" (removeChild ... not a child of this node) when
a batch finished loading. The loading row and result count no longer
leave bare text nodes for React to remove.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
When another script had wrapped a list card in its own element,
swapping that card for an off-screen placeholder threw "removeChild
... not a child of this node" and crashed the list. The swap now acts
on the element that is really there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With Hover Cards (or another plugin that replaces cards) installed,
React rebuilt each card on every update, and on an image's own page a
card wrapped by another script made that crash with "removeChild ...
not a child of this node" when editing or saving. Infinite Scroll now
adds its placeholders after the card is drawn instead of replacing
the card, so cards aren't rebuilt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each batch that arrived cost one long frame: Stash re-renders the
whole list, and every card on and around the screen was redrawn in it
along with the new ones. Drawn cards whose data hasn't changed now sit
that update out and catch up when scrolling pauses, new cards start as
placeholders and are drawn a few per frame, and batches that land
together are written together.

Card pictures load four at a time, so slow ones (thumbnails still to
be made, a slow disk) no longer fill the browser's connections and
hold up loading more items.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Stash empties its Apollo cache when a scan finishes and fetches only
its own page again. The list shrank to that one batch until the plugin
had fetched the rest, and the browser left the view at the top. The
list now keeps showing what it had until the missing pages are back.
A reset that landed while a batch was loading could leave the list one
batch long for good; it now recovers.

The load-ahead distance is set in percent of a screen (default 150)
instead of screens (default 1.5): Stash's number box drops decimals,
so 1.5 could not be typed. A value saved in screens still counts until
the new setting is given one.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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