Uh oh!
There was an error while loading. Please reload this page.
ADFA-5329 feat(books): incremental "Load more" pagination (app + dash-node) - #491
Merged
Conversation
…-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).
Uh oh!
There was an error while loading. Please reload this page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
now orders with a stable tiebreaker on gutenberg_id so consecutive batches don't
overlap or skip on tied downloads/rank (searchCatalog + routes.ts).
(REST) take an offset param.
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.
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.