Skip to content

Commit c0addd0

Browse files
eriedclaude
andcommitted
Typography: drop italics on hints, force bodySmall
InfoHint and HintText are the single source of truth for hint styling across Settings. Both now render in bodySmall with no italic — italics read as a separate dialect of text and made the UI feel decorative rather than informative. HintText.small kept as a no-op for source-compat; will remove the parameter entirely once all callsites are scrubbed. Also removes the lone fontStyle = FontStyle.Italic in AutomationsContent's "auto-lights suspended" notice — same rule applied. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent cd2b9a1 commit c0addd0

2 files changed

Lines changed: 17 additions & 12 deletions

File tree

app/src/main/java/com/eried/eucplanet/ui/common/InfoHint.kt

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,17 @@ import androidx.compose.material3.Text
1212
import androidx.compose.runtime.Composable
1313
import androidx.compose.ui.Alignment
1414
import androidx.compose.ui.Modifier
15-
import androidx.compose.ui.text.font.FontStyle
1615
import androidx.compose.ui.text.style.TextAlign
1716
import androidx.compose.ui.unit.dp
1817

18+
// Global hint typography:
19+
// - Always [MaterialTheme.typography.bodySmall]
20+
// - [MaterialTheme.colorScheme.onSurfaceVariant] color
21+
// - No italics — italics read as a separate dialect of text and made the UI
22+
// feel decorative rather than informative. Plain bodySmall is the rule.
23+
// - Strings end with a period (or locale equivalent — '.' / '。'). Enforced in
24+
// the strings.xml files; this composable doesn't add or strip punctuation.
25+
1926
@Composable
2027
fun InfoHint(
2128
text: String,
@@ -30,13 +37,12 @@ fun InfoHint(
3037
imageVector = Icons.Outlined.Info,
3138
contentDescription = null,
3239
tint = MaterialTheme.colorScheme.onSurfaceVariant,
33-
modifier = Modifier.size(18.dp)
40+
modifier = Modifier.size(16.dp)
3441
)
3542
Text(
3643
highlightMatches(text, LocalSettingsSearchQuery.current),
37-
style = MaterialTheme.typography.bodyMedium,
38-
color = MaterialTheme.colorScheme.onSurfaceVariant,
39-
fontStyle = FontStyle.Italic
44+
style = MaterialTheme.typography.bodySmall,
45+
color = MaterialTheme.colorScheme.onSurfaceVariant
4046
)
4147
}
4248
}
@@ -45,15 +51,16 @@ fun InfoHint(
4551
fun HintText(
4652
text: String,
4753
modifier: Modifier = Modifier,
48-
small: Boolean = false,
54+
// Kept for source-compat — previously toggled between bodyMedium and bodySmall.
55+
// Per the global hint rule we always render bodySmall now, so this flag is a no-op.
56+
@Suppress("UNUSED_PARAMETER") small: Boolean = false,
4957
textAlign: TextAlign? = null
5058
) {
5159
Text(
5260
highlightMatches(text, LocalSettingsSearchQuery.current),
5361
modifier = modifier,
54-
style = if (small) MaterialTheme.typography.bodySmall else MaterialTheme.typography.bodyMedium,
62+
style = MaterialTheme.typography.bodySmall,
5563
color = MaterialTheme.colorScheme.onSurfaceVariant,
56-
fontStyle = FontStyle.Italic,
5764
textAlign = textAlign
5865
)
5966
}

app/src/main/java/com/eried/eucplanet/ui/settings/AutomationsContent.kt

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ import androidx.compose.ui.input.pointer.pointerInput
4343
import androidx.compose.ui.res.stringResource
4444
import androidx.compose.ui.text.TextStyle
4545
import androidx.compose.ui.text.drawText
46-
import androidx.compose.ui.text.font.FontStyle
4746
import androidx.compose.ui.text.font.FontWeight
4847
import androidx.compose.ui.text.rememberTextMeasurer
4948
import androidx.compose.ui.unit.dp
@@ -110,9 +109,8 @@ fun AutomationsContent(
110109
)
111110
Text(
112111
stringResource(R.string.auto_lights_suspended),
113-
style = MaterialTheme.typography.bodyMedium,
114-
color = AccentOrange,
115-
fontStyle = FontStyle.Italic
112+
style = MaterialTheme.typography.bodySmall,
113+
color = AccentOrange
116114
)
117115
}
118116
}

0 commit comments

Comments
 (0)