feat: Sort bundles by patch count

This commit is contained in:
Ushie
2025-05-05 01:29:06 +03:00
parent 6e57a6e977
commit 419fe3bac1

View File

@ -19,13 +19,17 @@ fun BundleListScreen(
selectedSources: SnapshotStateList<PatchBundleSource>, selectedSources: SnapshotStateList<PatchBundleSource>,
bundlesSelectable: Boolean, bundlesSelectable: Boolean,
) { ) {
val sortedSources = sources.sortedBy {
it.state.value.patchBundleOrNull()?.patches?.size
}
LazyColumnWithScrollbar( LazyColumnWithScrollbar(
modifier = Modifier.fillMaxSize(), modifier = Modifier.fillMaxSize(),
horizontalAlignment = Alignment.CenterHorizontally, horizontalAlignment = Alignment.CenterHorizontally,
verticalArrangement = Arrangement.Top, verticalArrangement = Arrangement.Top,
) { ) {
items( items(
sources, sortedSources,
key = { it.uid } key = { it.uid }
) { source -> ) { source ->
BundleItem( BundleItem(