Skip to content

The agent that grows with you

feat(desktop): add Settings toggle for vibe hearts

Adolanium93acc22a9f29
diff --git a/apps/desktop/src/app/settings/appearance-settings.tsx b/apps/desktop/src/app/settings/appearance-settings.tsx
index bd31f043fdc..238978fb9b5 100644
--- a/apps/desktop/src/app/settings/appearance-settings.tsx
+++ b/apps/desktop/src/app/settings/appearance-settings.tsx
@@ -44,6 +44,7 @@ import {
TRANSLUCENCY_STEP,
TRANSLUCENCY_SUPPORTED
} from '@/store/translucency'
+import { $vibeHeartsEnabled, setVibeHeartsEnabled } from '@/store/vibe-hearts-enabled'
import { $zoomPercent, setZoomPercent } from '@/store/zoom'
import { getBaseColors, useTheme } from '@/themes/context'
import { installVscodeThemeFromMarketplace } from '@/themes/install'
@@ -354,6 +355,7 @@ export function AppearanceSettings() {
const translucency = useStore($translucency)
const glassMode = translucency.mode === 'glass' && GLASS_SUPPORTED
const reactionsEnabled = useStore($reactionsEnabled)
+ const vibeHeartsEnabled = useStore($vibeHeartsEnabled)
const backdrop = useStore($backdrop)
const introSplash = useStore($introSplash)
const installs = useStore($marketplaceInstalls)
@@ -753,6 +755,24 @@ export function AppearanceSettings() {
title={a.reactionsTitle}
/>
+ <ListRow
+ action={
+ <SegmentedControl
+ onChange={id => {
+ triggerHaptic('selection')
+ setVibeHeartsEnabled(id === 'on')
+ }}
+ options={[
+ { id: 'off', label: t.common.off },
+ { id: 'on', label: t.common.on }
+ ]}
+ value={vibeHeartsEnabled ? 'on' : 'off'}
+ />
+ }
+ description={a.vibeHeartsDesc}
+ title={a.vibeHeartsTitle}
+ />
+
<ListRow
action={
<SegmentedControl
diff --git a/apps/desktop/src/components/chat/vibe-hearts.test.ts b/apps/desktop/src/components/chat/vibe-hearts.test.ts
new file mode 100644
index 00000000000..7217959bbd9
--- /dev/null
+++ b/apps/desktop/src/components/chat/vibe-hearts.test.ts
@@ -0,0 +1,57 @@
+import { beforeEach, describe, expect, it, vi } from 'vitest'
+
+const { flashPetActivity, forwardPetReaction, burst } = vi.hoisted(() => ({
+ flashPetActivity: vi.fn(),
+ forwardPetReaction: vi.fn(),
+ burst: vi.fn()
+}))
+
+vi.mock('@/components/particles/particle-field', () => ({
+ createParticleEmitter: () => ({ burst, subscribe: () => () => undefined }),
+ ParticleField: () => null
+}))
+
+vi.mock('@/store/pet', () => ({
+ $petActive: { get: () => false },
+ flashPetActivity
+}))
+
+vi.mock('@/store/pet-overlay', () => ({
+ $petOverlayActive: { get: () => false },
+ forwardPetReaction
+}))
+
+import { burstVibeHearts } from '@/components/chat/vibe-hearts'
+import { setVibeHeartsEnabled } from '@/store/vibe-hearts-enabled'
+
+describe('burstVibeHearts', () => {
+ beforeEach(() => {
+ flashPetActivity.mockClear()
+ forwardPetReaction.mockClear()
+ burst.mockClear()
+ setVibeHeartsEnabled(true)
+ })
+
+ it('plays hearts when the preference is on', () => {
+ burstVibeHearts()
+ expect(burst).toHaveBeenCalledOnce()
+ })
+
+ it('no-ops when the preference is off', () => {
+ setVibeHeartsEnabled(false)
+ burstVibeHearts()
+ expect(burst).not.toHaveBeenCalled()
+ expect(flashPetActivity).not.toHaveBeenCalled()
+ expect(forwardPetReaction).not.toHaveBeenCalled()
+ })
+
+ it('reads the live atom (toggle mid-session takes effect)', () => {
+ setVibeHeartsEnabled(false)
+ burstVibeHearts()
+ expect(burst).not.toHaveBeenCalled()
+
+ setVibeHeartsEnabled(true)
+ burstVibeHearts()
+ expect(burst).toHaveBeenCalledOnce()
+ })
+})
diff --git a/apps/desktop/src/components/chat/vibe-hearts.tsx b/apps/desktop/src/components/chat/vibe-hearts.tsx
index 24876184fb9..9f39a1aa72b 100644
--- a/apps/desktop/src/components/chat/vibe-hearts.tsx
+++ b/apps/desktop/src/components/chat/vibe-hearts.tsx
@@ -3,12 +3,14 @@ import { type CSSProperties } from 'react'
import { createParticleEmitter, ParticleField, type ParticleFieldConfig } from '@/components/particles/particle-field'
import { $petActive, flashPetActivity } from '@/store/pet'
import { $petOverlayActive, forwardPetReaction } from '@/store/pet-overlay'
+import { $vibeHeartsEnabled } from '@/store/vibe-hearts-enabled'
/**
* TikTok-style floating hearts — a thin skin over {@link ParticleField} (pixel
* heart glyph + pink). Placed two ways: rising from the composer when no pet is
* out, or from the pet when one is. Fired by the core `reaction` event (affection
- * in a user message) via {@link burstVibeHearts}.
+ * in a user message) via {@link burstVibeHearts}. Gated by Settings → Appearance
+ * → Vibe Hearts (`$vibeHeartsEnabled`), on by default.
*/
// Light pink reads on both light and dark chat surfaces.
@@ -58,6 +60,10 @@ export const playVibeHearts = (count?: number) => emitter.burst(count)
* - no pet → play here (composer)
*/
export const burstVibeHearts = (count?: number) => {
+ if (!$vibeHeartsEnabled.get()) {
+ return
+ }
+
const overlay = $petOverlayActive.get()
if (overlay || $petActive.get()) {
diff --git a/apps/desktop/src/i18n/ar.ts b/apps/desktop/src/i18n/ar.ts
index 52d5d6dd37b..87674872caa 100644
--- a/apps/desktop/src/i18n/ar.ts
+++ b/apps/desktop/src/i18n/ar.ts
@@ -471,6 +471,9 @@ export const ar = defineLocale({
reactionsDesc: 'تفاعلات إيموجي بأسلوب iMessage — تفاعل مع الرسائل، ويمكن لـ Hermes التفاعل مع رسائلك.',
composerPopoutTitle: 'محرر عائم',
composerPopoutDesc: 'السماح بسحب محرر الرسائل خارج موضعه. عطّل هذا الخيار لإبقائه مثبتًا في الأسفل.',
+ vibeHeartsTitle: 'قلوب المزاج',
+ vibeHeartsDesc:
+ 'قلوب عائمة عند قول شكراً أو أحبك أو good bot أو إرسال قلب. منفصلة عن تفاعلات الرسائل أعلاه.',
embedsTitle: 'التضمينات المضمّنة',
embedsDesc:
'تُحمّل المعاينات الغنية من مواقع طرف ثالث (YouTube، X، …). "اسأل" يعرض عنصرا نائبا حتى تسمح لكل واحد؛ "دائما" يحمّلها تلقائيا؛ "إيقاف" يبقي الروابط عادية.',
diff --git a/apps/desktop/src/i18n/en.ts b/apps/desktop/src/i18n/en.ts
index 0c2dc06e8cc..4cc0e93c655 100644
--- a/apps/desktop/src/i18n/en.ts
+++ b/apps/desktop/src/i18n/en.ts
@@ -590,6 +590,9 @@ export const en: Translations = {
reactionsDesc: 'iMessage-style emoji tapbacks — react to messages, and Hermes can react to yours.',
composerPopoutTitle: 'Floating Composer',
composerPopoutDesc: 'Allow dragging the composer out of its dock. Turn this off to keep it locked at the bottom.',
+ vibeHeartsTitle: 'Vibe Hearts',
+ vibeHeartsDesc:
+ 'Floating hearts when you say thanks, ily, good bot, or send a heart. Separate from Message Reactions above.',
embedsTitle: 'Inline Embeds',
embedsDesc:
'Rich previews load from third-party sites (YouTube, X, …). Ask shows a placeholder until you allow each one; Always loads them automatically; Off keeps plain links.',
diff --git a/apps/desktop/src/i18n/ja.ts b/apps/desktop/src/i18n/ja.ts
index 3471bbc8d78..1bdbb57c062 100644
--- a/apps/desktop/src/i18n/ja.ts
+++ b/apps/desktop/src/i18n/ja.ts
@@ -413,6 +413,9 @@ export const ja = defineLocale({
'iMessage風の絵文字タップバック — メッセージにリアクションでき、Hermesもあなたのメッセージにリアクションします。',
composerPopoutTitle: 'フローティング入力欄',
composerPopoutDesc: '入力欄をドックからドラッグして外せるようにします。オフにすると画面下部に固定されます。',
+ vibeHeartsTitle: 'バイブハート',
+ vibeHeartsDesc:
+ 'ありがとう・愛してる・good bot・ハート絵文字のときに浮かぶハート。上のメッセージリアクションとは別です。',
embedsTitle: 'インライン埋め込み',
embedsDesc:
'リッチプレビューは第三者サイト(YouTube、X など)から読み込まれます。確認は許可するまでプレースホルダーを表示し、常には自動で読み込み、オフはリンクのままにします。',
diff --git a/apps/desktop/src/i18n/types.ts b/apps/desktop/src/i18n/types.ts
index 6c799c725dc..777e6df7a4b 100644
--- a/apps/desktop/src/i18n/types.ts
+++ b/apps/desktop/src/i18n/types.ts
@@ -480,6 +480,8 @@ export interface Translations {
reactionsDesc: string
composerPopoutTitle: string
composerPopoutDesc: string
+ vibeHeartsTitle: string
+ vibeHeartsDesc: string
embedsTitle: string
embedsDesc: string
embedsAsk: string
diff --git a/apps/desktop/src/i18n/zh-hant.ts b/apps/desktop/src/i18n/zh-hant.ts
index 0ffb32dc7d0..18b9693b687 100644
--- a/apps/desktop/src/i18n/zh-hant.ts
+++ b/apps/desktop/src/i18n/zh-hant.ts
@@ -402,6 +402,8 @@ export const zhHant = defineLocale({
reactionsDesc: 'iMessage 風格的表情回應 — 你可以對訊息做出回應,Hermes 也能回應你的訊息。',
composerPopoutTitle: '懸浮輸入框',
composerPopoutDesc: '允許將輸入框拖出底部停靠區。關閉後,輸入框會鎖定在底部。',
+ vibeHeartsTitle: '心情愛心',
+ vibeHeartsDesc: '當你說謝謝、愛你、good bot 或送出愛心時飄出的愛心。與上方的訊息回應是兩回事。',
embedsTitle: '內嵌預覽',
embedsDesc:
'豐富預覽會從第三方網站(YouTube、X 等)載入。詢問會在你允許前顯示佔位符;一律會自動載入;關閉則保留純連結。',
diff --git a/apps/desktop/src/i18n/zh.ts b/apps/desktop/src/i18n/zh.ts
index eb35364ae72..c98d9194ad8 100644
--- a/apps/desktop/src/i18n/zh.ts
+++ b/apps/desktop/src/i18n/zh.ts
@@ -576,6 +576,8 @@ export const zh: Translations = {
reactionsDesc: 'iMessage 风格的表情回应 — 你可以给消息添加回应,Hermes 也能回应你的消息。',
composerPopoutTitle: '悬浮输入框',
composerPopoutDesc: '允许将输入框拖出底部停靠区。关闭后,输入框会锁定在底部。',
+ vibeHeartsTitle: '心情爱心',
+ vibeHeartsDesc: '当你说谢谢、爱你、good bot 或发送爱心时飘出的爱心。与上方的消息回应是两回事。',
embedsTitle: '内嵌预览',
embedsDesc:
'富预览会从第三方网站(YouTube、X 等)加载。询问会在你允许前显示占位符;总是会自动加载;关闭则保留纯链接。',
diff --git a/apps/desktop/src/store/vibe-hearts-enabled.test.ts b/apps/desktop/src/store/vibe-hearts-enabled.test.ts
new file mode 100644
index 00000000000..a0a02070863
--- /dev/null
+++ b/apps/desktop/src/store/vibe-hearts-enabled.test.ts
@@ -0,0 +1,31 @@
+import { beforeEach, describe, expect, it } from 'vitest'
+
+import { $vibeHeartsEnabled, setVibeHeartsEnabled } from '@/store/vibe-hearts-enabled'
+
+const KEY = 'hermes.desktop.vibeHearts.v1'
+
+describe('vibe hearts enabled', () => {
+ beforeEach(() => {
+ window.localStorage.removeItem(KEY)
+ // Reset to the pre-toggle always-on default without going through the
+ // setter's persist path first (absent key means on).
+ $vibeHeartsEnabled.set(true)
+ })
+
+ it('defaults to on so existing installs keep hearts', () => {
+ expect($vibeHeartsEnabled.get()).toBe(true)
+ })
+
+ it('turns off and persists', () => {
+ setVibeHeartsEnabled(false)
+ expect($vibeHeartsEnabled.get()).toBe(false)
+ expect(window.localStorage.getItem(KEY)).toBe('off')
+ })
+
+ it('turns back on and persists', () => {
+ setVibeHeartsEnabled(false)
+ setVibeHeartsEnabled(true)
+ expect($vibeHeartsEnabled.get()).toBe(true)
+ expect(window.localStorage.getItem(KEY)).toBe('on')
+ })
+})
diff --git a/apps/desktop/src/store/vibe-hearts-enabled.ts b/apps/desktop/src/store/vibe-hearts-enabled.ts
new file mode 100644
index 00000000000..0ad3855808b
--- /dev/null
+++ b/apps/desktop/src/store/vibe-hearts-enabled.ts
@@ -0,0 +1,30 @@
+/**
+ * Floating vibe hearts (affection burst on ily / <3 / good bot / thanks).
+ *
+ * On by default: that is today's always-on behavior. Settings → Appearance owns
+ * the lever so hearts stay presentation-scoped (desktop AGENTS.md: state lives
+ * with its authority). Distinct from Message Reactions, which are iMessage-style
+ * tapbacks on message rows.
+ */
+
+import { atom } from 'nanostores'
+
+import { persistString, storedString } from '@/lib/storage'
+
+const KEY = 'hermes.desktop.vibeHearts.v1'
+
+// Absent key and anything other than "off" keep hearts on, matching the
+// pre-toggle always-on default for existing installs.
+export const $vibeHeartsEnabled = atom<boolean>(
+ typeof window === 'undefined' ? true : storedString(KEY) !== 'off'
+)
+
+export function setVibeHeartsEnabled(enabled: boolean): void {
+ $vibeHeartsEnabled.set(enabled)
+}
+
+if (typeof window !== 'undefined') {
+ $vibeHeartsEnabled.listen(enabled => {
+ persistString(KEY, enabled ? 'on' : 'off')
+ })
+}