mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 15:11:58 +01:00
queue view: disable drag auto-scroll; queue plays next when its anchor is removed
- removing the context track the up-next block sits behind now moves the block back behind the preceding track (or to the front when the anchor was first), so the queued track plays next instead of the following context track. - disable sh.calvin.reorderable auto-scroll for every run (scrollThreshold 0). It keeps scrolling past a run's last valid target and can strand the dragged item off-screen; scroll first, then drag.
This commit is contained in:
@@ -465,6 +465,19 @@ class QueueRepositoryTest {
|
||||
assertEquals(listOf("s1", "s4", "s2", "s3"), resolveAll(repository.snapshot()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun removingTheAnchorTrackPutsTheQueueFirst() =
|
||||
runTest {
|
||||
seedLibrary()
|
||||
val snapshot = repository.snapshotAfter(listOf(repository.albumEntry(1, "al1")))
|
||||
repository.addUpNext(snapshot, currentPosition = 0, entry = repository.songEntry(1, "s4"), playNext = false)
|
||||
assertEquals(listOf("s1", "s4", "s2", "s3"), resolveAll(repository.snapshot()))
|
||||
|
||||
repository.removeAt(repository.snapshot(), 0)
|
||||
|
||||
assertEquals(listOf("s4", "s2", "s3"), resolveAll(repository.snapshot()))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun removingTheLastAnchorTrackKeepsTheQueueResolvable() =
|
||||
runTest {
|
||||
|
||||
@@ -519,7 +519,8 @@ class PlaybackControllerTest {
|
||||
?.id == "x1"
|
||||
}
|
||||
|
||||
assertEquals(1L, runBlocking { queues.cursor() })
|
||||
val snapshot = runBlocking { queues.snapshot() }
|
||||
assertEquals(runBlocking { queues.combinedIndexOf(snapshot, "x1") }, controller.state.value.position)
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -979,7 +980,7 @@ class PlaybackControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
fun removingThePlayingAnchorTrackPlaysTheModelNextTrack() {
|
||||
fun removingThePlayingAnchorTrackPlaysTheQueuedTrackNext() {
|
||||
seedAlbum(4, sourceId = 1)
|
||||
seedSong("x1", "al2")
|
||||
|
||||
@@ -994,11 +995,11 @@ class PlaybackControllerTest {
|
||||
runBlocking { controller.removeAt(1) }
|
||||
await {
|
||||
controller.state.value.item
|
||||
?.id == "s3"
|
||||
?.id == "x1"
|
||||
}
|
||||
|
||||
val snapshot = runBlocking { queues.snapshot() }
|
||||
assertEquals(runBlocking { queues.combinedIndexOf(snapshot, "s3") }, controller.state.value.position)
|
||||
assertEquals(runBlocking { queues.combinedIndexOf(snapshot, "x1") }, controller.state.value.position)
|
||||
}
|
||||
|
||||
@Test
|
||||
|
||||
Reference in New Issue
Block a user