Skip to content

feat: Capacitor Haptics plugin for native haptic feedback#75

Merged
brianorwhatever merged 1 commit intomainfrom
feature/haptic-feedback
Feb 8, 2026
Merged

feat: Capacitor Haptics plugin for native haptic feedback#75
brianorwhatever merged 1 commit intomainfrom
feature/haptic-feedback

Conversation

@krusty-agent
Copy link
Copy Markdown
Collaborator

Summary

Upgrades haptic feedback from the basic Vibration API (navigator.vibrate()) to the Capacitor Haptics plugin (@capacitor/haptics) for proper native haptic engine support.

Changes

  • src/lib/haptics.ts: Replaced Vibration API with Capacitor Haptics plugin
    • ImpactStyle.Light/Medium/Heavy for impact feedback
    • NotificationType.Success/Error/Warning for notification feedback
    • selectionStart/Changed/End for selection feedback
    • Web fallback via navigator.vibrate() when not on native platform
  • src/hooks/useSettings.tsx: Added 'selection' to haptic pattern type
  • src/components/ListItem.tsx: Changed item tap from 'light' to 'selection' haptic
  • Added @capacitor/haptics dependency

Haptic patterns used across the app

Pattern Used for
light Checking/unchecking items, toggle switches, navigation
medium Adding new items, creating lists, opening modals
heavy (Available for future use)
selection Tapping list items to view details
success Successful operations (save, create, check)
error Failed operations, validation errors
warning (Available for future use)

Platform behavior

  • iOS: Uses Taptic Engine via Capacitor Haptics
  • Android: Uses native vibration via Capacitor Haptics
  • Web: Falls back to navigator.vibrate() API
  • Unsupported: Silently no-ops

Build passes ✅

- Replace navigator.vibrate() with @capacitor/haptics for native haptic engine support
- Use ImpactStyle (Light/Medium/Heavy) for touch interactions
- Use NotificationType (Success/Error/Warning) for action feedback
- Add 'selection' haptic pattern using selectionStart/Changed/End
- Use selection haptic when tapping list items to open details
- Gracefully degrade on web: falls back to navigator.vibrate()
- Silently no-ops on platforms without haptic support
@krusty-agent krusty-agent force-pushed the feature/haptic-feedback branch from 5b60742 to d8d7bcc Compare February 8, 2026 15:57
@brianorwhatever brianorwhatever merged commit cb5213d into main Feb 8, 2026
1 of 3 checks passed
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