Companion: wire real Lottie assets — the always-sleeping cat

- LottiePlayer now auto-crops each asset to its content bbox (union getBBox
  across 6 frames -> square viewBox), so stock files with empty artboard
  padding fill the badge instead of floating tiny in the middle.
- Wire sleeping-cat.json to every mood: she's always asleep in the corner yet
  still mumbles tips and cheers through the bubble. napping hardcoded true so
  she keeps the calm sway + drifting zzz even while "talking".
- happy-dog.json parked in the folder as an awake-mascot alternate.
- Enable resolveJsonModule for the JSON imports.

Claude-Session: https://claude.ai/code/session_016Yr6jELuRc7hyzYLccQKZd
This commit is contained in:
prosolis
2026-06-25 22:03:02 -07:00
parent 8a32dde587
commit 97f99b27e4
7 changed files with 67 additions and 24 deletions

View File

@@ -24,7 +24,11 @@ const MOOD_EMOJI: Record<Mood, string> = {
// break reminders. Animation is Lottie when assets exist, emoji otherwise.
export function PetalCompanion({ wordCount, saveStatus, editTick, acceptTick }: Props) {
const { mood, bubble, dismiss } = useCompanion({ wordCount, saveStatus, editTick, acceptTick })
const napping = mood === 'sleeping'
// This mascot is always asleep (every mood maps to the sleeping-cat loop, see
// animations/index.ts) — so she always gets the calm sway + drifting zzz, even
// while she mumbles tips in her sleep. Flip to `mood === 'sleeping'` if you
// ever swap in an awake mascot.
const napping = true
return (
<div className="pointer-events-none fixed bottom-4 right-4 z-40 flex flex-col items-end gap-2">