Skip to content

fix(reactions): Prevent accidental reaction toggle when long pressing#2368

Merged
Ivansss merged 1 commit intonextcloud:mainfrom
luflow:fix/reactions-accidental-tap
Feb 6, 2026
Merged

fix(reactions): Prevent accidental reaction toggle when long pressing#2368
Ivansss merged 1 commit intonextcloud:mainfrom
luflow:fix/reactions-accidental-tap

Conversation

@luflow
Copy link
Copy Markdown
Contributor

@luflow luflow commented Jan 26, 2026

Summary

  • Fixes accidental reaction toggles when users long press on a reaction to view "who reacted"
  • Tracks touch duration to differentiate quick taps from long press attempts
  • Only triggers reaction toggle for taps ≤ 0.25 seconds

Problem

When long pressing on a reaction bubble to see "who reacted", users would sometimes accidentally toggle the reaction (add/remove it) if they released their finger before the context menu threshold (~0.5s) was reached.

Root Cause

The ReactionsView (UICollectionView) handles taps via didSelectItemAt independently of the table view's context menu system. When a long press didn't quite reach the context menu threshold, the touch was interpreted as a tap, triggering an unwanted reaction toggle.

Solution

Track the touch duration in ReactionsView:

  • touchesBegan records the start time
  • touchesCancelled clears it
  • didSelectItemAt checks the duration:
    • ≤ 0.25s → Quick tap → Toggle reaction ✓
    • > 0.25s → Long press attempt → Ignore (context menu handles it)

This threshold (0.25s) provides a buffer below the context menu's ~0.5s threshold while still allowing normal quick taps to work.

Test plan

  • Quick tap on a reaction toggles it (adds/removes your reaction)
  • Long press on a reaction shows "who reacted" summary
  • Releasing a long press early (before context menu appears) does NOT accidentally toggle the reaction
  • Scrolling away from a reaction does not trigger any action

@luflow luflow force-pushed the fix/reactions-accidental-tap branch 2 times, most recently from 22b4eb0 to ff1fecf Compare January 30, 2026 23:34
When users long press on a reaction to see "who reacted", they would
sometimes accidentally toggle the reaction if they released their finger
before the context menu threshold (~0.5s) was reached.

The issue was that the ReactionsView (UICollectionView) handles taps via
didSelectItemAt independently of the table view's context menu system.
When a long press didn't reach the context menu threshold, the touch was
interpreted as a tap, triggering an unwanted reaction toggle.

This fix tracks touch duration and only triggers reaction toggle for
quick taps (≤ 0.25s). Longer touches are ignored since they indicate
the user intended to long press to view the reactions summary.

Signed-off-by: Florian Ludwig <florian.ludwig@uninow.de>
@luflow luflow force-pushed the fix/reactions-accidental-tap branch from ff1fecf to bcea537 Compare February 4, 2026 19:45
@Ivansss
Copy link
Copy Markdown
Member

Ivansss commented Feb 5, 2026

Hi @luflow :) Thank you for this PR!
Even though I experienced this issue in the past, I'm no longer able to reproduce it on a physical iOS device (iOS 26.2.1). Are you able to reproduce the issue reliably? Are you using a physical device or a simulator, and which iOS version are you testing with?

Copy link
Copy Markdown
Collaborator

@SystemKeeper SystemKeeper left a comment

Choose a reason for hiding this comment

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

Thank you :)

@Ivansss Ivansss merged commit 0a2523a into nextcloud:main Feb 6, 2026
10 checks passed
@github-actions
Copy link
Copy Markdown

Hello there,
Thank you so much for taking the time and effort to create a pull request to our Nextcloud project.

We hope that the review process is going smooth and is helpful for you. We want to ensure your pull request is reviewed to your satisfaction. If you have a moment, our community management team would very much appreciate your feedback on your experience with this PR review process.

Your feedback is valuable to us as we continuously strive to improve our community developer experience. Please take a moment to complete our short survey by clicking on the following link: https://cloud.nextcloud.com/apps/forms/s/i9Ago4EQRZ7TWxjfmeEpPkf6

Thank you for contributing to Nextcloud and we hope to hear from you soon!

(If you believe you should not receive this message, you can add yourself to the blocklist.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants