feat(desktop): add pet roam opt-in toggle + i18n

This commit is contained in:
Brooklyn Nicholson 2026-06-29 14:26:02 -05:00
parent 4da744ef9b
commit b72c9e1b2c
6 changed files with 32 additions and 1 deletions

View file

@ -13,7 +13,7 @@ import { triggerHaptic } from '@/lib/haptics'
import { Download, Loader2, PawPrint, Pencil, Trash2 } from '@/lib/icons'
import { selectableCardClass } from '@/lib/selectable-card'
import { cn } from '@/lib/utils'
import { $petInfo } from '@/store/pet'
import { $petInfo, $petRoam, setPetRoam } from '@/store/pet'
import {
$petBusy,
$petGallery,
@ -54,6 +54,7 @@ export function PetSettings() {
const error = useStore($petGalleryError)
const busySlug = useStore($petBusy)
const petInfo = useStore($petInfo)
const roam = useStore($petRoam)
const [query, setQuery] = useState('')
const [confirmDelete, setConfirmDelete] = useState<GalleryPet | null>(null)
const [renameTarget, setRenameTarget] = useState<GalleryPet | null>(null)
@ -279,6 +280,26 @@ export function PetSettings() {
title={copy.scaleTitle}
/>
)}
{enabled && (
<ListRow
action={
<SegmentedControl
onChange={id => {
setPetRoam(id === 'on')
triggerHaptic('crisp')
}}
options={[
{ id: 'off', label: copy.off },
{ id: 'on', label: copy.on }
]}
value={roam ? 'on' : 'off'}
/>
}
description={copy.roamDesc}
title={copy.roamTitle}
/>
)}
</div>
<ConfirmDialog

View file

@ -414,6 +414,8 @@ export const en: Translations = {
off: 'Off',
scaleTitle: 'Size',
scaleDesc: 'Resize the floating mascot. Applies everywhere instantly.',
roamTitle: 'Roam',
roamDesc: 'Let the pet wander the window on its own while idle.',
chooseTitle: 'Choose a pet',
chooseDesc: 'Picking one installs it (if needed) and makes it active.',
searchPlaceholder: 'Search pets…',

View file

@ -319,6 +319,8 @@ export const ja = defineLocale({
'ペット機能には再起動が必要です。この機能が追加される前に起動したアプリが動作中です。Hermes を終了して再度開き、このページに戻ってください。',
scaleTitle: 'サイズ',
scaleDesc: '浮遊マスコットの大きさを変更します。すべての画面に即時反映されます。',
roamTitle: '散歩',
roamDesc: 'アイドル中にペットがウィンドウ内を自由に歩き回ります。',
on: 'オン',
off: 'オフ',
chooseTitle: 'ペットを選ぶ',

View file

@ -331,6 +331,8 @@ export interface Translations {
off: string
scaleTitle: string
scaleDesc: string
roamTitle: string
roamDesc: string
chooseTitle: string
chooseDesc: string
searchPlaceholder: string

View file

@ -308,6 +308,8 @@ export const zhHant = defineLocale({
restartHint: '寵物功能需要重新啟動——目前執行的應用在此功能加入前啟動。請結束並重新開啟 Hermes然後回到此處。',
scaleTitle: '大小',
scaleDesc: '調整懸浮寵物的大小,所有介面即時生效。',
roamTitle: '漫遊',
roamDesc: '閒置時讓寵物自己在視窗內四處走動。',
on: '開啟',
off: '關閉',
chooseTitle: '選擇寵物',

View file

@ -399,6 +399,8 @@ export const zh: Translations = {
restartHint: '宠物功能需要重启——当前运行的应用在此功能加入前启动。请退出并重新打开 Hermes然后回到此处。',
scaleTitle: '大小',
scaleDesc: '调整悬浮宠物的大小,所有界面即时生效。',
roamTitle: '漫游',
roamDesc: '空闲时让宠物自己在窗口内四处走动。',
on: '开启',
off: '关闭',
chooseTitle: '选择宠物',