feat: garden review fixes — honest dose answer grows it, quiet after crisis, no-promise texts (ADR-015)
CI / ruff · pytest (pull_request) Successful in 2m21s
CI / ruff · pytest (pull_request) Successful in 2m21s
Refs #120 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -70,9 +70,10 @@ export function Garden({ refreshKey }: { refreshKey?: unknown }) {
|
||||
setGarden(g);
|
||||
const raw = window.localStorage.getItem(seenKey(session.token));
|
||||
const seen = raw === null ? null : Number(raw);
|
||||
// No celebration right after a crisis: growth stays, the toast and the animation do not.
|
||||
// No celebration right after a crisis: growth stays, the toast and the animation do not. The server knows
|
||||
// about alerts from scales and questionnaires too (`quiet`); the chat check covers a crisis reply just shown.
|
||||
const recentCrisis = dialog.entries.slice(-12).some((e) => e.from === "assistant" && e.reply.kind === "crisis");
|
||||
if (seen !== null && g.steps > seen && !recentCrisis) {
|
||||
if (seen !== null && g.steps > seen && !g.quiet && !recentCrisis) {
|
||||
setFreshFrom(seen);
|
||||
if (!announced.current) toast(ru.garden.grew);
|
||||
announced.current = true;
|
||||
|
||||
Reference in New Issue
Block a user