diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index a290d5d3d..64b51be96 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -877,6 +877,10 @@ } else { responseMessage.content += data.message.content; + if (navigator.vibrate && ($settings?.hapticFeedback ?? false)) { + navigator.vibrate(5); + } + const sentences = extractSentencesForAudio(responseMessage.content); sentences.pop(); @@ -1177,6 +1181,10 @@ } else { responseMessage.content += value; + if (navigator.vibrate && ($settings?.hapticFeedback ?? false)) { + navigator.vibrate(5); + } + const sentences = extractSentencesForAudio(responseMessage.content); sentences.pop(); diff --git a/src/lib/components/chat/Settings/Interface.svelte b/src/lib/components/chat/Settings/Interface.svelte index d5e198890..58de9be4c 100644 --- a/src/lib/components/chat/Settings/Interface.svelte +++ b/src/lib/components/chat/Settings/Interface.svelte @@ -34,6 +34,7 @@ let showEmojiInCall = false; let voiceInterruption = false; + let hapticFeedback = false; const toggleSplitLargeChunks = async () => { splitLargeChunks = !splitLargeChunks; @@ -70,6 +71,11 @@ saveSettings({ voiceInterruption: voiceInterruption }); }; + const toggleHapticFeedback = async () => { + hapticFeedback = !hapticFeedback; + saveSettings({ hapticFeedback: hapticFeedback }); + }; + const toggleUserLocation = async () => { userLocation = !userLocation; @@ -151,6 +157,8 @@ chatDirection = $settings.chatDirection ?? 'LTR'; userLocation = $settings.userLocation ?? false; + hapticFeedback = $settings.hapticFeedback ?? false; + defaultModelId = $settings?.models?.at(0) ?? ''; if ($config?.default_models) { defaultModelId = $config.default_models.split(',')[0]; @@ -438,6 +446,26 @@ +