AOSSIE-Org / AOSSIE-Org/DebateAI

[Feature] Integrate 'Sonner' for standardized user notifications (Toast)

Đang mở
#206 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
84
Fork
198
Merge trung bình
2 ngày 19 giờ
Pull request đã merge (30 ngày)
30

Mô tả

### Is your feature request related to a problem? Please describe.
The application currently lacks a consistent mechanism for feedback. We have a toast component defined at `./frontend/src/components/toast.tsx`, but it is not utilized in the main application flow. Instead, user feedback relies on disparate methods like `console.log` or native `window.alert`, resulting in a fragmented User Experience (UX).

### Describe the solution you'd like
I propose strictly integrating the existing `toast.tsx` component into the global application layout. This will standardize all success, error, and info notifications, ensuring they are non-blocking and visually consistent with the design system.

### Technical Implementation Strategy
1. **Context Injection:** Wrap the root application component (in `App.tsx` or `layout.tsx`) with the `` provider exported from the component file.
2. **Global Availability:** Ensure the toast hook is accessible throughout the component tree without prop drilling.
3. **Refactoring:** Audit existing API calls (login, registration, data fetching) and replace `catch(err => console.error(err))` blocks with `toast.error()`.

### Acceptance Criteria
- [ ] **Global Provider:** The application renders the Toast provider at the root level, ensuring notifications can appear on top of any route.
- [ ] **Error Handling:** Network errors and failed form submissions trigger a red/error variant toast.
- [ ] **Success Feedback:** Successful actions (e.g., "Profile Updated") trigger a green/success variant toast.
- [ ] **Legacy Removal:** All instances of `window.alert()` are removed from the codebase.

### Priority
Medium - Impacts UX and error visibility.

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.