mirror of
https://github.com/ProtonMail/android-mail.git
synced 2026-05-15 09:50:40 +00:00
Disable body height restriction in EntireMessageBody flow
- Prevent full-message screen from inheriting preview height caps, which blocks
scrolling in EntireMessageBodyScreen
- pass forceDisableHeightRestriction=true when mapping body UI model in EntireMessageBodyViewModel
- keep preview restriction behavior unchanged for conversation detail flow
ET-6187
This commit is contained in:
+5
-2
@@ -45,10 +45,13 @@ class MessageBodyUiModelMapper @Inject constructor(
|
||||
suspend fun toUiModel(
|
||||
decryptedMessageBody: DecryptedMessageBody,
|
||||
attachmentListExpandCollapseMode: AttachmentListExpandCollapseMode?,
|
||||
existingMessageBodyUiModel: MessageBodyUiModel? = null
|
||||
existingMessageBodyUiModel: MessageBodyUiModel? = null,
|
||||
forceDisableHeightRestriction: Boolean = false
|
||||
): MessageBodyUiModel {
|
||||
val shouldRestrictWebViewHeight =
|
||||
hasMessageBodyWebViewCrashed() && restrictMessageWebViewHeightEnabled.get()
|
||||
!forceDisableHeightRestriction &&
|
||||
hasMessageBodyWebViewCrashed() &&
|
||||
restrictMessageWebViewHeightEnabled.get()
|
||||
|
||||
val decryptedMessageBodyWithType = MessageBodyWithType(
|
||||
decryptedMessageBody.value,
|
||||
|
||||
+6
-1
@@ -167,7 +167,12 @@ class EntireMessageBodyViewModel @Inject constructor(
|
||||
ifRight = {
|
||||
mutableState.value = mutableState.value.copy(
|
||||
messageBodyState = MessageBodyState.Data(
|
||||
messageBodyUiModel = messageBodyUiModelMapper.toUiModel(it, null)
|
||||
messageBodyUiModel = messageBodyUiModelMapper.toUiModel(
|
||||
decryptedMessageBody = it,
|
||||
attachmentListExpandCollapseMode = null,
|
||||
existingMessageBodyUiModel = null,
|
||||
forceDisableHeightRestriction = true
|
||||
)
|
||||
),
|
||||
requestPhishingLinkConfirmation = it.banners.contains(MessageBanner.PhishingAttempt)
|
||||
)
|
||||
|
||||
+18
-3
@@ -128,7 +128,12 @@ class EntireMessageBodyViewModelTest {
|
||||
getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any())
|
||||
} returns decryptedMessageBody.right()
|
||||
coEvery {
|
||||
messageBodyUiModelMapper.toUiModel(decryptedMessageBody, null)
|
||||
messageBodyUiModelMapper.toUiModel(
|
||||
decryptedMessageBody = decryptedMessageBody,
|
||||
attachmentListExpandCollapseMode = null,
|
||||
existingMessageBodyUiModel = null,
|
||||
forceDisableHeightRestriction = true
|
||||
)
|
||||
} returns messageBodyUiModel
|
||||
|
||||
// When
|
||||
@@ -224,7 +229,12 @@ class EntireMessageBodyViewModelTest {
|
||||
getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any())
|
||||
} returns decryptedMessageBody.right()
|
||||
coEvery {
|
||||
messageBodyUiModelMapper.toUiModel(decryptedMessageBody, null)
|
||||
messageBodyUiModelMapper.toUiModel(
|
||||
decryptedMessageBody = decryptedMessageBody,
|
||||
attachmentListExpandCollapseMode = null,
|
||||
existingMessageBodyUiModel = null,
|
||||
forceDisableHeightRestriction = true
|
||||
)
|
||||
} returns messageBodyUiModel
|
||||
|
||||
// When
|
||||
@@ -247,7 +257,12 @@ class EntireMessageBodyViewModelTest {
|
||||
getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any())
|
||||
} returns decryptedMessageBody.right()
|
||||
coEvery {
|
||||
messageBodyUiModelMapper.toUiModel(decryptedMessageBody, null)
|
||||
messageBodyUiModelMapper.toUiModel(
|
||||
decryptedMessageBody = decryptedMessageBody,
|
||||
attachmentListExpandCollapseMode = null,
|
||||
existingMessageBodyUiModel = null,
|
||||
forceDisableHeightRestriction = true
|
||||
)
|
||||
} returns messageBodyUiModel
|
||||
|
||||
// When
|
||||
|
||||
Reference in New Issue
Block a user