π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
fix dots indicator diagnostics
Prateek Sunal7a45dd459844
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 e22c0ae722..8712d41ca6 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@@ -27,6 +27,7 @@ import androidx.compose.foundation.layout.paddingimport androidx.compose.foundation.layout.offsetimport androidx.compose.foundation.layout.sizeimport androidx.compose.foundation.layout.width+import androidx.compose.foundation.layout.widthInimport androidx.compose.foundation.layout.wrapContentSizeimport androidx.compose.foundation.lazy.LazyColumnimport androidx.compose.foundation.lazy.items@@ -60,7 +61,6 @@ import androidx.compose.ui.unit.dpimport androidx.compose.ui.window.Popupimport androidx.compose.ui.window.PopupPropertiesimport io.ente.ensu.components.BranchSwitcher-import io.ente.ensu.components.GeneratingDotsIndicatorimport io.ente.ensu.designsystem.EnsuColorimport io.ente.ensu.designsystem.EnsuCornerRadiusimport io.ente.ensu.designsystem.EnsuSpacing@@ -719,10 +719,29 @@ private fun StreamingMessageBubble(MarkdownView(markdown = renderedText, enableSelection = false, trailingCursor = showCursor)}- GeneratingDotsIndicator(alignment = Alignment.CenterStart)+ generatingDotsIndicator()}}+@Composable+private fun generatingDotsIndicator() {+ var dotCount by remember { mutableStateOf(1) }++ LaunchedEffect(Unit) {+ while (true) {+ delay(420)+ dotCount = if (dotCount == 3) 1 else dotCount + 1+ }+ }++ Text(+ text = ".".repeat(dotCount),+ style = EnsuTypography.message,+ color = EnsuColor.textMuted(),+ modifier = Modifier.widthIn(min = 24.dp)+ )+}+@Composableprivate fun TimestampText(timestampMillis: Long) {Text(diff --git a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/components/GeneratingDotsIndicator.kt b/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/components/GeneratingDotsIndicator.ktdeleted file mode 100644index 5a480bcacb..0000000000--- a/mobile/native/android/apps/ensu/app-ui/src/main/java/io/ente/ensu/components/GeneratingDotsIndicator.kt+++ /dev/null@@ -1,55 +0,0 @@-@file:Suppress("PackageDirectoryMismatch")--package io.ente.ensu.components--import androidx.compose.foundation.layout.Box-import androidx.compose.foundation.layout.widthIn-import androidx.compose.material3.Text-import androidx.compose.runtime.Composable-import androidx.compose.runtime.LaunchedEffect-import androidx.compose.runtime.getValue-import androidx.compose.runtime.mutableIntStateOf-import androidx.compose.runtime.remember-import androidx.compose.runtime.setValue-import androidx.compose.ui.Alignment-import androidx.compose.ui.Modifier-import androidx.compose.ui.graphics.Color-import androidx.compose.ui.text.TextStyle-import androidx.compose.ui.text.font.FontFamily-import androidx.compose.ui.unit.dp-import io.ente.ensu.designsystem.EnsuColor-import io.ente.ensu.designsystem.EnsuTypography-import kotlinx.coroutines.delay--@Composable-fun GeneratingDotsIndicator(- modifier: Modifier = Modifier,- isAnimating: Boolean = true,- alignment: Alignment = Alignment.Center,- textStyle: TextStyle = EnsuTypography.message,- color: Color = EnsuColor.textMuted()-) {- var dotCount by remember { mutableIntStateOf(1) }-- LaunchedEffect(isAnimating) {- if (!isAnimating) {- dotCount = 1- return@LaunchedEffect- }-- while (true) {- delay(420)- dotCount = if (dotCount == 3) 1 else dotCount + 1- }- }-- Box(modifier = modifier, contentAlignment = alignment) {- Text(- text = ".".repeat(dotCount),- style = textStyle,- color = color,- fontFamily = FontFamily.Monospace,- modifier = Modifier.widthIn(min = 24.dp)- )- }-}