-
Notifications
You must be signed in to change notification settings - Fork 17
ECHO-346 Dashboard announcement fixes #226
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…age display - Updated AnnouncementIcon to simplify message handling and improve readability. - Enhanced Announcements component with an error state that provides user feedback and retry functionality. - Integrated Sentry for error tracking in announcement hooks, ensuring better monitoring of issues related to fetching and marking announcements as read.
- Added translations for "Error loading announcements", "Failed to get announcements", "Failed to get the latest announcement", and "Failed to get unread announcements count" in German, English, Spanish, French, and Dutch. - Included "Try Again" message in multiple languages to enhance user feedback during error scenarios. - Adjusted line numbers in localization files for accurate mapping to the Announcements component.
WalkthroughThis change refactors the announcement feature's control flow and UX for error handling and message display. It updates variable naming and logic for displaying info-level announcement messages, introduces user-facing error toasts and retry UI, and expands localization files with new error and status messages across supported languages. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant AnnouncementIcon
participant AnnouncementHooks
participant Sentry
participant Toast
participant AnnouncementsUI
User->>AnnouncementIcon: Loads component
AnnouncementIcon->>AnnouncementHooks: Fetch latest announcement
AnnouncementHooks->>AnnouncementIcon: Return announcement data
AnnouncementIcon->>AnnouncementIcon: Compute showMessage (unread, info-level)
AnnouncementIcon-->>User: Conditionally render message
User->>AnnouncementsUI: Loads announcement list
AnnouncementsUI->>AnnouncementHooks: Fetch announcements
alt Error occurs
AnnouncementHooks->>Sentry: Log error
AnnouncementHooks->>Toast: Show error toast
AnnouncementHooks->>AnnouncementsUI: Throw error
AnnouncementsUI-->>User: Show ErrorState with retry button
User->>AnnouncementsUI: Clicks retry
AnnouncementsUI->>AnnouncementHooks: Refetch announcements
else Success
AnnouncementHooks->>AnnouncementsUI: Return announcements
AnnouncementsUI-->>User: Render announcement list
end
Suggested reviewers
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (13)
🧰 Additional context used🧠 Learnings (13)📓 Common learningsecho/frontend/src/locales/es-ES.po (2)echo/frontend/src/components/announcement/hooks/index.ts (1)echo/frontend/src/components/announcement/AnnouncementIcon.tsx (2)echo/frontend/src/locales/en-US.po (3)echo/frontend/src/locales/fr-FR.po (3)echo/frontend/src/components/announcement/Announcements.tsx (3)echo/frontend/src/locales/nl-NL.ts (2)echo/frontend/src/locales/de-DE.po (3)echo/frontend/src/locales/nl-NL.po (1)echo/frontend/src/locales/fr-FR.ts (2)echo/frontend/src/locales/en-US.ts (2)echo/frontend/src/locales/es-ES.ts (1)🧬 Code Graph Analysis (2)echo/frontend/src/components/announcement/hooks/index.ts (1)
echo/frontend/src/components/announcement/AnnouncementIcon.tsx (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
🔇 Additional comments (42)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bug: Announcement Preview Filters Out Important Levels
The announcement icon's message preview now only displays unread announcements with level === "info". This new showMessage condition hides unread announcements of other levels (e.g., 'warning', 'error', 'urgent') that were previously displayed. This change may prevent users from seeing important notifications, and the business logic for this level filtering should be verified.
echo/frontend/src/components/announcement/AnnouncementIcon.tsx#L28-L31
echo/echo/frontend/src/components/announcement/AnnouncementIcon.tsx
Lines 28 to 31 in 0f0e897
| const showMessage = | |
| isUnread && message && latestAnnouncement?.level === "info"; | |
Was this report helpful? Give feedback by reacting with 👍 or 👎
* Refactor announcement components for improved error handling and message display - Updated AnnouncementIcon to simplify message handling and improve readability. - Enhanced Announcements component with an error state that provides user feedback and retry functionality. - Integrated Sentry for error tracking in announcement hooks, ensuring better monitoring of issues related to fetching and marking announcements as read. * Update localization files with new error messages for announcements - Added translations for "Error loading announcements", "Failed to get announcements", "Failed to get the latest announcement", and "Failed to get unread announcements count" in German, English, Spanish, French, and Dutch. - Included "Try Again" message in multiple languages to enhance user feedback during error scenarios. - Adjusted line numbers in localization files for accurate mapping to the Announcements component.
Summary by CodeRabbit
New Features
Bug Fixes
Localization