feat(stores): bring the launcher's motion to the stores pages (#482)

* refactor(ui): share End session's step-out as StepOut

* feat(ui): let PageFlood carry a tile's art

* feat(stores): bring the launcher's motion to the stores pages

* fix(stores): lay out the pane's rows in a column

* fix(stores): a game page no longer leaves the pad's focus on a dead card and crashes the next press

* perf(stores): GOG remembers its non-games and the library cache loads off the main thread

* fix(ui): a step-out's backdrop never takes the pad's focus

* feat(stores): modes step out of the store chip, each store in its own colour, search in the header

* feat(stores): sign-in pages in the Steam tab's style and an are-you-sure for sign out

* style(stores): drop the sign-in page's store eyebrow, which the title already names

* style(stores): the sign-in page is the store's name and Sign in

* fix(ui): the focus ring follows a control until it stops and meets one still rising into place

* feat(stores): the store a pad's focus is on shows without A, and a press never lands on where it sent focus

* perf(stores): keep chip motion responsive while libraries change
This commit is contained in:
Kurt Himebauch authored and GitHub committed 2026-10-09 14:55:03 -04:00
1 parent 5af14829b0
commit c761b83112
22 files changed
+2005 -297

No files matched your search

@@ -0,0 +1,54 @@
package com.droiddeck.launcher.ui
import androidx.compose.ui.geometry.Rect
import androidx.compose.ui.graphics.Path
import org.junit.Assert.assertEquals
import org.junit.Assert.assertNotNull
import org.junit.Assert.assertNull
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.annotation.Config
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [28], manifest = Config.NONE)
class StepOutTest {
private val pill = Rect(400f, 100f, 500f, 140f)
@Test fun leftOutlineRunsFromTheBoxLeftToThePillRight() {
val path = Path()
stepPath(path, pill, left = 240f, bottom = 300f, pullTop = 146f, box = 16f, fillet = 10f)
val b = path.getBounds()
assertEquals(240f, b.left, 0.5f)
assertEquals(500f, b.right, 0.5f)
assertEquals(100f, b.top, 0.5f)
assertEquals(300f, b.bottom, 0.5f)
}
@Test fun rightOutlineMirrorsItAboutThePill() {
val path = Path()
stepPathRight(path, pill, right = 660f, bottom = 300f, pullTop = 146f, box = 16f, fillet = 10f)
val b = path.getBounds()
assertEquals(400f, b.left, 0.5f)
assertEquals(660f, b.right, 0.5f)
assertEquals(100f, b.top, 0.5f)
assertEquals(300f, b.bottom, 0.5f)
}
@Test fun aClosedOutlineIsJustThePill() {
val path = Path()
stepPathRight(path, pill, right = pill.right, bottom = pill.bottom, pullTop = pill.bottom + 6f, box = 16f, fillet = 10f, pillCorner = 12f)
val b = path.getBounds()
assertEquals(pill.left, b.left, 0.5f)
assertEquals(pill.right, b.right, 0.5f)
assertEquals(pill.bottom, b.bottom, 0.5f)
}
@Test fun aCardMarkIsTakenOnceAndOnlyForItsGame() {
StoresMotion.markCard(CardMark("gog:1", pill, 10f, null))
assertNull(StoresMotion.takeCard("gog:2"))
StoresMotion.markCard(CardMark("gog:1", pill, 10f, null))
assertNotNull(StoresMotion.takeCard("gog:1"))
assertNull(StoresMotion.takeCard("gog:1"))
}
}
@@ -4,15 +4,15 @@ import com.droiddeck.launcher.stores.Store
import org.junit.Assert.assertEquals
import org.junit.Test
/** Amazon has no catalog of its own: Installed and Library only, and Store falls back to Library. */
/** A store's modes are Store, Library and Installed; Amazon has no catalog of its own, so no Store. */
class StoreTabsTest {
@Test fun storeAndLibraryAmazonLibraryOnly() {
assertEquals(listOf("store", "library"), tabsFor(Store.GOG))
assertEquals(listOf("library"), tabsFor(Store.AMAZON))
@Test fun storeLibraryInstalledAmazonWithoutStore() {
assertEquals(listOf("store", "library", "installed"), tabsFor(Store.GOG))
assertEquals(listOf("library", "installed"), tabsFor(Store.AMAZON))
assertEquals("library", tabFor(Store.AMAZON, "store"))
// An old saved Installed or All tab opens Library.
// An old saved All tab opens Library; Installed is a mode again.
assertEquals("library", tabFor(Store.GOG, "all"))
assertEquals("library", tabFor(Store.EPIC, "installed"))
assertEquals("installed", tabFor(Store.EPIC, "installed"))
assertEquals("store", tabFor(Store.GOG, "store"))
}
}