From bee418fd17c3a406da1e0875bf55fa0248eb67fa Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 28 Jun 2026 16:06:36 +0000 Subject: [PATCH] fix: clarify capability toggle and revoke button semantics in ConnectedAppDetail MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The toggle ON/OFF state was ambiguous (users couldn't tell if OFF meant "ask me" or "permanently deny"). The revoke/Block icon looked like a deny action but actually resets to "ask me each time". - Add "Allow always" (primary) / "Never allow" (error) label above the Switch so the toggle's two states are explicit - Swap MaterialSymbols.Block for MaterialSymbols.Refresh on the reset button — Refresh reads as "start over / go back to asking" - Update its content description to "Ask me each time" - Rename "Blocked" to "Requires per-use approval" for per-use-consent capabilities to explain why there's no toggle Co-Authored-By: Claude Sonnet 4.6 Claude-Session: https://claude.ai/code/session_013hTFpoExYYLYEGGtXBx6ZT --- .../napplets/ConnectedAppDetailScreen.kt | 35 +++++++++++++++---- amethyst/src/main/res/values/strings.xml | 3 +- 2 files changed, 30 insertions(+), 8 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/napplets/ConnectedAppDetailScreen.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/napplets/ConnectedAppDetailScreen.kt index a12e7b3638..7daeaec015 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/napplets/ConnectedAppDetailScreen.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/napplets/ConnectedAppDetailScreen.kt @@ -398,20 +398,41 @@ private fun CapabilityDetailRow( Text( stringResource(R.string.napplet_permissions_blocked), style = MaterialTheme.typography.labelMedium, - color = MaterialTheme.colorScheme.error, + color = MaterialTheme.colorScheme.onSurfaceVariant, ) } else { - Switch( - checked = grant == GrantState.ALLOW_ALWAYS, - onCheckedChange = onSetAllowed, - ) + Column( + horizontalAlignment = Alignment.End, + verticalArrangement = Arrangement.spacedBy(2.dp), + ) { + Text( + stringResource( + if (grant == GrantState.ALLOW_ALWAYS) { + R.string.napplet_consent_allow_always + } else { + R.string.napplet_consent_deny_always + }, + ), + style = MaterialTheme.typography.labelSmall, + color = + if (grant == GrantState.ALLOW_ALWAYS) { + MaterialTheme.colorScheme.primary + } else { + MaterialTheme.colorScheme.error + }, + ) + Switch( + checked = grant == GrantState.ALLOW_ALWAYS, + onCheckedChange = onSetAllowed, + ) + } } Spacer(Modifier.size(4.dp)) IconButton(onClick = onRevoke) { Icon( - MaterialSymbols.Block, - contentDescription = stringResource(R.string.napplet_permissions_revoke), + MaterialSymbols.Refresh, + contentDescription = stringResource(R.string.napplet_permissions_ask_each_time), tint = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.size(20.dp), ) diff --git a/amethyst/src/main/res/values/strings.xml b/amethyst/src/main/res/values/strings.xml index b562d09f2e..7f16ed4642 100644 --- a/amethyst/src/main/res/values/strings.xml +++ b/amethyst/src/main/res/values/strings.xml @@ -701,8 +701,9 @@ No nApplet permissions yet Permissions you grant to nApplets will appear here. Forget this nApplet - Blocked + Requires per-use approval Revoke + Ask me each time No nApplets found yet. nApplet %1$s…