Haptic tick on PTT press/release and on reactions (Android) #125

Closed
opened 2026-09-17 15:43:35 -04:00 by jared · 1 comment
Owner

navigator.vibrate (Android Chrome/PWA only; iOS has no web vibration API — no-op there).

Scope

  • PTT: 10 ms tick on engage, 10 ms on release (useCallHotkeys PTT paths + the on-screen PTT chip).
  • Reactions: 8 ms tick when a reaction is sent from the hover/quick bar or the emoji board.
  • Single helper utils/haptics.ts with tick(kind); guarded by 'vibrate' in navigator, prefers-reduced-motion respected (no haptics), and a Settings → General toggle "Haptic feedback" (default on) only rendered when the API exists.
`navigator.vibrate` (Android Chrome/PWA only; iOS has no web vibration API — no-op there). ### Scope - PTT: 10 ms tick on engage, 10 ms on release (`useCallHotkeys` PTT paths + the on-screen PTT chip). - Reactions: 8 ms tick when a reaction is sent from the hover/quick bar or the emoji board. - Single helper `utils/haptics.ts` with `tick(kind)`; guarded by `'vibrate' in navigator`, `prefers-reduced-motion` respected (no haptics), and a Settings → General toggle "Haptic feedback" (default on) only rendered when the API exists.
jared added this to the Features 2026-Q4 milestone 2026-09-17 15:43:35 -04:00
jared added the enhancementpriority: lowuxarea: callsarea: mobile labels 2026-09-17 15:43:35 -04:00
jared self-assigned this 2026-09-17 15:43:35 -04:00
Author
Owner

Done in 492b57c6.

utils/haptics.ts tick('ptt-on' | 'ptt-off' | 'reaction')navigator.vibrate(10 / 10 / 8 ms); no-op without the API (iOS), under prefers-reduced-motion, or when Settings → Calls → Haptic Feedback (default on, rendered only where the API exists) is off. PTT is observed once through pttActiveAtom, so the keyboard, global-hotkey and on-screen-chip paths all tick on engage and release; reactions tick at the point the reaction event is sent in the room and thread timelines (hover bar, quick bar, touch sheet and emoji board all funnel there). Unit tests for the guard logic; headless on Pixel 7 emulation with a stubbed navigator.vibrate: sending 👍 from the long-press sheet → vibrate(8).

Done in 492b57c6. `utils/haptics.ts` `tick('ptt-on' | 'ptt-off' | 'reaction')` → `navigator.vibrate(10 / 10 / 8 ms)`; no-op without the API (iOS), under `prefers-reduced-motion`, or when Settings → Calls → **Haptic Feedback** (default on, rendered only where the API exists) is off. PTT is observed once through `pttActiveAtom`, so the keyboard, global-hotkey and on-screen-chip paths all tick on engage and release; reactions tick at the point the reaction event is sent in the room and thread timelines (hover bar, quick bar, touch sheet and emoji board all funnel there). Unit tests for the guard logic; headless on Pixel 7 emulation with a stubbed `navigator.vibrate`: sending 👍 from the long-press sheet → `vibrate(8)`.
jared closed this issue 2026-09-20 15:18:27 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: LotusGuild/cinny#125