feat(wallet): haptic buzz on incoming signature request#259
Open
KONFeature wants to merge 2 commits into
Open
Conversation
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.
|
|
Nice, the haptic buzz on incoming signature requests makes it feel more interactive 😄 Carefully crafted by Subweave · 🧶 used ~303k LLM tokens |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a small vibration when the wallet receives a new pairing signature request, on both web and mobile.
How
@tauri-apps/plugin-haptics(tauri-plugin-hapticsv2.3.2, MIT/Apache-2.0 — same org/version line as the existingbiometric/deep-link/openerplugins). Registered in the mobile Tauri builder with thehaptics:defaultcapability.app/utils/haptics.ts):notifyHaptic()calls nativenotificationFeedback("warning")on Tauri (iOS Taptic Engine / Android vibrator), falling back tonavigator.vibrate()on web (Android Chrome; no-op on iOS Safari). The@tauri-appsimport is lazy and gated onIS_TAURIso it's tree-shaken out of the web bundle — same pattern asbiometrics.ts.useSignatureRequestHapticshook, 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."haptics"toAppErrorSourcefor error reporting.Notes
wallet-shared/ SDK) so shared/SDK consumers don't pull in the Tauri-only dependency.tauri:ios:dev/tauri:android:devrun to confirm the native plugin compiles.