Show a Message not found placeholder when a replied to message cannot be loaded

When the replied to event could not be fetched, the reply preview rendered the
raw SDK error string in critical styling, and tapping it emitted a focus
request that could never succeed, so the user got a dead end dialog.

Render the localised error_message_not_found string in the neutral italic style
already used for redacted and undecryptable replies, and drop the click handler
for that case. The existing key is reused rather than adding a new one; a "you
do not have access" wording was rejected because this state covers any failure
to load the event, not only a permission problem.
This commit is contained in:
hayaksi1
2026-08-09 15:19:45 +03:00
parent 044737a3a7
commit 38398c24b2
3 changed files with 73 additions and 8 deletions
@@ -77,7 +77,7 @@ fun InReplyToView(
else -> ReplyToLoadingContent(modifier = modifier)
}
is InReplyToDetails.Error ->
ReplyToErrorContent(data = inReplyTo, maxLines = maxLines, modifier = modifier)
ReplyToErrorContent(maxLines = maxLines, modifier = modifier)
is InReplyToDetails.Loading ->
ReplyToLoadingContent(modifier = modifier)
}
@@ -150,7 +150,6 @@ private fun ReplyToLoadingContent(
@Composable
private fun ReplyToErrorContent(
data: InReplyToDetails.Error,
maxLines: Int,
modifier: Modifier = Modifier,
) {
@@ -161,9 +160,10 @@ private fun ReplyToErrorContent(
.padding(paddings)
) {
Text(
text = data.message,
text = stringResource(id = CommonStrings.error_message_not_found),
style = ElementTheme.typography.fontBodyMdRegular,
color = ElementTheme.colors.textCriticalPrimary,
fontStyle = FontStyle.Italic,
color = ElementTheme.colors.textSecondary,
maxLines = maxLines,
overflow = TextOverflow.Ellipsis,
)