feat: native pagination support (JetLimePaginatedColumn / JetLimePaginatedRow)#68
Merged
Conversation
…PaginatedRow) Adds optional, dependency-free pagination (infinite scroll) for timelines, resolving discussion #64. Two new composables fire an `onLoadMore` callback when the user scrolls within `loadMoreThreshold` items of the end (guarded by `isLoading`/`hasMoreItems`) and render an optional loading footer. The existing JetLimeColumn/JetLimeRow are untouched (fully backward compatible). - JetLimePaginatedList.kt: JetLimePaginatedColumn / JetLimePaginatedRow built on derivedStateOf over LazyListState + a rememberUpdatedState-guarded LaunchedEffect. - EventPosition.dynamicPaginated(): keeps the last loaded item as MIDDLE while more pages can load so the connecting line stays continuous, terminating only on the last page. - JetLimeDefaults.LoadMoreThreshold: default trigger distance. - Sample: new "Paginated" tab + PaginatedVerticalTimeLine screen. - README: Pagination section + highlight. - Instrumented tests for display, loading footer, scroll trigger, guards, and the connector-continuity logic. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: de596bf318
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Make `loadingContent` nullable on JetLimePaginatedColumn / JetLimePaginatedRow. It keeps the default centered progress indicator and remains fully customizable via a slot, and passing `null` now cleanly omits the footer entirely (no empty item is added to the lazy list). Documented the behavior and added tests for the default loader, a custom loader, and the hidden (null) case. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Addresses Codex review on EventPosition.dynamicPaginated: when a paginated list has exactly one loaded item and more pages remain, index 0 was returned as MIDDLE, making isNotStart() true and drawing a spurious incoming connector before the first event. Only the outgoing connector should be forced on while pages remain, so a single-item pending list now stays START (isNotEnd() true, isNotStart() false). Added a test for the single-item pending case. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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 free
to 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.
Context
Resolves discussion #64 — a request for JetLime to manage pagination / infinite scroll internally so consumers don't have to wire up scroll detection themselves.
Implemented natively in Compose — no new dependency (JetLime stays dependency-light).
What's added
Two new, purely additive composables —
JetLimePaginatedColumnandJetLimePaginatedRow:LazyListState.layoutInfoviaderivedStateOfand fireonLoadMorewhen the user scrolls withinloadMoreThresholditems of the end — guarded by!isLoading && hasMoreItems.loadingContentfooter whileisLoading(default: centeredCircularProgressIndicator).onLoadMorewrapped inrememberUpdatedStateso the restarting effect always calls the latest lambda.itemsList,isLoading,hasMoreItems) is owned by the caller.The existing
JetLimeColumn/JetLimeRowsignatures are untouched → fully backward compatible.Timeline-line continuity
EventPosition.dynamicPaginated(index, listSize, isLastPage)keeps the last loaded item asMIDDLE(notEND) while more pages can load, so the connecting line flows continuously into the next page instead of flickering on each append. It resolves toENDoncehasMoreItems = false.Changes
JetLimePaginatedList.kt(new) — the two composables + load-more trigger.EventPosition.kt—dynamicPaginated()factory.JetLimeDefaults.kt—LoadMoreThreshold(default3).PaginatedVerticalTimeLinescreen (fake paged data source).JetLimePaginatedColumnTest: display, loading footer, scroll trigger,hasMoreItemsguard, and the connector-continuity logic.Verification
spotlessCheckpasses:jetlimecompiles for Android, Desktop, and common metadata:sample:composeAppcompilesandroidx.test/InputManager.getInstanceincompatibility that affects all instrumented tests (not specific to this change). They should be run on a stable API (≤ 36) device/emulator.