π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
ensu android: keep rive loader height fixed and clip outro
Prateek Sunal456a6434cdc9
diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatMessages.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatMessages.ktindex 588af0d147..c80eb9837f 100644--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatMessages.kt+++ b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/chat/ChatMessages.kt@@ -47,6 +47,7 @@ import androidx.compose.runtime.setValueimport androidx.compose.runtime.snapshotFlowimport androidx.compose.ui.Alignmentimport androidx.compose.ui.Modifier+import androidx.compose.ui.draw.clipToBoundsimport androidx.compose.ui.geometry.Offsetimport androidx.compose.ui.graphics.Colorimport androidx.compose.ui.hapticfeedback.HapticFeedbackType@@ -136,6 +137,9 @@ internal fun MessageList(}}+ val streamingOutroDurationMs = 520L+ val streamingCollapseDurationMs = 300+val lastMessage = messages.lastOrNull()LaunchedEffect(isGenerating, lastMessage?.id) {if (lastMessage == null) {@@ -153,7 +157,7 @@ internal fun MessageList(keepStreamingVisible = truelastStreamingParentForOutro = streamingParentId} else if (keepStreamingVisible) {- delay(1200)+ delay(streamingOutroDurationMs)keepStreamingVisible = falselastStreamingParentForOutro = null}@@ -269,8 +273,8 @@ internal fun MessageList((!isGenerating && keepStreamingVisible && lastStreamingParentForOutro == message.id),enter = fadeIn(animationSpec = tween(durationMillis = 140)) +scaleIn(initialScale = 0.94f, animationSpec = tween(durationMillis = 180)),- exit = fadeOut(animationSpec = tween(durationMillis = 180)) +- shrinkVertically(animationSpec = tween(durationMillis = 220))+ exit = fadeOut(animationSpec = tween(durationMillis = streamingCollapseDurationMs)) ++ shrinkVertically(animationSpec = tween(durationMillis = streamingCollapseDurationMs))) {Column {Spacer(modifier = Modifier.height(EnsuSpacing.sm.dp))@@ -290,8 +294,8 @@ internal fun MessageList((!isGenerating && keepStreamingVisible && lastStreamingParentForOutro == null),enter = fadeIn(animationSpec = tween(durationMillis = 140)) +scaleIn(initialScale = 0.94f, animationSpec = tween(durationMillis = 180)),- exit = fadeOut(animationSpec = tween(durationMillis = 180)) +- shrinkVertically(animationSpec = tween(durationMillis = 220))+ exit = fadeOut(animationSpec = tween(durationMillis = streamingCollapseDurationMs)) ++ shrinkVertically(animationSpec = tween(durationMillis = streamingCollapseDurationMs))) {StreamingMessageBubble(text = streamingResponse,@@ -704,13 +708,19 @@ private fun StreamingMessageBubble(modifier = Modifier.fillMaxWidth(),horizontalAlignment = Alignment.Start) {- ensuRiveAnimation(+ Box(modifier = Modifier.width(riveWidth)- .height(riveHeight),- outroTrigger = !isGenerating,- outroInputName = "outro"- )+ .height(riveHeight)+ .clipToBounds(),+ contentAlignment = Alignment.CenterStart+ ) {+ ensuRiveAnimation(+ modifier = Modifier.fillMaxSize(),+ outroTrigger = !isGenerating,+ outroInputName = "outro"+ )+ }if (renderedText.isNotBlank()) {Spacer(modifier = Modifier.height(EnsuSpacing.xs.dp))