From f04a67022733369b5338a2de906b88d715a1685b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jaroslav=20Bene=C5=A1?= Date: Wed, 18 Nov 2026 01:25:24 +0000 Subject: [PATCH] The sheet's follower asks whether a scroll is under way, it does not watch it Watching it made every scroll to the end start the next one: our own scroll is a scroll too. CI run 100 hung in the screenshot tests on it. Co-Authored-By: Claude Fable 5.2 --- .../main/java/eu/llembas/android/assist/AssistSheet.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/llembas/android/assist/AssistSheet.kt b/app/src/main/java/eu/llembas/android/assist/AssistSheet.kt index d3c76eb..502cff5 100644 --- a/app/src/main/java/eu/llembas/android/assist/AssistSheet.kt +++ b/app/src/main/java/eu/llembas/android/assist/AssistSheet.kt @@ -242,9 +242,11 @@ fun ColumnScope.AssistSheetContent( // it is not known yet. LaunchedEffect(scroll) { // Never against a finger: nothing is moved while a scroll is under way, and one of - // ours that a finger interrupts does not end this follower (`yielding`). - snapshotFlow { if (following && !scroll.isScrollInProgress) scroll.maxValue else -1 } - .collect { end -> if (end in 0 until Int.MAX_VALUE) yielding { scroll.scrollTo(end) } } + // ours that a finger interrupts does not end this follower (`yielding`). Whether a + // scroll is under way is asked here and not watched: our own scroll is one too, and + // watching it would have each scroll to the end start the next. + snapshotFlow { if (following) scroll.maxValue else -1 } + .collect { end -> if (end in 0 until Int.MAX_VALUE && !scroll.isScrollInProgress) yielding { scroll.scrollTo(end) } } } // The top: the handle and the bar. Both drag the sheet.