From 06269aab24ac9ef1406b542fe98d5156539ea7cf Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Sun, 11 Oct 2026 23:25:55 -0400 Subject: [PATCH] feat: components newest first, Steam settings open on Steam with offline mode, smoother chip selection (#606) * feat: components list newest first, Steam's sheet opens on its Steam tab with offline mode, and Setup's overview drops the account group * fix: chip selections stretch across on every move, drawn over the chips instead of behind them --- .../launcher/session/ComponentsManager.kt | 10 ++++++++-- .../com/droiddeck/launcher/ui/ComponentsPage.kt | 3 ++- .../com/droiddeck/launcher/ui/FrontEndSetup.kt | 8 -------- .../java/com/droiddeck/launcher/ui/LiftSheet.kt | 3 ++- .../droiddeck/launcher/ui/ModeSettingsDialog.kt | 5 ++++- .../java/com/droiddeck/launcher/ui/SharedMotion.kt | 14 +++++--------- .../java/com/droiddeck/launcher/ui/SteamHome.kt | 10 ++++++++++ .../java/com/droiddeck/launcher/ui/StorePage.kt | 3 ++- 8 files changed, 33 insertions(+), 23 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/session/ComponentsManager.kt b/app/src/main/java/com/droiddeck/launcher/session/ComponentsManager.kt index 3266f90e2a..aa489198f1 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/ComponentsManager.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/ComponentsManager.kt @@ -406,9 +406,11 @@ object ComponentsManager { return Package(f.name, comp, prof.optString("versionName", f.nameWithoutExtension), prof.optString("description"), f.length()) } + /** The stored packages, newest version first. */ fun packages(context: Context): List = packagesDir(context).listFiles() - ?.filter { it.isFile && it.name.endsWith(".wcp") }?.sortedBy { it.name } + ?.filter { it.isFile && it.name.endsWith(".wcp") } ?.mapNotNull { f -> runCatching { packageInfo(context, f) }.onFailure { Log.w(TAG, "skipping ${f.name}", it) }.getOrNull() } + ?.sortedWith(newestFirst { it.version.ifEmpty { it.file } }) ?: emptyList() /** Unpacks a package's files/ into a Proton; for DXVK/VKD3D the component's own DLLs are replaced as a set. */ @@ -852,10 +854,14 @@ object ComponentsManager { val arr = o.optJSONArray("items") ?: JSONArray() val items = (0 until arr.length()).map { arr.getJSONObject(it) }.map { CatalogItem(it.optString("file"), it.optString("comp"), it.optString("release"), it.optString("url"), it.optLong("size"), it.optString("digest")) - }.sortedWith(compareBy({ it.comp }, { it.release }, { it.file })) + }.sortedWith(compareBy { it.comp }.then(newestFirst { it.file })) return Catalog(items, o.optLong("fetchedAt")) } + /** By the version in [of], highest first: the newest builds lead a list, as they are what is picked. */ + private fun newestFirst(of: (T) -> String): Comparator = + Comparator { a, b -> ProtonExtras.compareVersions(of(b), of(a)) } + /** * A package Proton does not ship, required on the GPUs listed here. An empty [models] set * means every model in [families]. A row the user already chose in Components is left alone; diff --git a/app/src/main/java/com/droiddeck/launcher/ui/ComponentsPage.kt b/app/src/main/java/com/droiddeck/launcher/ui/ComponentsPage.kt index f33c1e365b..48ac4a28dc 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/ComponentsPage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/ComponentsPage.kt @@ -901,7 +901,6 @@ fun ComponentsPage( ) { val tint = rememberUpdatedState(pal.signal) val local = cardsAt[layer]?.translate(-stackAt) - ChipGlide(LAYERS.indexOf(layer), local, tint, GlideAxis.Vertical, corner = 12.dp) Stack( layer, view, gpu, focus = layerFocus, landed = landed, rings = rings, onPlaced = { l, r -> cardsAt[l] = r }, @@ -912,6 +911,8 @@ fun ComponentsPage( else runCatching { firstRow.requestFocus() } }, ) + // Over the cards: under them, their rest fill hid it as it crossed them. + ChipGlide(LAYERS.indexOf(layer), local, tint, GlideAxis.Vertical, corner = 12.dp) } if (!narrow) { Spacer(Modifier.width(16.dp)) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndSetup.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndSetup.kt index 2302f319f5..613c96d437 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndSetup.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndSetup.kt @@ -321,14 +321,6 @@ internal fun SetupPanel( } } } - SettingsGroup(stringResource(R.string.setup_account)) { - accountCheck(true) - ToggleRow( - host, "offline", stringResource(R.string.setup_offline), - s.offlineAccount?.let { if (it.isEmpty()) stringResource(R.string.setup_signed_in_unnamed) else stringResource(R.string.setup_signed_in, it) } ?: stringResource(R.string.setup_sign_in_first), - s.offline, enabled = s.offlineAccount != null, - ) { a.onOffline() } - } SettingsGroup(stringResource(R.string.setup_runtime)) { runtimeCheck(false) } } 1 -> { diff --git a/app/src/main/java/com/droiddeck/launcher/ui/LiftSheet.kt b/app/src/main/java/com/droiddeck/launcher/ui/LiftSheet.kt index 7833c42f7c..bf64c327bc 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/LiftSheet.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/LiftSheet.kt @@ -775,7 +775,6 @@ internal fun SheetChips(labels: List, selected: Int, focus: List, selected: Int, focus: List = - if (steam) listOf(SheetTab.DISPLAY, SheetTab.CONTROLS, SheetTab.AUDIO, SheetTab.SESSION, SheetTab.LIBRARY, SheetTab.STEAM) + if (steam) listOf(SheetTab.STEAM, SheetTab.DISPLAY, SheetTab.CONTROLS, SheetTab.AUDIO, SheetTab.SESSION, SheetTab.LIBRARY) else listOf(SheetTab.DISPLAY, SheetTab.CONTROLS, SheetTab.SESSION) /** A sheet tab's chip label. */ @@ -182,6 +182,8 @@ class SheetExtras( val frameGen: @Composable () -> Unit = {}, val performance: @Composable () -> Unit = {}, val drivers: @Composable (summary: String?) -> Unit = {}, + /** The Steam tab's account rows (offline mode), from the front end's own state. */ + val account: @Composable (host: MenuHost) -> Unit = {}, ) /** One tab of a mode's lifted sheet: the rows the settings page had, grouped by what they are for. */ @@ -360,6 +362,7 @@ fun ModeSheetRows(s: ModeSettings, a: ModeSettingsActions, tab: String, extras: } } if (tab == SheetTab.STEAM && steam) { + extras.account(host) SettingsGroup(stringResource(R.string.mode_decky)) { val updateAvailable = s.deckyInstalled != null && s.deckyLatestRelease != null && s.deckyInstalled != s.deckyLatestRelease.tag diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SharedMotion.kt b/app/src/main/java/com/droiddeck/launcher/ui/SharedMotion.kt index feec78ccc3..75fd066601 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SharedMotion.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SharedMotion.kt @@ -46,8 +46,8 @@ internal enum class GlideAxis { Horizontal, Vertical } /** * The selection under a row of chips: [at] (in the row) of chip [index], in [tint]. A move to the * next chip stretches it - the leading edge on the focus ring's lead spring, the trailing one a - * beat later on its trail spring - and a hop past a chip fades it out where it was and in where it - * lands (carried over as a drop, it sat on chips the pad had already left). [axis] runs it down a column instead (the rail, a stack of layers). [corner] is the + * beat later on its trail spring - and a hop past chips stretches the same way, across them. + * Draw it over the chips: under them, their own rest fill hid it in flight. [axis] runs it down a column instead (the rail, a stack of layers). [corner] is the * chips' own corner; null draws a capsule. [fill] and [outline] are the resting alphas. Not * [visible], it fades away, and comes back on whichever chip it is on by then. */ @@ -97,13 +97,9 @@ internal fun BoxScope.ChipGlide( return@LaunchedEffect } coroutineScope { - if (abs(index - from) > 1) { - // Too far to stretch: out where it is, in where it lands. - shown.animateTo(0f, Motion.tw(90)) - pinch.snapTo(0f); start.snapTo(s); end.snapTo(e) - shown.animateTo(1f, Motion.tw(160)) - } else { - // An adjacent move can interrupt a long hop while it is still faded. + run { + // Every move stretches across, however far: a long one used to go as a drop (which + // sat on chips already left) and then as a fade (a flash of no fill at all). launch { pinch.animateTo(0f, Motion.sp(0.6f, 500f)) } launch { shown.animateTo(1f, Motion.tw(120)) } val forward = index > from diff --git a/app/src/main/java/com/droiddeck/launcher/ui/SteamHome.kt b/app/src/main/java/com/droiddeck/launcher/ui/SteamHome.kt index 5b65d2202d..f6952fc65e 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/SteamHome.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/SteamHome.kt @@ -92,6 +92,16 @@ internal fun SteamHome(s: FrontEndState, a: FrontEndActions, modifier: Modifier) frameGen = { FrameGenGroup(s, a) }, performance = { PerformanceLink(a, "steam", SheetTab.SESSION) }, drivers = { summary -> DriversLink(a, summary, "steam", back) }, + // Offline mode lives with Steam's other settings; Setup only checks the account. + account = { host -> + SettingsGroup(stringResource(R.string.setup_account)) { + ToggleRow( + host, "offline", stringResource(R.string.setup_offline), + s.offlineAccount?.let { if (it.isEmpty()) stringResource(R.string.setup_signed_in_unnamed) else stringResource(R.string.setup_signed_in, it) } ?: stringResource(R.string.setup_sign_in_first), + s.offline, enabled = s.offlineAccount != null, + ) { a.onOffline() } + } + }, ) LiftHero( key = "steam", tabs = tabs, diff --git a/app/src/main/java/com/droiddeck/launcher/ui/StorePage.kt b/app/src/main/java/com/droiddeck/launcher/ui/StorePage.kt index 0143693ec3..aeb1654191 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/StorePage.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/StorePage.kt @@ -392,7 +392,6 @@ private fun FlathubChips(mode: String, modes: List, installed: Int, upda val bounds = remember { mutableStateMapOf() } val tint = rememberUpdatedState(pal.signal) Box(Modifier.fillMaxWidth()) { - ChipGlide(modes.indexOf(mode), bounds[mode], tint) Row(horizontalArrangement = Arrangement.spacedBy(8.dp), verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth()) { for (m in modes) { key(m) { @@ -431,6 +430,8 @@ private fun FlathubChips(mode: String, modes: List, installed: Int, upda } } } + // Over the chips: under them, their rest fill hid it as it crossed them. + ChipGlide(modes.indexOf(mode), bounds[mode], tint) } }