From 81f46d4e2e44621347304998b7c49aeb72a80a17 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Fri, 16 Oct 2026 21:03:00 -0400 Subject: [PATCH] fix(messenger): centre system message text on the info glyph The glyph is centred in an 18sp box beside the first line, but Compose's default line height style trims the first line's top, so the caption sat about 3dp above the glyph. Centre the text in untrimmed 18sp line boxes, which is what iOS's ChatSystemMessageCell does with its baseline offset. Rows grow by about 3dp to match iOS. --- .../internal/screens/components/SystemMessageRow.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/components/SystemMessageRow.kt b/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/components/SystemMessageRow.kt index a386736275..6f1fc4caa1 100644 --- a/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/components/SystemMessageRow.kt +++ b/apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/components/SystemMessageRow.kt @@ -18,6 +18,7 @@ import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.semantics.semantics +import androidx.compose.ui.text.style.LineHeightStyle import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.tooling.preview.Preview import androidx.compose.ui.tooling.preview.PreviewWrapper @@ -57,7 +58,14 @@ internal fun SystemMessageRow(text: String, modifier: Modifier = Modifier) { Text( modifier = Modifier.widthIn(max = SYSTEM_TEXT_MAX_WIDTH), text = text, - style = CodeTheme.typography.caption, + // Centred in each 18sp line box, as iOS does with its baseline offset. The default + // proportional split sits the glyphs high, off the glyph's centre. + style = CodeTheme.typography.caption.copy( + lineHeightStyle = LineHeightStyle( + alignment = LineHeightStyle.Alignment.Center, + trim = LineHeightStyle.Trim.None, + ), + ), color = CodeTheme.colors.textSecondary, textAlign = TextAlign.Center, )