lazy-scroll-helper-kit
Installation
SKILL.md
Lazy list helpers, and what each one gets wrong
Four utilities, each a handful of lines, each with a failure mode that only shows in a real list.
Keep them together: they all read layoutInfo — the last completed layout, never the next one.
Scroll direction, as derived state
// adapted: logging removed, list and grid variants collapsed into one
@Composable
fun LazyListState.isScrollingUp(): State<Boolean> {
var previousIndex by remember(this) { mutableIntStateOf(firstVisibleItemIndex) }
var previousOffset by remember(this) { mutableIntStateOf(firstVisibleItemScrollOffset) }