Skip to content

Message Details Screen: Java/XML to Kotlin/Compose migration#145

Open
m4pl wants to merge 13 commits into
GrapheneOS:mainfrom
m4pl:message-details-compose
Open

Message Details Screen: Java/XML to Kotlin/Compose migration#145
m4pl wants to merge 13 commits into
GrapheneOS:mainfrom
m4pl:message-details-compose

Conversation

@m4pl

@m4pl m4pl commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Migrated the Message Details screen from Java + XML to Kotlin + Compose. It shows the message content, recipients, delivery info, SIM details, and debug fields when available.

Screenshots

Before After
Screenshot_20260609_004742 Screenshot_20260609_004522

@m4pl m4pl marked this pull request as ready for review June 9, 2026 15:15
@m4pl m4pl requested review from RankoR and inthewaves June 9, 2026 15:15
@m4pl m4pl force-pushed the message-details-compose branch from 587c0ee to de5423d Compare June 10, 2026 10:42
Comment on lines +46 to +49
subject = when (type) {
ConversationMessageDetails.Type.MMS -> cleansedSubject
ConversationMessageDetails.Type.SMS -> null
},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The subject is mapped here but doesn't seem to be shown in UI

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The subject appears in the message preview. I'll remove it from the mapper


return ConversationMessageDetails(
type = type,
sender = message.senderNormalizedDestination?.takeIf(String::isNotBlank),

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Old code shows a placeholder R.string.hidden_sender_address:

// From: +1425xxxxxxx
final String rawSender = data.getSenderNormalizedDestination();
details.append('\n');
details.append(res.getString(R.string.from_label));
details.append(!TextUtils.isEmpty(rawSender) ? rawSender :
res.getString(R.string.hidden_sender_address));

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It feels a bit too heavy for the UI to me. I'm going to delete the rest of the string resources for other languages, but if you believe the placeholder is needed, just let me know and I'll bring it back.
image

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, then I'm good with leaving it removed then

Comment thread res/values/strings.xml
Comment on lines 534 to -559
@@ -555,8 +565,6 @@
<string name="priority_low">Low</string>
<!-- SIM identified using the slot number. e.g. SIM 1 -->
<string name="sim_slot_identifier">SIM <xliff:g id="sim_slot_number">%s</xliff:g></string>
<!-- Sender to be used if the sender address has been hidden -->
<string name="hidden_sender_address">Hidden sender address</string>

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These removed strings are still in other locale files

Comment on lines +80 to +87
val message = conversationsRepository.getConversationMessage(
conversationId = conversationId,
messageId = messageId,
)
val details = conversationsRepository.getMessageDetails(
conversationId = conversationId,
messageId = messageId,
)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: this makes two db calls loading the selected message twice

Comment on lines +128 to +146
MessageDetailsPreviewCard(
preview = content.preview,
details = details,
)

MessageDetailsMessageFields(details = details)

if (details.sentTimestamp != null || details.receivedTimestamp != null) {
MessageDetailsStatusSection(
sentTimestamp = details.sentTimestamp,
receivedTimestamp = details.receivedTimestamp,
)
}

MessageDetailsDeliveryFields(details = details)

details.debug?.let { debug ->
MessageDetailsDebugSection(debug = debug)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also it might be useful to make the text values copyable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants