From e5a6edef2796fb7cd50217292164bb5222878acf Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Thu, 22 Oct 2026 20:20:51 +0000 Subject: [PATCH] ui tests: key parameters before trailing lambdas and with defaults; review fixes --- .../kotlin/chat/simplex/common/views/chat/SendMsgView.kt | 8 ++++---- .../simplex/common/views/chatlist/ChatListNavLinkView.kt | 2 +- .../simplex/common/views/chatlist/ShareListNavLinkView.kt | 2 +- .../chat/simplex/common/views/helpers/CustomTimePicker.kt | 4 +--- .../chat/simplex/common/views/helpers/DefaultTopAppBar.kt | 2 +- .../chat/simplex/common/views/onboarding/SimpleXInfo.kt | 2 +- plans/ui-tests/2026-10-10-desktop-ui-test-dsl-plan.md | 2 ++ 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/SendMsgView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/SendMsgView.kt index b4b8a1810d..21c0f289fb 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/SendMsgView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/SendMsgView.kt @@ -278,7 +278,7 @@ expect fun VoiceButtonWithoutPermissionByPlatform() @Composable private fun CustomDisappearingMessageDialog( showMenu: MutableState, - uiKey: UiKey?, + uiKey: UiKey? = null, sendMessage: (Int?) -> Unit, customDisappearingMessageTimePref: SharedPreference? ) { @@ -320,7 +320,7 @@ private fun CustomDisappearingMessageDialog( } @Composable -private fun BoxScope.DeleteTextButton(composeState: MutableState, uiKey: UiKey?) { +private fun BoxScope.DeleteTextButton(composeState: MutableState, uiKey: UiKey? = null) { IconButton( { composeState.value = composeState.value.copy(message = ComposeMessage()) }, Modifier.ui(uiKey).align(Alignment.TopEnd).size(36.dp) @@ -465,7 +465,7 @@ private fun SendMsgButton( enabled: Boolean, sendToConnect: (() -> Unit)?, sendMessage: (Int?) -> Unit, - uiKey: UiKey?, + uiKey: UiKey? = null, onLongClick: (() -> Unit)? = null ) { val interactionSource = remember { MutableInteractionSource() } @@ -505,7 +505,7 @@ private fun SendMsgButton( } @Composable -private fun StartLiveMessageButton(uiKey: UiKey?, onClick: () -> Unit) { +private fun StartLiveMessageButton(uiKey: UiKey? = null, onClick: () -> Unit) { val interactionSource = remember { MutableInteractionSource() } val ripple = remember { ripple(bounded = false, radius = 24.dp) } Box( diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.kt index 689123ed22..528477b42b 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ChatListNavLinkView.kt @@ -543,7 +543,7 @@ fun LeaveGroupAction(rhId: Long?, groupInfo: GroupInfo, chatModel: ChatModel, sh } @Composable -fun ContactRequestMenuItems(rhId: Long?, contactRequestId: Long, chatModel: ChatModel, showMenu: MutableState, onSuccess: ((chat: Chat) -> Unit)? = null, chatId: String? = null) { +fun ContactRequestMenuItems(rhId: Long?, contactRequestId: Long, chatModel: ChatModel, showMenu: MutableState, chatId: String? = null, onSuccess: ((chat: Chat) -> Unit)? = null) { ItemAction( stringResource(MR.strings.accept_contact_button), painterResource(MR.images.ic_check), diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ShareListNavLinkView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ShareListNavLinkView.kt index 87f87f0346..de8b0c1e33 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ShareListNavLinkView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chatlist/ShareListNavLinkView.kt @@ -84,7 +84,7 @@ private fun ShareListNavLinkLayout( chatLinkPreview: @Composable () -> Unit, click: () -> Unit, stopped: Boolean, - uiKey: UiKey, + uiKey: UiKey? = null, ) { SectionItemView(padding = PaddingValues(horizontal = DEFAULT_PADDING, vertical = 8.dp), click = click, disabled = stopped, uiKey = uiKey) { chatLinkPreview() diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/CustomTimePicker.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/CustomTimePicker.kt index 2bf40fda08..71a85e67f5 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/CustomTimePicker.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/CustomTimePicker.kt @@ -68,9 +68,7 @@ fun showCustomTimePickerDialog( SectionItemView({ AlertManager.shared.hideAlert() confirmButtonAction(selection.value) - }, - uiKey = Ui.TimePicker.Confirm - ) { + }, uiKey = Ui.TimePicker.Confirm) { Text( confirmButtonText, Modifier.fillMaxWidth(), diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/DefaultTopAppBar.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/DefaultTopAppBar.kt index 51ad9c2502..dbffc4b7e0 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/DefaultTopAppBar.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/DefaultTopAppBar.kt @@ -34,8 +34,8 @@ fun DefaultAppBar( searchPlaceholder: String? = null, onSearchValueChanged: (String) -> Unit = {}, searchTrailingContent: @Composable (() -> Unit)? = null, - buttons: @Composable RowScope.() -> Unit = {}, uiKey: UiKey? = null, + buttons: @Composable RowScope.() -> Unit = {}, ) { // If I just disable clickable modifier when don't need it, it will stop passing clicks to search. Replacing the whole modifier val modifier = if (!showSearch) { diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/SimpleXInfo.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/SimpleXInfo.kt index fe4f2b4670..3ec85d5327 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/SimpleXInfo.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/onboarding/SimpleXInfo.kt @@ -251,8 +251,8 @@ fun TextButtonBelowOnboardingButton(text: String, onClick: (() -> Unit)?, icon: @Composable fun OnboardingInformationButton( text: String, - onClick: () -> Unit, uiKey: UiKey? = null, + onClick: () -> Unit, ) { Box( modifier = Modifier diff --git a/plans/ui-tests/2026-10-10-desktop-ui-test-dsl-plan.md b/plans/ui-tests/2026-10-10-desktop-ui-test-dsl-plan.md index 53934d850f..367ba52eef 100644 --- a/plans/ui-tests/2026-10-10-desktop-ui-test-dsl-plan.md +++ b/plans/ui-tests/2026-10-10-desktop-ui-test-dsl-plan.md @@ -1579,6 +1579,8 @@ Each entry gives the symptom, the cause (how it was confirmed), and the fix or m - `ChatListRowsTest.previewGroupSenderPrefix` (full Android run, 2026-10-14 21:07): after alice leaves the group chat, bob sends "#team hello all"; for 10 s the `team` row showed the unread badge "1" but kept the preview "mine" (failure screenshot). Passed in the rerun of the class. - The badge proves the row recomposed with new chat stats; the preview text comes from `chat.chatItems.lastOrNull()` (`ChatPreviewView.kt:228`). Either the new item did not reach the chat's preview list while its stats did (app-side model update), or an earlier group event incremented the counter and the message was still in transit. Not resolved; next step is to capture `chatModel.chats` for the row on failure. +- 2026-10-22: seen on desktop too, in `ChatListRowsTest.previewGroupSenderPrefix` (1 of 2 runs, after the master merge with #7072): bob's group message arrived while alice had the group open, and the row kept showing alice's earlier "mine" instead of "bob: hello all". The test passed when rerun alone. + ### 15.4.1b Open flake: received message missing from a chat opened at the same moment (desktop, 1 of 4 runs) - `ForwardTest.forward_toNotes_showsSavedFrom` (rebased run b23, 2026-10-15): bob sends "hey", alice opens bob's chat right away; the chat list row shows "hey" with unread 1, but the open chat shows no items (only the "1" unread-below counter) for 10 s. Three reruns of the class passed.