Skip to content

Conversation

@luflow
Copy link
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 from 452040b to 22b4eb0 Compare January 26, 2026 22:31
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 <[email protected]>
@luflow luflow force-pushed the fix/reactions-accidental-tap branch from 22b4eb0 to ff1fecf Compare January 30, 2026 23:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant