From 1004b61159c77ef44f9af25be654047f13d50d4b Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 2 Jun 2026 08:04:21 -0400 Subject: [PATCH] fix(android): keep onPostScroll under detekt ReturnCount limit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The dismissed-latch added a third early return to onPostScroll — detekt's ReturnCount ceiling is 2 per the project rule. Fold the NestedScrollSource.UserInput guard into the existing if/else if/else chain that branches on the drag direction. Behavior is identical; the source check just becomes the first arm of the expression rather than an early bail. --- .../fabledsword/minstrel/player/ui/NowPlayingScreen.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/android/app/src/main/java/com/fabledsword/minstrel/player/ui/NowPlayingScreen.kt b/android/app/src/main/java/com/fabledsword/minstrel/player/ui/NowPlayingScreen.kt index 3ceea516..468ff0ab 100644 --- a/android/app/src/main/java/com/fabledsword/minstrel/player/ui/NowPlayingScreen.kt +++ b/android/app/src/main/java/com/fabledsword/minstrel/player/ui/NowPlayingScreen.kt @@ -205,10 +205,13 @@ private fun rememberDragDismissConnection( ): Offset { // After dismissal, eat all remaining drag so the // scrollable doesn't paint over-scroll deltas during the - // pop transition. + // pop transition. Source guard folded into the `else if` + // chain so the function stays under detekt's ReturnCount + // ceiling of 2. if (dismissed) return available - if (source != NestedScrollSource.UserInput) return Offset.Zero - return if (available.y > 0f) { + return if (source != NestedScrollSource.UserInput) { + Offset.Zero + } else if (available.y > 0f) { accumulated += available.y if (accumulated >= thresholdPx) { dismissed = true -- 2.52.0