Skip to content

Conversation

@andremion
Copy link
Contributor

@andremion andremion commented Oct 3, 2025

🎯 Goal

Improve SwipeToReply component in scroller containers by only handling gesture events if the horizontal scrolling dominates the vertical scrolling

🎨 UI Changes

Before After
Screen_recording_20251003_142616.webm
Screen_recording_20251003_141621.webm

🧪 Testing

  • Enter a channel with messages and scroll vertically up and down, and see how sensitive the reply action is during the vertical scrolling

@andremion andremion added the compose Jetpack Compose label Oct 3, 2025
@andremion andremion force-pushed the AND-787-improve-the-swipetoreply-component branch 2 times, most recently from 2281e0a to bafe9ff Compare October 3, 2025 13:32
@github-actions
Copy link
Contributor

github-actions bot commented Oct 3, 2025

SDK Size Comparison 📏

SDK Before After Difference Status
stream-chat-android-client 3.23 MB 3.23 MB 0.00 MB 🟢
stream-chat-android-offline 3.45 MB 3.45 MB 0.00 MB 🟢
stream-chat-android-ui-components 10.54 MB 10.54 MB 0.00 MB 🟢
stream-chat-android-compose 12.75 MB 12.75 MB 0.00 MB 🟢

@andremion andremion marked this pull request as ready for review October 3, 2025 13:43
@andremion andremion requested a review from a team as a code owner October 3, 2025 13:43
…g gesture events if the horizontal scrolling dominates the vertical scrolling
@andremion andremion force-pushed the AND-787-improve-the-swipetoreply-component branch from 6dd4268 to b0b0a05 Compare October 6, 2025 12:55
Copy link
Contributor

@VelikovPetar VelikovPetar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!
Just for my understanding, is it not possible to disable the SwipeToReply action if there is a vertical scroll active? (I am not suggesting it as a better solution, just as an idea).

@andremion
Copy link
Contributor Author

andremion commented Oct 6, 2025

Looks good! Just for my understanding, is it not possible to disable the SwipeToReply action if there is a vertical scroll active? (I am not suggesting it as a better solution, just as an idea).

Sorry, can you elaborate if there is a vertical scroll active?

@VelikovPetar
Copy link
Contributor

Looks good! Just for my understanding, is it not possible to disable the SwipeToReply action if there is a vertical scroll active? (I am not suggesting it as a better solution, just as an idea).

Sorry, can you elaborate if there is a vertical scroll active?

I was thinking something like:

val lazyListState = rememberLazyListState()
val swipeEnabled = !lazyListState.isScrollInProgress

But on a closer inspection, we cannot really easily access the the list state here unfortunately.

@andremion
Copy link
Contributor Author

Looks good! Just for my understanding, is it not possible to disable the SwipeToReply action if there is a vertical scroll active? (I am not suggesting it as a better solution, just as an idea).

Sorry, can you elaborate if there is a vertical scroll active?

I was thinking something like:

val lazyListState = rememberLazyListState()
val swipeEnabled = !lazyListState.isScrollInProgress

But on a closer inspection, we cannot really easily access the the list state here unfortunately.

Yes.
It would introduce a strong dependency on an upper state of the hierarchy.
The provided approach seems more flexible as it can be useful for any application, not only related to the scrolling of a list.

@VelikovPetar VelikovPetar enabled auto-merge (squash) October 7, 2025 10:43
@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 7, 2025

Quality Gate Failed Quality Gate failed

Failed conditions
42.9% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@VelikovPetar VelikovPetar merged commit b9761af into develop Oct 7, 2025
16 of 18 checks passed
@VelikovPetar VelikovPetar deleted the AND-787-improve-the-swipetoreply-component branch October 7, 2025 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compose Jetpack Compose

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants