From f0a4b084d93f82688c19a1ccb4735ab41c8fa47e Mon Sep 17 00:00:00 2001 From: Tushar Gandhe <19225304+2-Shar@users.noreply.github.com> Date: Fri, 27 Nov 2026 11:50:48 +0530 Subject: [PATCH] fix(ui): LB and RB on the game page move the focus ring to the tab they select (#3203) * fix(ui): LB and RB on the game page move the focus ring to the tab they select The bumpers changed the selected tab but left focus where it was, so the ring stayed on the old tab or in the old panel. When focus is on the game page, it now moves to the newly selected tab. * fix(ui): drop a bumper's pending tab focus when another selection replaces that tab A bumper step waits a frame before focusing the tab it selected. If a tap picked a different tab in that frame, the wait still ended on the bumper's tab. The step now remembers its tab and focuses it only while that tab is still the selected one. --- .../java/com/droiddeck/launcher/ui/GameDetail.kt | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/GameDetail.kt b/app/src/main/java/com/droiddeck/launcher/ui/GameDetail.kt index 061c873670..5e47621be9 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/GameDetail.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/GameDetail.kt @@ -226,10 +226,22 @@ internal fun GameDetail( val t = tab ?: return@LaunchedEffect if (!inPage) focusWithinFrames({ onStrip }) { tabFocus.getValue(t) } } + var steppedTo by remember(key) { mutableStateOf(null) } + LaunchedEffect(steppedTo, tab) { + val t = steppedTo ?: return@LaunchedEffect + if (t != tab) { + steppedTo = null + return@LaunchedEffect + } + focusSoon { tabFocus.getValue(t) } + steppedTo = null + } fun cycle(step: Int) { if (tabs.size < 2) return val at = tabs.indexOf(tab).coerceAtLeast(0) - picked = tabs[(at + step + tabs.size) % tabs.size] + val next = tabs[(at + step + tabs.size) % tabs.size] + picked = next + if (inPage) steppedTo = next } val art: Any? = game?.hero ?: item?.imageUrl ?: installed?.sidecar?.hero ?: installed?.sidecar?.cover val artModel: Any? = if (art is String) cardArtRequest(art, item?.tallImageUrl) else art