Repository navigation
fix: fixed odd scrolling while refreshing with compact styles - #1288
Merged
spacecowboy merged 2 commits intoOct 24, 2026
Merged
spacecowboy merged 2 commits into
spacecowboy merged 2 commits into
Conversation
The separator is emitted inside its own entry's lazy item and is drawn as a filled Box rather than HorizontalDivider. HorizontalDivider draws through a Canvas whose colour comes from DividerTokens, which resolved to nothing visible on the feed item surface, so separators were not drawn at all. A background modifier has no token and no Canvas, so what is drawn is exactly the colour written. Both row and separator are now placed from the same measurement pass, so they cannot end up on different offsets while scrolling, flinging or overscrolling.
Closes spacecowboy#942. Pulling to refresh and then continuing to scroll left empty space above the list. ememberLazyListState re-evaluated itemCount == 0 on every recomposition and returned a throwaway LazyListState in that case - a workaround for the scroll position resetting after process re-creation (issuetracker 177245496). A paging invalidation reports zero items before the new page arrives, so any refresh swapped in a brand new state instance and the list laid itself out again from scratch instead of holding its position. The fallback is now latched: it applies only until items have been seen once and is never returned afterwards, which keeps the re-creation workaround and stops the churn during a refresh.
Owner
|
Thanks @jl0277 |
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.
What does this change?
This PR fixes the refresh issue where empty space appears when refreshing in compact and subcompact modes.
It also introduces changes that help the separators follow the content of the code better.
Checklist
./gradlew ktlintFormatand committed the resultMIGRATION_N_N+1inAppDatabase.ktapp/src/androidTest/.../db/room/Screenshots (if UI change)
Before: as shown in video in issue 942.
Screen_recording_20261024_113211.mp4
fixes #942