Skip to content

Feat/lui 143 145 enhance define ritual form - #97

Merged
luidgi-dev merged 4 commits into
devfrom
feat/lui-143-145-enhance-define-ritual-form
Sep 13, 2026
Merged

luidgi-dev merged 4 commits into
devfrom
feat/lui-143-145-enhance-define-ritual-form

Conversation

@luidgi-dev

Copy link
Copy Markdown
Owner

LUI-143: Confirmation toast when a ritual is created

Why

In the synthetic beta study (LUI-142, finding F1), all 3 participants tapped Create ritual, saw the sheet close, and could not tell whether the ritual had been saved. The save did work. What was missing was an acknowledgment right after the action.

What

  • After a ritual is created, a toast appears: Ritual defined · {name} (FR: Rituel défini · {name}). It uses the existing Toast with the check icon.
  • This happens on create only. Editing a ritual shows no toast, because the card already updates in place.
  • The copy follows UX_WRITING.md: calm and precise, no gamified wording. The · pattern matches the chat log card (Logged · {name}).

How

  • New ToastProvider + useToast() (components/ui/toast-provider.tsx), mounted in the protected layout around <main>.
    • It shows one toast at a time. A new toast replaces the current one, and each toast closes itself after 5 s or when dismissed.
    • The toast state lives in the layout, not in the button, so it survives when the page content is replaced. This matters for the first ritual: the empty state's CTA unmounts as soon as the list replaces it.
  • RitualForm → RitualFormSheet: onSuccess now passes the saved values up, and the sheet exposes an optional onSaved. The edit flow does not use it and is unchanged.
  • DefineRitualButton: calls toast.show(...) when the save succeeds.
  • Refactor: the Settings feedback confirmation now uses the provider. Its local auto-dismiss wrapper and duplicate timer code are removed; message, icon and duration are unchanged.
  • Adds the i18n key rituals.create.saved in en.json and fr.json. No new styles; the toast uses existing color tokens.

Out of scope

  • createRitual only revalidates /protected/rituals, not /protected/flow. This was noted during the investigation but left untouched on purpose, to keep this change low risk.
  • The nudge toast and this toast share the same position. They can overlap if a ritual is created within 6 s of opening the app with unseen nudges. This was accepted as unlikely.

Testing

  • tsc --noEmit, eslint, vitest run (76 passed)
  • Create a ritual from the Rituals board: toast show

What

  • After a ritual is created, a toast appears: Ritual defined · {name} (FR: Rituel défini · {name}). It uses the existing Toast with the check icon.
  • This happens on create only. Editing a ritual shows no toast, because the card already updates in place.
  • The copy follows UX_WRITING.md: calm and precise, no gamified wording. The · pattern matches the chat log card (Logged · {name}).

How

  • New ToastProvider + useToast() (components/ui/toast-provider.tsx), mounted in the protected layout around <main>.
    • It shows one toast at a time. A new toast replaces the current one, and each toast closes itself after 5 s or when dismissed.
    • The toast state lives in the layout, not in the button, so it survives when the page content is replaced. This matters for the first ritual: the empty state's CTA unmounts as soon as the list replaces it.
  • RitualForm → RitualFormSheet: onSuccess now passes the saved values up, and the sheet exposes an optional onSaved. The edit flow does not use it and is unchanged.
  • DefineRitualButton: calls toast.show(...) when the save succeeds.
  • Refactor: the Settings feedback confirmation now uses the provider. Its local auto-dismiss wrapper and duplicate timer code are removed; message, icon and duration are unchanged.
  • Adds the i18n key rituals.create.saved in en.json and fr.json. No new styles; the toast uses existing color tokens.

Out of scope

  • createRitual only revalidates /protected/rituals, not /protected/flow. This was noted during the investigation but left untouched on purpose, to keep this change low risk.
  • The nudge toast and this toast share the same position. They can overlap if a ritual is created within 6 s of opening the app with unseen nudges. This was accepted as unlikely.

Testing

  • tsc --noEmit, eslint, vitest run (76 passed)
  • Create a ritual from the Rituals board: toast shows the ritual name
  • Create a ritual from Rhythm ("Add a ritual")
  • Edit a ritual: no toast
  • Settings, send feedback: same confirmation as before
  • Create the first ritual from an empty account (empty-state CTA unmounts): toast stays visible
  • FR copy check

- Integrated a toast notification system to provide user feedback upon successful ritual creation.
- Updated the `DefineRitualButton` component to display a confirmation message with an icon when a ritual is saved.
- Modified the `RitualFormSheet` and `RitualForm` components to pass the saved ritual values to the toast notification.
- Introduced a new `ToastProvider` component to manage toast notifications across the application.
- Wrapped the main content in the ProtectedBaseLayout with the ToastProvider component to enable toast notifications throughout the protected layout.
- This integration supports consistent user feedback across the application, complementing recent enhancements to the ritual creation flow.
- Replaced the custom success toast implementation with the useToast hook from the ToastProvider.
- Simplified the feedback handling by removing the local state for success messages.
- Enhanced user feedback experience by integrating toast notifications directly upon successful feedback submission.
- Updated the `en.json` and `fr.json` files to include a new message for successful ritual definition.
- Added the "saved" key to provide user feedback upon defining a ritual, enhancing the overall user experience.
@vercel

vercel Bot commented Sep 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
strive Ready Ready Preview Sep 13, 2026 3:10pm UTC

@github-actions

Copy link
Copy Markdown

Strive PR Agent Review

The review could not be generated for this run (model unavailable or rate-limited). Push again to retry.

@luidgi-dev
luidgi-dev merged commit 9dc3b1b into dev Sep 13, 2026
7 checks passed
@luidgi-dev
luidgi-dev deleted the feat/lui-143-145-enhance-define-ritual-form branch September 18, 2026 09:43
@luidgi-dev luidgi-dev mentioned this pull request Sep 20, 2026
5 tasks done

This branch was successfully deployed

1 active deployment
Preview — 999a15fa Deployed Sep 13, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant