Skip to content

Hermes [ T3 Code ] Add toast notification system with history panel#5451

Open
Jinyzhi wants to merge 2 commits into
UnsafeLabs:mainfrom
Jinyzhi:feat/notification-system
Open

Hermes [ T3 Code ] Add toast notification system with history panel#5451
Jinyzhi wants to merge 2 commits into
UnsafeLabs:mainfrom
Jinyzhi:feat/notification-system

Conversation

@Jinyzhi
Copy link
Copy Markdown

@Jinyzhi Jinyzhi commented May 28, 2026

Summary

Implements a toast notification system with history panel for server events feedback.

Changes

  • notificationStore.ts — Zustand store with addNotification, dismissNotification, clearHistory, markAsRead actions. Max 50 notifications in history, configurable auto-dismiss duration (default 5s).

  • NotificationToast.tsx — Toast component rendering in top-right corner with:

    • 4 types: success (green), error (red), warning (amber), info (blue)
    • lucide-react icons per type
    • Slide-in from right / fade-out animations
    • Click-to-dismiss + auto-dismiss with progress bar
    • Vertical stacking without overlap
  • NotificationHistoryPanel.tsx — History panel showing last 50 notifications:

    • Date grouping (Today / Yesterday / date)
    • Read/unread visual distinction
    • Clear history button
    • Individual mark-as-read on click
  • .provenance.json — AI agent metadata

Acceptance Criteria

  • Notifications appear as toasts in the top-right corner
  • Each type has distinct color and icon
  • Auto-dismiss after configurable duration
  • Click to dismiss immediately
  • Multiple notifications stack without overlapping
  • Enter animation slides in from right, exit fades out
  • History panel shows last 50 notifications with timestamps
  • Notification store exposes addNotification and clearHistory methods
  • .provenance.json included

Closes #862
/bounty $40

Closes UnsafeLabs#862

- notificationStore.ts: Zustand store with addNotification, dismissNotification, clearHistory
- NotificationToast.tsx: Toast component with 4 types, auto-dismiss, enter/exit animations
- NotificationHistoryPanel.tsx: History panel with date grouping, read/unread state
- .provenance.json: AI agent metadata
Copy link
Copy Markdown

@zhangjiayang6835-cyber zhangjiayang6835-cyber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Review: #5451 — Toast notification system

What looks correct:

  • The Zustand store approach is well-structured with addNotification, dismissNotification, and clearHistory
  • Components are properly separated (Toast vs HistoryPanel)
  • .provenance.json is included ✓

What needs improvement:

  • No test files are included. The project requires tests for new functionality.
  • TypeScript types could be stricter — consider exporting notification types for reuse.
  • The PR title should include [ T3 Code ] prefix as required by project conventions.

Suggestions:

  • Add vitest tests for the notification store (add/dismiss/clear edge cases)
  • Add tests for toast auto-dismiss behavior
  • Update PR title to include [ T3 Code ] prefix

Close to merge-ready, just needs tests and title fix.

- notificationStore.test.ts: 21 tests covering add/dismiss/clear/read/maxHistory
- NotificationToast.test.tsx: 6 smoke tests for component rendering
@Jinyzhi
Copy link
Copy Markdown
Author

Jinyzhi commented May 28, 2026

Thanks for the review! Addressed feedback:

Tests added:

  • notificationStore.test.ts — 21 tests (add/dismiss/clear/read/maxHistory/auto-dismiss/timers)
  • NotificationToast.test.tsx — 6 smoke tests (component rendering + type coverage)

PR title already includes [ T3 Code ] prefix — please verify.

TypesNotificationType and Notification interfaces are exported from the store for reuse.

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.

[ T3 Code ] Add toast notification system with history panel

2 participants