Skip to content

Error toasts via use-toast never render (Toaster not mounted) #422

Description

@jhodapp

Problem

@/components/ui/use-toast's toast() writes to its store, but the use-toast <Toaster> (@/components/ui/toaster) is never mounted anywhere. The root layout (src/app/layout.tsx) mounts only the sonner <Toaster> (@/components/ui/sonner). So every toast() call from use-toast is a no-op visually.

Impact

Coaching-session panel error toasts that use use-toast never appear, e.g.:

  • handleTopicCreate — "Failed to add topic"
  • handleTopicEdit — "Failed to update topic"
  • handleAgreementDelete — "Failed to delete agreement"

(and any other toast({ variant: "destructive", ... }) call). Toasts that use sonner (sonnerToast.*) render fine, since that Toaster is mounted.

Fix options

  1. Switch the use-toast callers to sonner (sonnerToast.error(...)) — matches the mounted Toaster and the rest of the panel. (Already done for the title-save toast in Coaching session Title + collaborative Topics (frontend) #418.)
  2. Or mount <Toaster/> from @/components/ui/toaster in the root layout, if both toast systems are intended.

Recommend (1) for consistency unless both systems are wanted.

Discovered while addressing #418 review comments.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions