From 6d24bd5d443050110185c53705b6c961bff11d5d Mon Sep 17 00:00:00 2001 From: Narasimha-sc <166327228+Narasimha-sc@users.noreply.github.com> Date: Thu, 16 Jul 2026 13:05:53 +0000 Subject: [PATCH] multiplatform: stop pointer handler resets on chat item recomposition (lost clicks, cursor flicker) bigTouchSlop() created a new ViewConfiguration instance on every recomposition of every chat item; pointer input nodes observe ViewConfiguration and reset their handler when it changes, so each inserted message killed all in-flight presses (lost command clicks) and hover handlers (hand cursor flicker) in the viewport. Provide a remembered instance instead. Co-Authored-By: Claude Fable 5 --- .../kotlin/chat/simplex/common/views/chat/ChatView.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt index c1603f2bdc..b6286fc59c 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/ChatView.kt @@ -1909,10 +1909,13 @@ fun BoxScope.ChatItemsList( reveal: (Boolean) -> Unit ) { val itemScope = rememberCoroutineScope() + val viewConfiguration = LocalViewConfiguration.current CompositionLocalProvider( // Makes horizontal and vertical scrolling to coexist nicely. - // With default touchSlop when you scroll LazyColumn, you can unintentionally open reply view - LocalViewConfiguration provides LocalViewConfiguration.current.bigTouchSlop() + // With default touchSlop when you scroll LazyColumn, you can unintentionally open reply view. + // remember: pointerInput handlers observe ViewConfiguration and reset on any change, so a new + // instance per recomposition kills in-flight presses/hover whenever a message is inserted + LocalViewConfiguration provides remember(viewConfiguration) { viewConfiguration.bigTouchSlop() } ) { val provider = { providerForGallery(reversedChatItems.value.asReversed(), cItem.id) { indexInReversed ->