gate the library on playback restore so the bottom bar lands in place

The tab bar was laid out before playback was known, so the restored mini player arrived
later and re-laid the whole bottom area: a couple of frames of bump, and the mini player
"loading in" after the library. SubtracksRoot now waits for PlaybackController to finish
connecting and restoring (a `ready` flag, set after restore or on disconnect) before it
composes the library, so the first library frame already includes the mini player and
nothing moves.

With playback resolved up front, the `restored` flag and its special enter/inset specs
are pointless, so they are reverted; playback the user starts animates as before.
This commit is contained in:
austinried
2026-10-04 00:30:00 +00:00
parent f7a5502240
commit ffbbf46b43
3 changed files with 28 additions and 33 deletions
@@ -28,6 +28,7 @@ import okhttp3.OkHttpClient
import org.junit.After
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
@@ -161,17 +162,16 @@ class PlaybackControllerTest {
}
@Test
fun restoringMarksTheStateUntilPlaybackStarts() {
fun theReadyStateResolvesWithTheRestoredItemAlreadyInPlace() {
seedAlbum(5, sourceId = 1)
runBlocking { queues.replace(listOf(queues.albumEntry(1, "al1"))) }
assertFalse(controller.ready.value)
controller.connect()
await { handle.items.isNotEmpty() }
await { controller.ready.value }
assertTrue(controller.state.value.restored)
controller.playAlbum(1, "al1", 0)
await { !controller.state.value.restored }
assertNotNull("the mini player must be drawable once ready", controller.state.value.item)
}
@Test