[Library] Show all results (not just paginated) #1
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Current behaviour
The Library page (
app/main.py:455, route/) paginates results with a fixed page size.LIBRARY_PAGE_SIZE = 50(app/main.py:219) and the response only returns the current page viaoffset/limit(app/main.py:497-498). There is no way to view all matching results at once; you have to navigate page by page (library.html:210-213usestotal_pagesandpage).Desired behaviour
Be able to show all matching results in a single view without manual pagination. The UI should allow changing the page size (e.g. include an "All" option alongside the numeric sizes), keeping filters, sorting and the selection bar working as before.
Goals
offset/limit(or use a sufficiently large limit) and must return every result matching the current filters.library.htmlalready uses query params via_library_url).start_index/end_index/totalcorrect, keep numeric pagination when a numeric size is chosen, and keep the selected ordering.app/static/app.css, vanilla JS, no build step perAGENTS.md).[Library] Mostrar todos los resultados (no solo paginados)to [Library] Show all results (not just paginated)Proposal — lazy-loading infinite scroll
Picking this one up. Plan below; will start once a maintainer signals go.
Approach
Replace the fixed 50-item pagination with an IntersectionObserver-driven infinite scroll:
/still server-renders the first page (SSR + no-JS keeps working).GET /items/page?offset=&limit=&<filter params>&<sort>returns{items, total, has_more}.<div data-infinite-scroll-sentinel>at the bottom of the grid triggers a fetch; cards append via arenderCard(item)helper extracted from the current template.limitatMAX_PAGE_LIMIT = 100so a buggy client cannot pull 10k rows.Files touched
app/main.py— refactor filter → query into a single helper used by both the SSR route and the newGET /items/page. AddMAX_PAGE_LIMIT.app/templates/library.html— sentinel + skeleton + end-of-results marker.app/static/app.js— infinite-scroll module: IntersectionObserver, fetch next page, dedupe guard, error toast, selection-toolbar integration, auto-refresh pause while a fetch is pending.app/static/app.css— only if a new state (loading / end / error inline notice) needs a rule; otherwise reuse existing.skeleton/.notice/.toast-regionperAGENTS.md.tests/— new tests for the new endpoint (slice,has_more, cap, filter round-trip) + a regression test that fails on the old "fixed page only" behaviour.Acceptance
GET /items/pagewithoffset,limit, filter, sort →{items, total, has_more}.MAX_PAGE_LIMIT = 100server cap.total,start_index,end_index).Risks
fix/library-filteringandfeat/thumbnail-recovery-jobs→ rebase/merge against currentmainfirst; iffix/library-filteringoverlaps, work on top.Out of scope (tracked separately)
python -m app.cli seed-demoso this PR stays focused on the UI change and the test environment can be populated independently.Deploy
Feature branch → existing Forgejo workflow builds
docker.celor.es/telegramarr:sha-<short>→ side-by-side compose on the runner host pulls the sha-tagged image on a different port for manual testing. Production:lateststays untouched until you green-light the merge.