From 11f5768e3b48c9a110fa916114cd063fd25ad561 Mon Sep 17 00:00:00 2001 From: Brandon McAnsh Date: Thu, 18 Jun 2026 13:17:48 -0400 Subject: [PATCH] chore(direct-send): remove phone number subtitle for contacts "on flipcash" Also fix autosize constraint for cash bubble amount Signed-off-by: Brandon McAnsh --- .../internal/screens/ContactListScreen.kt | 27 +++++++++++-------- .../internal/SendFlowViewModelStateTest.kt | 8 +++--- .../flipcash/shared/chat/ui/MessageBubble.kt | 5 +++- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/apps/flipcash/features/direct-send/src/main/kotlin/com/flipcash/app/directsend/internal/screens/ContactListScreen.kt b/apps/flipcash/features/direct-send/src/main/kotlin/com/flipcash/app/directsend/internal/screens/ContactListScreen.kt index c34af70ab..f2e78bf36 100644 --- a/apps/flipcash/features/direct-send/src/main/kotlin/com/flipcash/app/directsend/internal/screens/ContactListScreen.kt +++ b/apps/flipcash/features/direct-send/src/main/kotlin/com/flipcash/app/directsend/internal/screens/ContactListScreen.kt @@ -202,6 +202,7 @@ private fun ContactList( ) .then(modifier), state = listState, + contentPadding = PaddingValues(bottom = CodeTheme.dimens.grid.x3), ) { itemsIndexed( items = items, @@ -437,17 +438,21 @@ private fun ContactRowItem( } } - Text( - text = if (isOnFlipcash && !lastMessagePreview.isNullOrEmpty()) { - lastMessagePreview - } else { - contact.displayNumber.ifEmpty { contact.e164 } - }, - style = CodeTheme.typography.textSmall, - color = CodeTheme.colors.textSecondary, - maxLines = 1, - overflow = androidx.compose.ui.text.style.TextOverflow.Ellipsis, - ) + val showSubtitle = lastMessagePreview != null || !isOnFlipcash + + if (showSubtitle) { + Text( + text = if (isOnFlipcash && !lastMessagePreview.isNullOrEmpty()) { + lastMessagePreview + } else { + contact.displayNumber.ifEmpty { contact.e164 } + }, + style = CodeTheme.typography.textSmall, + color = CodeTheme.colors.textSecondary, + maxLines = 1, + overflow = androidx.compose.ui.text.style.TextOverflow.Ellipsis, + ) + } } if (isOnFlipcash) { diff --git a/apps/flipcash/features/direct-send/src/test/kotlin/com/flipcash/app/directsend/internal/SendFlowViewModelStateTest.kt b/apps/flipcash/features/direct-send/src/test/kotlin/com/flipcash/app/directsend/internal/SendFlowViewModelStateTest.kt index 9b7e76470..a01424506 100644 --- a/apps/flipcash/features/direct-send/src/test/kotlin/com/flipcash/app/directsend/internal/SendFlowViewModelStateTest.kt +++ b/apps/flipcash/features/direct-send/src/test/kotlin/com/flipcash/app/directsend/internal/SendFlowViewModelStateTest.kt @@ -25,9 +25,9 @@ class SendFlowViewModelStateTest { @Test fun `OnStepChanged to PhoneGate updates currentStep`() { val updated = reduce( - SendFlowViewModel.Event.OnStepChanged(SendStep.Intro) + SendFlowViewModel.Event.OnStepChanged(SendStep.PhoneGate) )(SendFlowViewModel.State()) - assertEquals(SendStep.Intro, updated.currentStep) + assertEquals(SendStep.PhoneGate, updated.currentStep) } @Test @@ -40,7 +40,7 @@ class SendFlowViewModelStateTest { @Test fun `OnStepChanged replaces previous step`() { - val state = SendFlowViewModel.State(currentStep = SendStep.Intro) + val state = SendFlowViewModel.State(currentStep = SendStep.PhoneGate) val updated = reduce( SendFlowViewModel.Event.OnStepChanged(SendStep.ContactList) )(state) @@ -50,7 +50,7 @@ class SendFlowViewModelStateTest { @Test fun `OnStepChanged does not affect other state`() { val state = SendFlowViewModel.State( - steps = listOf(SendStep.Intro, SendStep.ContactList), + steps = listOf(SendStep.PhoneGate, SendStep.ContactList), isPickerMode = true, ) val updated = reduce( diff --git a/apps/flipcash/shared/chat-ui/src/main/kotlin/com/flipcash/shared/chat/ui/MessageBubble.kt b/apps/flipcash/shared/chat-ui/src/main/kotlin/com/flipcash/shared/chat/ui/MessageBubble.kt index cb63a1930..73a63f4fe 100644 --- a/apps/flipcash/shared/chat-ui/src/main/kotlin/com/flipcash/shared/chat/ui/MessageBubble.kt +++ b/apps/flipcash/shared/chat-ui/src/main/kotlin/com/flipcash/shared/chat/ui/MessageBubble.kt @@ -193,7 +193,10 @@ private fun CashBubble( text = text, style = CodeTheme.typography.displayMedium, color = CodeTheme.colors.textMain, - autoSize = TextAutoSize.StepBased(minFontSize = 20.sp), + autoSize = TextAutoSize.StepBased( + minFontSize = 20.sp, + maxFontSize = CodeTheme.typography.displayMedium.fontSize + ), maxLines = 1, ) }