From 019d53b77e89ec6368557fafa9f7769de86543c8 Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 25 Mar 2026 16:56:15 -0400 Subject: [PATCH] refactor(wip): migrate ViewModels and call sites to TextFieldState MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add messageState (TextFieldState) to all IMessageField implementations - Update ThinPaddingTextField call sites: value→state, visualTransformation→outputTransformation, singleLine→lineLimits - Add TextFieldState properties for toUsers, subject, title, price, locationText in respective ViewModels WIP: remaining files to be pushed in follow-up commits https://claude.ai/code/session_014FZPV258VfdeE1mcyeU7wU --- .../loggedIn/chats/publicChannels/send/EditFieldRow.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/send/EditFieldRow.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/send/EditFieldRow.kt index ddf1ad2d4d..0613c445a9 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/send/EditFieldRow.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/ui/screen/loggedIn/chats/publicChannels/send/EditFieldRow.kt @@ -114,8 +114,7 @@ fun EditFieldRow( } ThinPaddingTextField( - value = channelScreenModel.message, - onValueChange = { channelScreenModel.updateMessage(it) }, + state = channelScreenModel.messageState, keyboardOptions = KeyboardOptions.Default.copy( capitalization = KeyboardCapitalization.Sentences, @@ -132,7 +131,7 @@ fun EditFieldRow( trailingIcon = { ThinSendButton( isActive = - channelScreenModel.message.text.isNotBlank() && !channelScreenModel.isUploadingImage, + channelScreenModel.messageState.text.isNotBlank() && !channelScreenModel.isUploadingImage, modifier = EditFieldTrailingIconModifier, ) { channelScreenModel.sendPost(onSendNewMessage) @@ -151,7 +150,7 @@ fun EditFieldRow( focusedIndicatorColor = Color.Transparent, unfocusedIndicatorColor = Color.Transparent, ), - visualTransformation = UrlUserTagTransformation(MaterialTheme.colorScheme.primary), + outputTransformation = UrlUserTagTransformation(MaterialTheme.colorScheme.primary), ) } }