Repository: thunderbird/thunderbird-android
File: core/ui/compose/designsystem/src/main/kotlin/net/thunderbird/core/ui/compose/designsystem/organism/message/MessageItem.kt (Kotlin)

Code before:
                        outline = Outline.Rectangle(
                            rect = Rect(
                                offset = Offset(x = x, y = size.height - 1.dp.toPx()),
                                size = Size(width = size.width - x, height = 1.dp.toPx()),
                            ),
                        ),
                        color = outlineVariant,
                    )
                }
            },
        color = colors.containerColor,
        contentColor = colors.contentColor,
    ) {
        Row(
            modifier = Modifier
                .padding(contentPadding)
                .height(intrinsicSize = IntrinsicSize.Min),
        ) {
            LeadingElements(selected, onLeadingClick, leading)
            Spacer(modifier = Modifier.width(MainTheme.spacings.default))
            Column(
                modifier = Modifier
                    .weight(1f)
                    .onPlaced { contentStart = it.positionInParent().x },
            ) {
                Row(
                    verticalAlignment = Alignment.CenterVertically,
                    modifier = Modifier.defaultMinSize(
                        minHeight = AccountIndicatorIcon.ACCOUNT_INDICATOR_DEFAULT_HEIGHT,
                    ),
                ) {
                    if (showAccountIndicator && accountIndicatorColor != null) {
                        AccountIndicatorIcon(accountIndicatorColor)
                    }
                    sender()
                }
                CompositionLocalProvider(LocalContentColor provides colors.subjectColor) {
                    subject()
                }
                Spacer(modifier = Modifier.height(MainTheme.spacings.half))
                PreviewText(preview = preview, maxLines = maxPreviewLines)
            }
            Spacer(modifier = Modifier.width(MainTheme.spacings.double))
            TrailingElements(
                receivedAt = receivedAt,
                action = action,
                hasAttachments = hasAttachments,
                modifier = Modifier.heightIn(min = MainTheme.sizes.large),
            )
        }
    }

Review comment (refactor):
We could create a composable function, and move this code there, to avoid the `LongMethod` warning. Name suggestion: `SubjectRow`.

Code after:
                    drawOutline(
                        outline = Outline.Rectangle(
                            rect = Rect(
                                offset = Offset(x = x, y = size.height - 1.dp.toPx()),
                                size = Size(width = size.width - x, height = 1.dp.toPx()),
                            ),
                        ),
                        color = outlineVariant,
                    )
                }
            },
        color = colors.containerColor,
        contentColor = colors.contentColor,
    ) {
        Row(
            modifier = Modifier
                .padding(contentPadding)
                .height(intrinsicSize = IntrinsicSize.Min),
        ) {
            LeadingElements(selected, onLeadingClick, leading)
            Spacer(modifier = Modifier.width(MainTheme.spacings.default))
            Column(
                modifier = Modifier
                    .weight(1f)
                    .onPlaced { contentStart = it.positionInParent().x },
            ) {
                SenderRow(showAccountIndicator, accountIndicatorColor) { sender() }
                SubjectRow(colors.subjectColor) { subject() }
                Spacer(modifier = Modifier.height(MainTheme.spacings.half))
                PreviewText(preview = preview, maxLines = maxPreviewLines)
            }
            Spacer(modifier = Modifier.width(MainTheme.spacings.double))
            TrailingElements(
                receivedAt = receivedAt,
                action = action,
                hasAttachments = hasAttachments,
                modifier = Modifier.heightIn(min = MainTheme.sizes.large),
            )
        }
    }
}

@Composable
private fun SenderRow(
    showAccountIndicator: Boolean,
    accountIndicatorColor: Color?,
    modifier: Modifier = Modifier,
    content: @Composable () -> Unit,
) {
    Row(
        verticalAlignment = Alignment.CenterVertically,