Fix issue when scrolling on collection details page (#2048)

## Description
If a collection is using separated types and there were 2+ empty rows
between types, then the forward composition wouldn't trigger and the
next row would not appear. In practice this means if you have a
Collection that contained Movies and Videos, you might not be able to
scroll down from Movies to Videos.

The fix is to filter out the empty rows before composing.

### Related issues
Fixes #2046

### Testing
Emulator

## Screenshots
N/A

## AI or LLM usage
None
This commit is contained in:
Damontecres 2026-10-08 09:51:26 -04:00 • committed by GitHub
parent b99f21efa8
commit e23c446bb7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -244,12 +244,15 @@ class CollectionViewModel
}
jobs.forEach { job ->
val (type, row) = job.await()
_state.update {
val separateItems =
it.separateItems.toMutableMap().apply {
put(type, row)
}
it.copy(separateItems = separateItems)
// Only include Success if non-empty
if (row !is HomeRowLoadingState.Success || row.items.isNotEmpty()) {
_state.update {
val separateItems =
it.separateItems.toMutableMap().apply {
put(type, row)
}
it.copy(separateItems = separateItems)
}
}
}
}