Skip to content

Fix: implement optimistic UI deletion and toast feedback (#270)#1673

Open
ayaan-7505 wants to merge 1 commit into
aryandas2911:mainfrom
ayaan-7505:fix/270-task-deletion
Open

Fix: implement optimistic UI deletion and toast feedback (#270)#1673
ayaan-7505 wants to merge 1 commit into
aryandas2911:mainfrom
ayaan-7505:fix/270-task-deletion

Conversation

@ayaan-7505

Copy link
Copy Markdown

📌 Description

This PR resolves the issue where clicking the delete button on a task in the Tasks page failed to remove it from the UI or database. The fix introduces optimistic UI updates to instantly remove the task on the frontend, while adding proper error handling and a Toast notification to safely fall back and notify the user if the backend request fails.

🔗 Related Issue

Closes #270

🛠 Changes Made

  • Added optimistic UI state updates for deleteTask and bulkDelete in useTasks.js for an instantly responsive UI.
  • Implemented try/catch error handling around backend API requests, allowing the state to seamlessly revert (re-fetch) if the server fails to delete the task.
  • Added a Toast component to Tasks.jsx to provide clear, visual success/error feedback when a user deletes a task, matching the rest of the application's design system.

📸 Screenshots

Screenshot 2026-06-30 131529

✅ Checklist

  • Code runs locally
  • Followed project structure
  • No console errors
  • Properly tested changes
  • Linked the issue

🚀 Notes for Reviewers

I added an inline Toast component directly into Tasks.jsx similar to how it is handled in Profile.jsx to ensure the user gets immediate feedback without relying on unhandled promise rejections or silent failures.

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.

Bug: Unable to delete tasks from Tasks page

1 participant