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:
Serdar Ozturk
2026-05-08 14:00:32 +01:00
committed by MargeBot
parent de3be56ba9
commit b1da8c24ab
3 changed files with 29 additions and 6 deletions
@@ -45,10 +45,13 @@ class MessageBodyUiModelMapper @Inject constructor(
suspend fun toUiModel( suspend fun toUiModel(
decryptedMessageBody: DecryptedMessageBody, decryptedMessageBody: DecryptedMessageBody,
attachmentListExpandCollapseMode: AttachmentListExpandCollapseMode?, attachmentListExpandCollapseMode: AttachmentListExpandCollapseMode?,
existingMessageBodyUiModel: MessageBodyUiModel? = null existingMessageBodyUiModel: MessageBodyUiModel? = null,
forceDisableHeightRestriction: Boolean = false
): MessageBodyUiModel { ): MessageBodyUiModel {
val shouldRestrictWebViewHeight = val shouldRestrictWebViewHeight =
hasMessageBodyWebViewCrashed() && restrictMessageWebViewHeightEnabled.get() !forceDisableHeightRestriction &&
hasMessageBodyWebViewCrashed() &&
restrictMessageWebViewHeightEnabled.get()
val decryptedMessageBodyWithType = MessageBodyWithType( val decryptedMessageBodyWithType = MessageBodyWithType(
decryptedMessageBody.value, decryptedMessageBody.value,
@@ -167,7 +167,12 @@ class EntireMessageBodyViewModel @Inject constructor(
ifRight = { ifRight = {
mutableState.value = mutableState.value.copy( mutableState.value = mutableState.value.copy(
messageBodyState = MessageBodyState.Data( 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) requestPhishingLinkConfirmation = it.banners.contains(MessageBanner.PhishingAttempt)
) )
@@ -128,7 +128,12 @@ class EntireMessageBodyViewModelTest {
getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any()) getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any())
} returns decryptedMessageBody.right() } returns decryptedMessageBody.right()
coEvery { coEvery {
messageBodyUiModelMapper.toUiModel(decryptedMessageBody, null) messageBodyUiModelMapper.toUiModel(
decryptedMessageBody = decryptedMessageBody,
attachmentListExpandCollapseMode = null,
existingMessageBodyUiModel = null,
forceDisableHeightRestriction = true
)
} returns messageBodyUiModel } returns messageBodyUiModel
// When // When
@@ -224,7 +229,12 @@ class EntireMessageBodyViewModelTest {
getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any()) getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any())
} returns decryptedMessageBody.right() } returns decryptedMessageBody.right()
coEvery { coEvery {
messageBodyUiModelMapper.toUiModel(decryptedMessageBody, null) messageBodyUiModelMapper.toUiModel(
decryptedMessageBody = decryptedMessageBody,
attachmentListExpandCollapseMode = null,
existingMessageBodyUiModel = null,
forceDisableHeightRestriction = true
)
} returns messageBodyUiModel } returns messageBodyUiModel
// When // When
@@ -247,7 +257,12 @@ class EntireMessageBodyViewModelTest {
getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any()) getMessageBodyWithClickableLinks(UserIdTestData.userId, MessageId(MESSAGE_ID), any())
} returns decryptedMessageBody.right() } returns decryptedMessageBody.right()
coEvery { coEvery {
messageBodyUiModelMapper.toUiModel(decryptedMessageBody, null) messageBodyUiModelMapper.toUiModel(
decryptedMessageBody = decryptedMessageBody,
attachmentListExpandCollapseMode = null,
existingMessageBodyUiModel = null,
forceDisableHeightRestriction = true
)
} returns messageBodyUiModel } returns messageBodyUiModel
// When // When