Skip to content

fix: fixed odd scrolling while refreshing with compact styles - #1288

Merged
spacecowboy merged 2 commits into
spacecowboy:masterfrom
jl0277:fix/942-odd-scrolling-while-refreshing
Oct 24, 2026
Merged

spacecowboy merged 2 commits into
spacecowboy:masterfrom
jl0277:fix/942-odd-scrolling-while-refreshing

Conversation

@jl0277

@jl0277 jl0277 commented Oct 24, 2026 •

Copy link
Copy Markdown
Contributor

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

  • [Yes] Ran ./gradlew ktlintFormat and committed the result
  • [No schema change] If the Room schema changed: added a MIGRATION_N_N+1 in AppDatabase.kt
  • [No schema change] If the Room schema changed: added a migration test in app/src/androidTest/.../db/room/

Screenshots (if UI change)

Before: as shown in video in issue 942.

Screen_recording_20261024_113211.mp4

fixes #942

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.
@spacecowboy spacecowboy changed the title Fix/942 odd scrolling while refreshing fix: fixed odd scrolling while refreshing with compact styles Oct 24, 2026
@spacecowboy

Copy link
Copy Markdown
Owner

Thanks @jl0277

@spacecowboy
spacecowboy merged commit ae6d028 into spacecowboy:master Oct 24, 2026
12 checks 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.

odd scrolling behaviour while refreshing with compact/super compact

2 participants