Skip to content

Disable mutliple click (parallel or serial) on a room #4683

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 13, 2025

Conversation

bmarty
Copy link
Member

@bmarty bmarty commented May 6, 2025

Content

Add minimum delay between two click handling on the room list.
Protect:

  • opening the setting
  • opening a room
  • opening the create room screen

Motivation and context

Fixes #4619

Screenshots / GIFs

Tests

  • Open the room list
  • Tap on several rooms simultaneously
  • Observe that only one room is opened by going back to the room list
  • Quickly tap on a room
  • Observe that only one room is opened by going back to the room list
  • Tap on a room and on the user avatar icon
  • Observe that the settings screen is opened or the room is opened but not both by going back to the room list
  • Tap on a room and on the floating action button to create a room
  • Observe that the settings to create a room is opened or the room is opened but not both by going back to the room list

Tested devices

  • Physical
  • Emulator
  • OS version(s):

Checklist

  • Changes have been tested on an Android device or Android emulator with API 24
  • UI change has been tested on both light and dark themes
  • Accessibility has been taken into account. See https://github.com/element-hq/element-x-android/blob/develop/CONTRIBUTING.md#accessibility
  • Pull request is based on the develop branch
  • Pull request title will be used in the release note, it clearly define what will change for the user
  • Pull request includes screenshots or videos if containing UI changes
  • You've made a self review of your PR

@bmarty bmarty requested a review from a team as a code owner May 6, 2025 14:38
@bmarty bmarty requested review from ganfra and removed request for a team May 6, 2025 14:38
@bmarty bmarty added the PR-Bugfix For bug fix label May 6, 2025
Copy link
Contributor

github-actions bot commented May 6, 2025

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/Qp67yw

Copy link

codecov bot commented May 6, 2025

Codecov Report

Attention: Patch coverage is 78.57143% with 3 lines in your changes missing coverage. Please review.

Project coverage is 80.13%. Comparing base (31e5ae0) to head (019bad7).
Report is 37 commits behind head on develop.

Files with missing lines Patch % Lines
...ent/android/features/roomlist/impl/RoomListView.kt 50.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #4683      +/-   ##
===========================================
+ Coverage    80.11%   80.13%   +0.01%     
===========================================
  Files         2126     2126              
  Lines        56270    56269       -1     
  Branches      7014     7017       +3     
===========================================
+ Hits         45081    45089       +8     
+ Misses        8778     8768      -10     
- Partials      2411     2412       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

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

Maybe this should be handled directly in the compose layer? Would be simpler to handle this with a custom Modifier so it can easily be reused (and tested?)

@@ -38,4 +38,8 @@ class FirstThrottler(private val minimumInterval: Long = 800) {
// Too early
return CanHandleResult.No(minimumInterval - delaySinceLast)
}

fun canHandleAsBoolean(): Boolean {
Copy link
Member

Choose a reason for hiding this comment

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

I'd call this canHandle and the other one could be getResult?

Copy link
Member Author

Choose a reason for hiding this comment

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

I have rewritten this class.

@bmarty bmarty requested a review from ganfra May 12, 2025 16:22
Copy link

Copy link
Member

@ganfra ganfra left a comment

Choose a reason for hiding this comment

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

Would be handy to create a reusable Modifier so we can use this everywhere more easily, but we can do later I guess.

@bmarty bmarty merged commit f6cbca4 into develop May 13, 2025
30 of 31 checks passed
@bmarty bmarty deleted the feature/bma/fixMutlipleRoomsOpening branch May 13, 2025 12:12
@bmarty
Copy link
Member Author

bmarty commented May 13, 2025

Would be handy to create a reusable Modifier so we can use this everywhere more easily, but we can do later I guess.

I have thought about it, but I am not sure how to implement this, as the FirstThrottle is shared between several click handlers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-Bugfix For bug fix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It's possible to open a room view twice by tapping it super quickly
2 participants