Skip to content

feat: Support server collections and collection-like things - #394

Merged
van-geaux merged 8 commits into
van-geaux:mainfrom
RobinD42:feat/library-collections
Nov 5, 2026
Merged

van-geaux merged 8 commits into
van-geaux:mainfrom
RobinD42:feat/library-collections

Conversation

@RobinD42

@RobinD42 RobinD42 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Pull request

This PR adds support for browsing book collections and collection-like things on all three server types. Rational: from the client perspective, or conceptual level, there isn't any real difference between a Bookorbit Collection and Smart Scope, so I combined them. I tried to do the same with the other server types but I'm not familiar with them so I may have missed the mark there. I think it's at least a good start for them however.

Contributor checklist

  • The change is scoped to the related feature.
  • Tests and manual-validation status are documented.
  • No credentials, cookies, API keys, private server URLs, or generated local data are included.

Summary

  • Add a standalone Collections destination launched from the More menu, with a picker-style header, collection descriptions and book counts, and Browse-style book listings.
  • Support BookOrbit collections and Smart Scopes, Kavita collections and “Want To Read,” and Komga collections and Read Lists.
  • Cache the collection catalog for five minutes per server/profile and support pull-to-refresh.
  • Add mocked-HTTP provider contract tests and update architecture, module, testing, and provider documentation. Use it to add unit tests to further flesh out the Kavita and Komga collection coverage.

Verification

  • .\gradlew.bat :app:testDebugUnitTest — passed.

  • .\gradlew.bat :app:compileDebugKotlin :app:compileDebugAndroidTestKotlin :app:connectedDebugAndroidTest '-Pandroid.injected.device.serial=emulator-5556' '-Pandroid.testInstrumentationRunnerArguments.class=com.vangeaux.lagrange.BookOrbitAppInstrumentedTest#collectionsPageShowsCollectionsAndSmartScopesAndOpensTheirBooks' — passed on the Pixel 9 API 35 emulator.

  • git -c core.whitespace=cr-at-eol diff --check origin/main...HEAD — passed.

  • The full instrumented suite previously reported 77 failures out of 248 tests. It was not rerun after the focused Collections test was corrected; that focused test passes.

  • Manual live-server validation against BookOrbit, Komga, and Kavita was performed on multiple devices and the emulator.

Screenshots

image

image

image

@van-geaux

Copy link
Copy Markdown
Owner

@RobinD42, this is awesome. Collections support is something I’d had in the back of my mind for a while, and I’d honestly forgotten to get around to it. Thanks for taking it on!

Before we merge, could you address two things I noticed?

  • Smart Scope books used to fall back to the saved catalog when offline. The new books-page path appears to fetch directly without saving or reading that cache, so previously browsed scopes may no longer open offline.
  • The Collections screen keeps its loaded entries across profile/server changes. Could you scope that state to the active profile/server and clear the selected collection when the scope changes?

Also, the PR notes that the full instrumentation suite had 77 failures and wasn’t rerun after the focused test was fixed. Could you share whether those failures are related or rerun the suite if practical?

@RobinD42

RobinD42 commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Also, the PR notes that the full instrumentation suite had 77 failures and wasn’t rerun after the focused test was fixed. Could you share whether those failures are related or rerun the suite if practical?

One of the 77 was related to the PR changes and it was fixed and was the "focused test" that passed on the rerun. The 76 are the same as what I pointed out in an earlier PR that probably have something to do with my emulator instance or something else in my environment because the failure messages don't seem to have anything to do with the application functionality.

@RobinD42
RobinD42 force-pushed the feat/library-collections branch from f370dd5 to 8fb6c1c Compare November 4, 2026 00:19
@RobinD42

RobinD42 commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Fixed two items identified above, added some regression tests, and rebased onto current main.

@van-geaux van-geaux left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RobinD42, we’ll approve and merge this PR, then see how Kavita collection loading performs in the field. Kavita’s Want To Read collection doesn’t provide a book count, so Lagrange may need to enumerate its pages and load series details before showing the picker, which could make it slow to open. We’ve decided to merge anyway because Kavita collections are manually created, so we don’t expect them to become excessively large. We’ll keep an eye on it. It took us a while to review the logic across the providers and offline paths. Thanks for the thorough work on this!

@van-geaux
van-geaux merged commit 010bdf9 into van-geaux:main Nov 5, 2026
1 check passed
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.

2 participants