Queue fix + cross-client queue enhancements #112

Merged
bvandeusen merged 9 commits from dev into main 2026-07-23 08:31:34 -04:00
Showing only changes of commit 41ebf1405b - Show all commits
@@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.material3.HorizontalDivider
import androidx.compose.material3.Icon
@@ -86,7 +87,14 @@ private fun QueueList(
onJumpTo: (Int) -> Unit,
onToggleLike: (String) -> Unit,
) {
LazyColumn(modifier = Modifier.fillMaxSize()) {
// Open scrolled to the now-playing track so it's in view immediately.
// Seeding the initial index (rather than animating post-layout) avoids a
// flash of the list top; it's captured once per entry, so the view stays
// put as the track later auto-advances — matching "show me where I am now."
val listState = rememberLazyListState(
initialFirstVisibleItemIndex = currentIndex.coerceIn(0, tracks.lastIndex),
)
LazyColumn(state = listState, modifier = Modifier.fillMaxSize()) {
itemsIndexed(items = tracks, key = { _, track -> track.id }) { index, track ->
QueueRow(
track = track,