Skip to content

Fix(windows) the library grid not loading all items on large windows - #1065

Merged
RadicalMuffinMan merged 2 commits into
Moonfin-Client:mainfrom
KevOutIngs:fix/wide-window-library-paging
Aug 6, 2026
Merged

Fix(windows) the library grid not loading all items on large windows#1065
RadicalMuffinMan merged 2 commits into
Moonfin-Client:mainfrom
KevOutIngs:fix/wide-window-library-paging

Conversation

@KevOutIngs

Copy link
Copy Markdown
Contributor

Pull Request

Summary

On a large desktop window the Movies / TV Shows library grid stops loading items
partway through. Shrinking the window makes loading resume, which is what made
this look intermittent.

Paging was only ever triggered by the scroll listener. A wide window lays out up
to 20 columns, so the 75-item first page can fit entirely inside the viewport —
nothing overflows, maxScrollExtent stays 0, no scroll event fires, and the next
page is never requested. Making the window smaller pushes the content back into
overflow, so scrolling becomes possible and paging appears to fix itself.

This adds a post-layout check that tops the grid up until the content actually
overflows or the library runs out.

Related Issues

  • Closes #
  • Fixes #
  • Related to #

Type of Change

  • Bug fix
  • New feature
  • Refactor
  • Performance improvement
  • UI/UX update
  • Documentation update
  • Build/CI change
  • Other (describe):

Changes Made

  • Added a post-frame viewport-fill check that pages until the grid overflows its viewport or hasMore is false, run from the grid's LayoutBuilder so resizing the window re-checks too.
  • Extracted the "within 400px of the end" test into _nearGridEnd, shared by the scroll listener and the fill check so the two cannot drift apart.
  • Guarded on hasPixels / hasContentDimensions — the metrics extentAfter actually reads — and on a single attached scroll position.
  • Skipped scheduling while a page is in flight or once the library is fully loaded, so a finished grid stops queueing per-frame callbacks.
  • Ended the fill when a delivered page adds no new rows, so a random sort returning already-shown items cannot spin against the server.

Platform

  • Android
  • iOS
  • tvOS
  • Web
  • macOS
  • Windows
  • Linux
  • All / Shared code

Testing

Reported on Windows, but the fix is in shared Dart — any platform with a viewport wide enough to fit a full page is affected.

  • Tested on emulator / simulator
  • Tested on physical device
  • Manual testing completed
  • Not tested (explain why):

Test Steps

  1. Open Moonfin maximized on a wide or ultrawide display.
  2. Browse a Movies or TV Shows library with more than ~75 items.
  3. Confirm the grid keeps loading past the first page without resizing the
    window, and that scrolling still pages normally once content overflows.

Screenshots (if applicable)

Checklist

  • Code builds successfully
  • Code follows project style and conventions
  • No unnecessary commented-out code
  • No new warnings introduced

@KevOutIngs KevOutIngs changed the title Fix the library grid not loading all items on large windows Fix(windows) the library grid not loading all items on large windows Aug 6, 2026
@RadicalMuffinMan
RadicalMuffinMan merged commit b812379 into Moonfin-Client:main Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants