Skip to content

fix : replace alert calls with toast notifications in RoutineCard #1985

Description

@tmdeveloper007

Summary of What Needs to be Done

Replace all remaining browser alert() calls in frontend/src/components/Routine/RoutineCard.jsx with the existing inline toast notification system (triggerToast function) for a non-blocking user experience.

Changes that Need to be Made

The file already has toast infrastructure (triggerToast function, showToast state). Replace these 4 alert calls with triggerToast calls:

  • alert("Failed to copy share link") -> triggerToast("Error", "Failed to copy share link")
  • alert("Failed to copy routine summary") -> triggerToast("Error", "Failed to copy routine summary")
  • alert("Failed to export routine as PDF") -> triggerToast("Error", "Failed to export routine as PDF")
  • alert("Failed to delete routine") -> triggerToast("Error", "Failed to delete routine")

The toast UI already exists. Consider adding a red-dot indicator to distinguish error toasts from success toasts.

Impact that it would Provide

  • Eliminates blocking browser alert dialogs for error cases
  • Consistent UX with other toast notifications in the app
  • Better user experience on mobile and desktop

Note: Please assign this issue to the tmdeveloper007 account.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfrontendIssues related to UI/UX

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions