Skip to content

[web] Support haptic feedback#3045

Merged
Schahen merged 5 commits into
jb-mainfrom
ok/web_haptic_feedback
May 13, 2026
Merged

[web] Support haptic feedback#3045
Schahen merged 5 commits into
jb-mainfrom
ok/web_haptic_feedback

Conversation

@Schahen
Copy link
Copy Markdown

@Schahen Schahen commented May 13, 2026

Introduce support for haptic feedback on web
https://youtrack.jetbrains.com/issue/CMP-7656/Web.-Support-Haptic-Feedback

This PR is heavily based on (and exists as a continuation of the same branch) of #3040

Solution:

  • Since there is no high-level haptic browser API right now, the solution relies on the Vibration API with hardcoded patterns.
  • In the future, we'll consider migrating to the high-level API once it's implemented - https://github.com/WICG/web-haptics

Supported browsers:

Testing

  • added a simple smoke test
  • This should be tested by QA

Release Notes

Features - Web

  • Support haptic feedback on web targets

@Schahen Schahen requested a review from eymar May 13, 2026 11:30
Comment thread .idea/vcs.xml Outdated
</component>
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/jbdeps/android-sdk/darwin/build-tools/30.0.3" vcs="Git" />
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.

Unrelated changes?

} No newline at end of file
}

private fun isVibrationSupported(): Boolean = js(
Copy link
Copy Markdown
Member

@eymar eymar May 13, 2026

Choose a reason for hiding this comment

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

Since this is a feature specific check, to avoid the growth of this file, can this feature detection move to WebHapticFeedback companion?

I guess WebHapticFeedback can have a factory method something like webHapticFeedbackOrDefault().

WDYT?

@Schahen Schahen force-pushed the ok/web_haptic_feedback branch from e1a1f91 to 3e2e9ef Compare May 13, 2026 15:38
@Schahen Schahen merged commit 92f0eb3 into jb-main May 13, 2026
16 checks passed
@Schahen Schahen deleted the ok/web_haptic_feedback branch May 13, 2026 16:13
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