Skip to content

Commit 3bdbecc

Browse files
authored
Merge branch 'dev' into fix/expiring-cta-confirmed-fetch
2 parents cb59ca9 + 06310c3 commit 3bdbecc

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

app/src/main/java/org/thoughtcrime/securesms/conversation/v2/MessageDetailActivity.kt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import android.os.Bundle
88
import android.view.LayoutInflater
99
import android.view.MotionEvent.ACTION_UP
1010
import androidx.activity.viewModels
11+
import androidx.annotation.StringRes
1112
import androidx.compose.foundation.Image
1213
import androidx.compose.foundation.clickable
1314
import androidx.compose.foundation.layout.Arrangement
@@ -93,6 +94,7 @@ import org.thoughtcrime.securesms.ui.TitledText
9394
import org.thoughtcrime.securesms.ui.UserProfileModal
9495
import org.thoughtcrime.securesms.ui.components.Avatar
9596
import org.thoughtcrime.securesms.ui.components.annotatedStringResource
97+
import org.thoughtcrime.securesms.ui.qaTag
9698
import org.thoughtcrime.securesms.ui.setComposeContent
9799
import org.thoughtcrime.securesms.ui.theme.LocalColors
98100
import org.thoughtcrime.securesms.ui.theme.LocalDimensions
@@ -401,6 +403,7 @@ fun MessageProFeatures(
401403

402404
features.forEach { feature ->
403405
ProCTAFeature(
406+
modifier = Modifier.qaTag(feature.qaTagRes),
404407
textStyle = LocalType.current.large,
405408
padding = PaddingValues(),
406409
data = CTAFeature.Icon(
@@ -417,6 +420,21 @@ fun MessageProFeatures(
417420
}
418421
}
419422

423+
/**
424+
* QA tag for a feature row, so a test can assert WHICH features a message was sent with rather than
425+
* how many of them there are.
426+
*
427+
* The values are a cross-platform contract: iOS defines the same strings in
428+
* `SessionProUI.AccessibilityIdentifier` and Desktop derives them from its own feature vocabulary, so
429+
* one feature is named the same on every client and on every screen it appears on.
430+
*/
431+
private val ProFeature.qaTagRes: Int
432+
@StringRes get() = when (this) {
433+
ProProfileFeature.PRO_BADGE -> R.string.qa_pro_message_feature_badges
434+
ProMessageFeature.HIGHER_CHARACTER_LIMIT -> R.string.qa_pro_message_feature_longer_messages
435+
ProProfileFeature.ANIMATED_AVATAR -> R.string.qa_pro_message_feature_animated_display_picture
436+
}
437+
420438
@Preview
421439
@Composable
422440
fun PreviewMessageProFeatures(){

content-descriptions/src/main/res/values/strings.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,13 @@
279279
<string name="qa_pro_settings_action_faq">pro-settings-faq</string>
280280
<string name="qa_pro_settings_action_support">pro-settings-support</string>
281281

282+
<!-- Pro features a message was sent with, listed on the message details screen. The names are the
283+
subset of the Pro feature vocabulary that applies per message, so one feature is named the same
284+
wherever it appears -->
285+
<string name="qa_pro_message_feature_badges">pro-message-feature-badges</string>
286+
<string name="qa_pro_message_feature_longer_messages">pro-message-feature-longer-messages</string>
287+
<string name="qa_pro_message_feature_animated_display_picture">pro-message-feature-animated-display-picture</string>
288+
282289
<!-- Manage members and admin -->
283290
<string name="qa_manage_members_invite_contacts">invite-contacts-menu-option</string>
284291
<string name="qa_manage_members_invite_account_id">invite-accountid-menu-option</string>

0 commit comments

Comments
 (0)