mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-08-09 16:14:40 +00:00
fix: clarify capability toggle and revoke button semantics in ConnectedAppDetail
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013hTFpoExYYLYEGGtXBx6ZT
This commit is contained in:
+28
-7
@@ -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),
|
||||
)
|
||||
|
||||
@@ -701,8 +701,9 @@
|
||||
<string name="napplet_permissions_empty">No nApplet permissions yet</string>
|
||||
<string name="napplet_permissions_empty_subtitle">Permissions you grant to nApplets will appear here.</string>
|
||||
<string name="napplet_permissions_forget">Forget this nApplet</string>
|
||||
<string name="napplet_permissions_blocked">Blocked</string>
|
||||
<string name="napplet_permissions_blocked">Requires per-use approval</string>
|
||||
<string name="napplet_permissions_revoke">Revoke</string>
|
||||
<string name="napplet_permissions_ask_each_time">Ask me each time</string>
|
||||
<string name="napplet_none_found">No nApplets found yet.</string>
|
||||
<string name="napplet_fallback_title">nApplet %1$s…</string>
|
||||
<!-- Napplet sandbox chrome (host top bar + live action notices) -->
|
||||
|
||||
Reference in New Issue
Block a user