Skip to content

ADFA-5329 feat(books): incremental "Load more" pagination (app + dash-node) - #491

Merged
luisguzman-adfa merged 2 commits into
mainfrom
feat/ADFA-5329-books-load-more
Aug 28, 2026
Merged

ADFA-5329 feat(books): incremental "Load more" pagination (app + dash-node)#491
luisguzman-adfa merged 2 commits into
mainfrom
feat/ADFA-5329-books-load-more

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

Books "Get more" only ever showed the first 40 of the ~1,100-title catalog
(BooksLandingFragment requested limit=40 with no pagination). This adds offset
paging so users can browse the whole catalog, 40 at a time.

Changes:

  • dash-node (static/dashboard): /api/books/search takes ?offset=, and every branch
    now orders with a stable tiebreaker on gutenberg_id so consecutive batches don't
    overlap or skip on tied downloads/rank (searchCatalog + routes.ts).
  • App data sources: BooksCatalogAsset.search (offline asset) and BooksClient.search
    (REST) take an offset param.
  • BooksLandingFragment: fetchBatch(offset, append) with hasMore/loading; loadMore()
    appends the next batch of 40. Footer shows "Showing N books" + "Load more", a
    "Loading…" state, and "That's all · N books" at the end.
  • New strings (English): k2go_books_load_more, k2go_books_showing_fmt,
    k2go_books_all_fmt.

Behavior: selection (the cart) persists across batches; changing the search,
language, or filter resets to batch 1; the local "My books" library is unchanged
(it returns everything at once, so no Load more there).

Verification: TypeScript type-check passes on static/dashboard; strings XML valid;
referenced drawables/colors/strings exist. The Java side wasn't compiled here (no
Android toolchain in this environment).

Coordination: the live path needs the dash-node rebuild/deploy for the new ?offset=
(the offline/wizard asset path works from the app alone). Strings are English-only
for now; they get localized in the next l10n pass.

Follow-up (optional, not in this PR): append only the new rows instead of rebuilding
the whole grid on each Load more; surface an inline error if a batch fetch fails.

…-node)
Books 'Get more' only ever showed the first 40 of ~1,100. Add offset paging:
- dash-node: /api/books/search takes ?offset= and orders with a stable tiebreaker (gutenberg_id) so batches don't overlap/skip (searchCatalog).
- App data sources: BooksCatalogAsset.search (offline asset) and BooksClient.search (REST) take an offset param.
- BooksLandingFragment: fetchBatch(offset, append) with hasMore/loading; loadMore() appends the next 40; footer shows 'Showing N books' + 'Load more', a 'Loading…' state, and 'That's all · N books' at the end. Selection persists across batches; search/language/filter changes reset to batch 1. Not shown for the local library.
- New strings (EN): k2go_books_load_more/showing_fmt/all_fmt.
k2go_books_load_more / showing_fmt / all_fmt into the 33 locales (machine, flagged for native review: bn/gu/ta/sw/az/yo/sr).
@luisguzman-adfa
luisguzman-adfa merged commit c1024a9 into mainAug 28, 2026
4 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the feat/ADFA-5329-books-load-more branch August 28, 2026 04:17
Sign up for freeto 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

@luisguzman-adfa