Skip to content

Added long press to click detection#1741

Open
DavidGrath wants to merge 2 commits into
open-telemetry:mainfrom
DavidGrath:issue-1576-long-press
Open

Added long press to click detection#1741
DavidGrath wants to merge 2 commits into
open-telemetry:mainfrom
DavidGrath:issue-1576-long-press

Conversation

@DavidGrath
Copy link
Copy Markdown
Contributor

References #1576

@thompson-tomo , are these new attributes fine by you?

@DavidGrath DavidGrath requested a review from a team as a code owner May 13, 2026 19:10
@codecov
Copy link
Copy Markdown

codecov Bot commented May 13, 2026

Codecov Report

❌ Patch coverage is 87.50000% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 61.70%. Comparing base (a26eda2) to head (7d8e15b).
⚠️ Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
...trumentation/view/click/ViewClickEventGenerator.kt 87.50% 0 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1741      +/-   ##
==========================================
- Coverage   62.06%   61.70%   -0.36%     
==========================================
  Files         159      158       -1     
  Lines        3443     3429      -14     
  Branches      347      345       -2     
==========================================
- Hits         2137     2116      -21     
- Misses       1207     1214       +7     
  Partials       99       99              

☔ 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.

Comment thread instrumentation/view-click/src/test/kotlin/TestUtils.kt Outdated
Comment thread instrumentation/view-click/src/test/kotlin/TestUtils.kt Outdated
Comment thread instrumentation/view-click/src/test/kotlin/TestUtils.kt Outdated
/**
* @param clicks 0 for other event, 1 for single tap, 2 for double tap
*/
private fun createEvent(name: String, tapEvent: TapEvent, clicks: Int = 0): LogRecordBuilder {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This might be overkill, but I wonder whether it's worth creating an enum that holds TapEvent and clicks and returns the attributes that should be used for each event. IMO it could avoid logic such as if(isTapEvent) growing if we continue to add more touch events to the instrumentation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Would it be something like this?

//TapEvent renamed to TapEventMetadata
sealed class Gesture(
    val tapEventMetadata: TapEventMetadata
) {
    class LongPress(val t: TapEvent): Gesture(t)
    class Click(val t: TapEvent, clicks: Int): Gesture(t)
    class Scale(val t: TapEvent, val scaleFactor: Double): Gesture(t)
    class Scroll(val t: TapEvent, val velocityX: Double, val velocityY: Double): Gesture(t)
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yep, something along those lines. Gesture could even define val attributes: Map<String, Any> and generate the attributes that are required for each event.

Co-authored-by: Jamie Lynch <fractalwrench@gmail.com>
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.

2 participants