Skip to content

Commit c6022cf

Browse files
authored
fix(details): unblock Android touch scroll (gutter scrollable was double-handling) (#652)
1 parent 07ac87a commit c6022cf

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

  • feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation

feature/details/presentation/src/commonMain/kotlin/zed/rainxch/details/presentation/DetailsRoot.kt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ package zed.rainxch.details.presentation
33
import androidx.compose.foundation.background
44
import androidx.compose.foundation.gestures.Orientation
55
import androidx.compose.foundation.gestures.scrollable
6+
import zed.rainxch.core.domain.getPlatform
7+
import zed.rainxch.core.domain.model.Platform
68
import androidx.compose.foundation.layout.Arrangement
79
import androidx.compose.foundation.layout.Box
810
import androidx.compose.foundation.layout.PaddingValues
@@ -521,12 +523,30 @@ fun DetailsScreen(
521523
}
522524
val pullEnabled = remember { isPullToRefreshSupported() }
523525

526+
// Gutter scroll forwarding is a desktop-only UX polish
527+
// (mouse-wheel-in-side-margins → scrolls content column).
528+
// On Android the outer scrollable fought the inner
529+
// LazyColumn's own scroll handler — both pointing at the
530+
// same `listState` doubled-up gesture handling and the
531+
// touch scroll froze. Issue tracked under content-width
532+
// PR follow-up. Keep enabled = isDesktop.
533+
val isDesktop = remember { getPlatform() != Platform.ANDROID }
524534
Box(
525535
modifier = Modifier
526536
.fillMaxSize()
527537
.scrollable(
528538
state = listState,
529539
orientation = Orientation.Vertical,
540+
// LazyColumn's internal scrollable uses
541+
// reverseDirection=true (vertical, default
542+
// layout direction). Matching that here makes
543+
// the wheel-direction sign convention agree
544+
// — otherwise wheel-up at the top jumps to
545+
// the bottom and vice versa, because parent
546+
// and child interpret the same pointer delta
547+
// with opposite signs.
548+
reverseDirection = true,
549+
enabled = isDesktop,
530550
)
531551
.onSizeChanged { size ->
532552
// Layout-phase write; cheaper than BoxWithConstraints

0 commit comments

Comments
 (0)