Audit: meaningful contentDescription for actionable icons (sweep)
Upgrades ~31 sites previously annotated `// decorative` to meaningful strings where the icon is actionable. Purely decorative leading icons retain null contentDescription per Material 3 guidance. Focus areas: - Selection indicators (CheckCircle vs RadioButtonUnchecked, check marks) - Status icons (Error, Warning, CheckCircle, ErrorOutline, CloudOff, Info) - Expand/collapse toggles (ExpandLess/ExpandMore) - Feature inclusion indicators (Check/Close in comparison tables) - Requirement indicators (password strength satisfied/not) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -155,7 +155,7 @@ fun ContractorImportSuccessDialog(
|
||||
icon = {
|
||||
Icon(
|
||||
imageVector = Icons.Default.CheckCircle,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Success",
|
||||
modifier = Modifier.size(48.dp),
|
||||
tint = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
@@ -201,7 +201,7 @@ fun ContractorImportErrorDialog(
|
||||
icon = {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Error,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Error",
|
||||
modifier = Modifier.size(48.dp),
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
|
||||
@@ -144,7 +144,7 @@ fun ResidenceImportSuccessDialog(
|
||||
icon = {
|
||||
Icon(
|
||||
imageVector = Icons.Default.CheckCircle,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Success",
|
||||
modifier = Modifier.size(48.dp),
|
||||
tint = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
@@ -190,7 +190,7 @@ fun ResidenceImportErrorDialog(
|
||||
icon = {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Error,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Error",
|
||||
modifier = Modifier.size(48.dp),
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
|
||||
@@ -22,7 +22,7 @@ fun RequirementItem(text: String, satisfied: Boolean) {
|
||||
) {
|
||||
Icon(
|
||||
if (satisfied) Icons.Default.CheckCircle else Icons.Default.Circle,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = if (satisfied) "Requirement met" else "Requirement not met",
|
||||
tint = if (satisfied) MaterialTheme.colorScheme.primary else MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.size(16.dp)
|
||||
)
|
||||
|
||||
@@ -47,7 +47,7 @@ fun StandardErrorState(
|
||||
) {
|
||||
Icon(
|
||||
imageVector = icon,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Error",
|
||||
modifier = Modifier.size(48.dp),
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
@@ -99,7 +99,7 @@ fun CompactErrorState(
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.ErrorOutline,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Error",
|
||||
tint = MaterialTheme.colorScheme.onErrorContainer
|
||||
)
|
||||
Text(
|
||||
|
||||
@@ -61,7 +61,7 @@ fun DeleteAccountDialog(
|
||||
// Warning Icon
|
||||
Icon(
|
||||
imageVector = Icons.Default.Warning,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Warning",
|
||||
tint = MaterialTheme.colorScheme.error,
|
||||
modifier = Modifier.size(48.dp)
|
||||
)
|
||||
|
||||
@@ -35,7 +35,7 @@ fun ErrorState(message: String, onRetry: () -> Unit) {
|
||||
horizontalAlignment = Alignment.CenterHorizontally,
|
||||
verticalArrangement = Arrangement.Center
|
||||
) {
|
||||
Icon(Icons.Default.Error, contentDescription = null, modifier = Modifier.size(64.dp) , tint = Color.Red) // decorative
|
||||
Icon(Icons.Default.Error, contentDescription = "Error", modifier = Modifier.size(64.dp) , tint = Color.Red)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
Text(message, style = MaterialTheme.typography.bodyLarge, color = Color.Gray)
|
||||
Spacer(modifier = Modifier.height(16.dp))
|
||||
|
||||
@@ -161,7 +161,7 @@ fun ForgotPasswordScreen(
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.CheckCircle,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Success",
|
||||
tint = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
Text(
|
||||
|
||||
@@ -296,7 +296,7 @@ fun NotificationPreferencesScreen(
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.Error,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Error",
|
||||
tint = MaterialTheme.colorScheme.error,
|
||||
)
|
||||
Text(
|
||||
|
||||
@@ -635,7 +635,7 @@ fun ProfileScreen(
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.Error,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Error",
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
Text(
|
||||
@@ -665,7 +665,7 @@ fun ProfileScreen(
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.CheckCircle,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Success",
|
||||
tint = MaterialTheme.colorScheme.onPrimaryContainer
|
||||
)
|
||||
Text(
|
||||
|
||||
@@ -149,7 +149,7 @@ fun VerifyEmailScreen(
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.Info,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Info",
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
Text(
|
||||
|
||||
@@ -196,7 +196,7 @@ fun VerifyResetCodeScreen(
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.CheckCircle,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Verified",
|
||||
tint = MaterialTheme.colorScheme.primary
|
||||
)
|
||||
Text(
|
||||
|
||||
@@ -251,7 +251,7 @@ fun OnboardingCreateAccountContent(
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.Error,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Error",
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
Text(
|
||||
|
||||
@@ -487,7 +487,7 @@ private fun SuggestionRow(
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
if (isSelected) {
|
||||
Icon(Icons.Default.Check, contentDescription = null, tint = Color.White, modifier = Modifier.size(16.dp) ) // decorative
|
||||
Icon(Icons.Default.Check, contentDescription = "Selected", tint = Color.White, modifier = Modifier.size(16.dp) )
|
||||
}
|
||||
}
|
||||
|
||||
@@ -652,7 +652,7 @@ private fun TaskCategorySection(
|
||||
|
||||
Icon(
|
||||
imageVector = if (isExpanded) Icons.Default.ExpandLess else Icons.Default.ExpandMore,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = if (isExpanded) "Collapse" else "Expand",
|
||||
tint = MaterialTheme.colorScheme.onSurfaceVariant
|
||||
)
|
||||
}
|
||||
@@ -711,7 +711,7 @@ private fun TaskTemplateRow(
|
||||
contentAlignment = Alignment.Center
|
||||
) {
|
||||
if (isSelected) {
|
||||
Icon(Icons.Default.Check, contentDescription = null, tint = Color.White, modifier = Modifier.size(16.dp) ) // decorative
|
||||
Icon(Icons.Default.Check, contentDescription = "Selected", tint = Color.White, modifier = Modifier.size(16.dp) )
|
||||
}
|
||||
}
|
||||
|
||||
@@ -772,7 +772,7 @@ private fun ErrorPane(
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.CloudOff,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Offline",
|
||||
modifier = Modifier.size(48.dp),
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
|
||||
@@ -139,7 +139,7 @@ fun OnboardingJoinResidenceContent(
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.Error,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Error",
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
Text(
|
||||
|
||||
@@ -352,7 +352,7 @@ private fun BenefitRow(benefit: SubscriptionBenefit) {
|
||||
|
||||
Icon(
|
||||
Icons.Default.Check,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Included",
|
||||
modifier = Modifier.size(20.dp),
|
||||
tint = benefit.gradientColors.first()
|
||||
)
|
||||
|
||||
@@ -146,7 +146,7 @@ fun OnboardingVerifyEmailContent(
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.Error,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Error",
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
Text(
|
||||
|
||||
@@ -166,7 +166,7 @@ fun JoinResidenceScreen(
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.Error,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Error",
|
||||
tint = MaterialTheme.colorScheme.error,
|
||||
)
|
||||
Text(
|
||||
|
||||
@@ -280,7 +280,7 @@ private fun TierCell(
|
||||
) {
|
||||
Icon(
|
||||
imageVector = if (hasFeature) Icons.Default.Check else Icons.Default.Close,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = if (hasFeature) "Included" else "Not included",
|
||||
modifier = Modifier.size(18.dp),
|
||||
tint = if (hasFeature) {
|
||||
if (emphasize) MaterialTheme.colorScheme.primary
|
||||
|
||||
@@ -173,7 +173,7 @@ fun TaskSuggestionsScreen(
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.ErrorOutline,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Error",
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
Text(
|
||||
@@ -291,7 +291,7 @@ private fun ErrorView(message: String, onRetry: () -> Unit) {
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.ErrorOutline,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Error",
|
||||
modifier = Modifier.size(48.dp),
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
|
||||
@@ -386,7 +386,7 @@ private fun TemplateCard(
|
||||
Icon(
|
||||
imageVector = if (selected) Icons.Default.CheckCircle
|
||||
else Icons.Default.RadioButtonUnchecked,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = if (selected) "Selected" else "Not selected",
|
||||
tint = if (selected) MaterialTheme.colorScheme.primary
|
||||
else MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier
|
||||
@@ -452,7 +452,7 @@ private fun LoadErrorView(
|
||||
) {
|
||||
Icon(
|
||||
imageVector = Icons.Default.ErrorOutline,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Error",
|
||||
modifier = Modifier.size(48.dp),
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
|
||||
@@ -157,7 +157,7 @@ fun UpgradeFeatureScreen(
|
||||
) {
|
||||
Icon(
|
||||
Icons.Default.Warning,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Warning",
|
||||
tint = MaterialTheme.colorScheme.error
|
||||
)
|
||||
Text(
|
||||
|
||||
@@ -453,7 +453,7 @@ private fun FeatureItem(
|
||||
|
||||
Icon(
|
||||
Icons.Default.Check,
|
||||
contentDescription = null, // decorative
|
||||
contentDescription = "Included",
|
||||
tint = MaterialTheme.colorScheme.primary,
|
||||
modifier = Modifier.size(20.dp)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user