From a9f2017aa3dab296a764b83cd13d40cf90d5716d Mon Sep 17 00:00:00 2001 From: Kurt Himebauch <136133082+xXJSONDeruloXx@users.noreply.github.com> Date: Fri, 4 Dec 2026 10:25:37 -0500 Subject: [PATCH] Draw the outline of enabled secondary buttons under the agent's latest reply (#3697) * Draw the outline of enabled secondary buttons under the agent's latest reply * Count only the index fetch's own connections in DesktopLanguageIndexSourceTest --- .../droiddeck/launcher/ui/FrontEndWidgets.kt | 3 ++- .../runtime/DesktopLanguageIndexSourceTest.kt | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndWidgets.kt b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndWidgets.kt index 4245236747..adfa9eebcd 100644 --- a/app/src/main/java/com/droiddeck/launcher/ui/FrontEndWidgets.kt +++ b/app/src/main/java/com/droiddeck/launcher/ui/FrontEndWidgets.kt @@ -308,7 +308,8 @@ internal fun SecondaryButton(text: String, enabled: Boolean = true, compact: Boo Box( contentAlignment = Alignment.Center, modifier = modifier.paneItem("btn:$text").downToFirstTile().heightIn(min = if (pill) 40.dp else if (compact) 44.dp else 48.dp).graphicsLayer { scaleX = scale; scaleY = scale }.clip(shape).background(fill).glideBorder(hot, shape, pal.signal, if (pill) Color.White.copy(alpha = 0.14f) else pal.line2) - .alpha(if (enabled) 1f else 0.5f) + // The label always gets a layer of its own: sharing one with the fill and outline, they did not draw under the agent's latest reply. + .graphicsLayer { alpha = if (enabled) 1f else 0.5f } .hoverable(src).clickable(role = androidx.compose.ui.semantics.Role.Button, interactionSource = src, indication = LocalIndication.current, enabled = enabled, onClick = onClick) .controllerConfirm(enabled = enabled, onClick = onClick) .padding(horizontal = if (pill) 16.dp else if (compact) 10.dp else 16.dp, vertical = if (pill) 8.dp else if (compact) 7.dp else 11.dp), diff --git a/app/src/test/java/com/droiddeck/launcher/runtime/DesktopLanguageIndexSourceTest.kt b/app/src/test/java/com/droiddeck/launcher/runtime/DesktopLanguageIndexSourceTest.kt index 3b4b008c50..03bd7746da 100644 --- a/app/src/test/java/com/droiddeck/launcher/runtime/DesktopLanguageIndexSourceTest.kt +++ b/app/src/test/java/com/droiddeck/launcher/runtime/DesktopLanguageIndexSourceTest.kt @@ -41,7 +41,18 @@ class DesktopLanguageIndexSourceTest { context = ApplicationProvider.getApplicationContext() DownloadSource.init(context) DownloadSource.setMode(context, DownloadSource.MODE_MIRROR) + } + + // Downloads other tests leave running also go through this proxy while it is set, so it is set only around [block]. + private fun tunnelsDuring(block: () -> Unit): List { DownloadSource.setProxy(context, "127.0.0.1:${proxy.localPort}") + tunnels.clear() + try { + block() + } finally { + DownloadSource.setProxy(context, "") + } + return tunnels.toList() } @After fun tearDown() { @@ -51,12 +62,12 @@ class DesktopLanguageIndexSourceTest { } @Test fun mirrorModeWouldOtherwiseSendTheIndexThroughAMirror() { - Downloader.downloadString(base + "desktop-kde.i18n.txt") - assertTrue(tunnels.toString(), tunnels.any { host -> DownloadSource.MIRRORS.any { it.host == host } }) + val seen = tunnelsDuring { Downloader.downloadString(base + "desktop-kde.i18n.txt") } + assertTrue(seen.toString(), seen.any { host -> DownloadSource.MIRRORS.any { it.host == host } }) } @Test fun indexIsFetchedOnlyFromGithubInMirrorMode() { - assertNull(DesktopLanguage.fetchIndex(base)) - assertEquals(listOf("github.com"), tunnels.toList()) + val seen = tunnelsDuring { assertNull(DesktopLanguage.fetchIndex(base)) } + assertEquals(listOf("github.com"), seen) } }