From 31f8ede9ac2182bb29b2e999f0ef0c40e0bcf0cf Mon Sep 17 00:00:00 2001 From: josh Date: Sat, 9 May 2026 11:07:43 -0400 Subject: [PATCH] feat(02-05): wire compost beat toast (Plan 02-04 deferral) - src/ui/settings/compost-toast.tsx: thin transient toast (D-07, GARD-04). Reads a rotating line from uiStrings[1].post_harvest_beat on each compost dispatch; fades out after 3.5s. Co-located with PersistenceToast as the plan specified ('folded into the persistence- toast UI surface'). - src/store/session-slice.ts: compostBeatTick monotonic counter + bumpCompostBeat action. Counter (vs boolean) ensures consecutive composts re-fire the toast without dedup. - src/game/scenes/Garden.ts: handleTilePointerDown's compost branch calls bumpCompostBeat after enqueueCommand. - src/App.tsx: mounts . - 4 new compost-toast tests; 312/312 vitest green; e2e still 1.6s green; npm run ci exits 0. Implementation choice (per plan 'surfaced in SUMMARY'): minimum-viable toast surface chosen over the Ink runtime path. The Ink-authored compost-acknowledgements.ink content remains compiled + runtime- loadable via loadInkStory + InkRenderer, so a future plan can swap this component for the richer voice without touching sim or store. --- src/App.tsx | 3 +- src/game/scenes/Garden.ts | 11 ++-- src/store/session-slice.ts | 14 +++++ src/ui/settings/compost-toast.test.tsx | 72 ++++++++++++++++++++++++++ src/ui/settings/compost-toast.tsx | 69 ++++++++++++++++++++++++ src/ui/settings/index.ts | 4 ++ 6 files changed, 167 insertions(+), 6 deletions(-) create mode 100644 src/ui/settings/compost-toast.test.tsx create mode 100644 src/ui/settings/compost-toast.tsx diff --git a/src/App.tsx b/src/App.tsx index 2c0af36..7668cdd 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -5,7 +5,7 @@ import { SeedPicker } from './ui/garden'; import { FragmentRevealModal, JournalIcon } from './ui/journal'; import { LuraDialogue } from './ui/dialogue'; import { Letter } from './ui/letter'; -import { Settings, PersistenceToast } from './ui/settings'; +import { Settings, PersistenceToast, CompostToast } from './ui/settings'; import { useAppStore } from './store'; function App() { @@ -59,6 +59,7 @@ function App() { setSettingsOpen(false)} /> +