Skip to content

feat(wallet): haptic buzz on incoming signature request#259

Open
KONFeature wants to merge 2 commits into
devfrom
feat/haptics
Open

feat(wallet): haptic buzz on incoming signature request#259
KONFeature wants to merge 2 commits into
devfrom
feat/haptics

Conversation

@KONFeature

Copy link
Copy Markdown
Contributor

What

Adds a small vibration when the wallet receives a new pairing signature request, on both web and mobile.

How

  • Plugin: adds the official @tauri-apps/plugin-haptics (tauri-plugin-haptics v2.3.2, MIT/Apache-2.0 — same org/version line as the existing biometric/deep-link/opener plugins). Registered in the mobile Tauri builder with the haptics:default capability.
  • Helper (app/utils/haptics.ts): notifyHaptic() calls native notificationFeedback("warning") on Tauri (iOS Taptic Engine / Android vibrator), falling back to navigator.vibrate() on web (Android Chrome; no-op on iOS Safari). The @tauri-apps import is lazy and gated on IS_TAURI so it's tree-shaken out of the web bundle — same pattern as biometrics.ts.
  • Trigger (useSignatureRequestHaptics hook, mounted once at the app root): subscribes directly to the target pairing client store and buzzes on newly-added signature IDs. Single source of truth, fires exactly once per arrival regardless of mounted UI. Requests already pending when the subscription attaches are seeded as known and don't buzz.
  • Adds "haptics" to AppErrorSource for error reporting.

Notes

  • Haptics stays in the wallet package (not wallet-shared / SDK) so shared/SDK consumers don't pull in the Tauri-only dependency.
  • Typecheck + lint pass. Not verified against a full mobile build — worth a tauri:ios:dev / tauri:android:dev run to confirm the native plugin compiles.

Add a small vibration when the wallet receives a new pairing signature
request, on both web and mobile.

- Add official @tauri-apps/plugin-haptics (mobile: iOS Taptic Engine /
  Android vibrator), registered in the mobile Tauri builder with the
  haptics:default capability.
- New app/utils/haptics.ts helper: native notificationFeedback on Tauri,
  navigator.vibrate fallback on web; lazy import gated on IS_TAURI so the
  dep is tree-shaken from the web bundle.
- Fire notifyHaptic from TargetSignatureModal, only for genuinely new
  request IDs (skips pre-existing pending requests on mount).
- Add "haptics" to AppErrorSource for error reporting.
Move the haptic trigger out of TargetSignatureModal (component refs) into a
useSignatureRequestHaptics hook that subscribes directly to the target
pairing client store and buzzes on newly-added signature IDs.

Fires exactly once per arrival regardless of mounted UI, keeps haptics in
the wallet package (not wallet-shared / SDK), and restores the modal to its
original render-only logic. Requests already pending when the subscription
attaches are seeded as known and don't buzz.
@changeset-bot

changeset-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 564b389

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@subweave

subweave Bot commented Jul 6, 2026

Copy link
Copy Markdown

Nice, the haptic buzz on incoming signature requests makes it feel more interactive 😄
Explore here →

Subweave map of frak-id/wallet#259

Carefully crafted by Subweave · 🧶 used ~303k LLM tokens

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