diff --git a/web/src/components/ui/toast.tsx b/web/src/components/ui/toast.tsx index 5ccb925..fffa22d 100644 --- a/web/src/components/ui/toast.tsx +++ b/web/src/components/ui/toast.tsx @@ -17,9 +17,16 @@ interface ToastState { let nextId = 1 +// Error toasts no longer auto-dismiss (#85), so a burst of failures could grow +// the stack without bound and push older ones off-screen. Cap it: keep the most +// recent MAX_TOASTS and drop the oldest, so the newest — the one that just +// happened — is always visible. +const MAX_TOASTS = 4 + export const useToastStore = create((set) => ({ toasts: [], - push: (message, tone = 'info') => set((s) => ({ toasts: [...s.toasts, { id: nextId++, message, tone }] })), + push: (message, tone = 'info') => + set((s) => ({ toasts: [...s.toasts, { id: nextId++, message, tone }].slice(-MAX_TOASTS) })), dismiss: (id) => set((s) => ({ toasts: s.toasts.filter((t) => t.id !== id) })), })) diff --git a/web/src/editor/JournalPanel.tsx b/web/src/editor/JournalPanel.tsx index 15d7b2d..fba7d63 100644 --- a/web/src/editor/JournalPanel.tsx +++ b/web/src/editor/JournalPanel.tsx @@ -16,6 +16,11 @@ import { import type { EditorObject } from './types' import { objectDisplayName } from './kinds' +// Shared styling for the small From/To date inputs, so the two stay in step and +// don't drift from each other. +const dateInputClass = + 'rounded-md border border-border bg-surface px-1.5 py-1 text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent/40' + /** * The garden's journal: write an entry, read the season back. * @@ -86,7 +91,7 @@ export function JournalPanel({ value={from} max={to || undefined} onChange={(e) => setFrom(e.target.value)} - className="rounded-md border border-border bg-surface px-1.5 py-1 text-fg outline-none focus-visible:ring-2 focus-visible:ring-accent/40" + className={dateInputClass} /> {(from || to) && ( diff --git a/web/src/pages/PublicGardenPage.tsx b/web/src/pages/PublicGardenPage.tsx index 19cd028..7900c00 100644 --- a/web/src/pages/PublicGardenPage.tsx +++ b/web/src/pages/PublicGardenPage.tsx @@ -53,7 +53,7 @@ export function PublicGardenPage() { } return ( -
+

{garden.name}