improve notification badge ux - #26951
Open
gally47 wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR refactors the header notification badge so system notifications are always visible (even when plugin navigation badges are active) and improves UX by showing an icon-only badge when there are zero unread notifications, with a capped displayed count for large numbers.
Changes:
- Refactors
NotificationBadgeto use a sharedNavBadgeItem, adds icon-only state for zero unread, and caps the displayed count at99+. - Updates navigation rendering so plugin badges no longer replace the built-in notification badge.
- Extends/adjusts unit tests to cover the new rendering, labeling, and capping behavior.
Reviewed changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
graylog2-web-interface/src/components/navigation/NotificationBadge.tsx |
Refactors badge rendering (icon, accessible label, capped count) and switches to NavBadgeItem. |
graylog2-web-interface/src/components/navigation/NotificationBadge.test.tsx |
Updates tests for new label/count behavior and polling updates. |
graylog2-web-interface/src/components/navigation/Navigation.tsx |
Always renders the notification badge, even when plugin badges are present. |
graylog2-web-interface/src/components/navigation/Navigation.test.tsx |
Updates expectations to match always-visible badge behavior. |
graylog2-web-interface/src/components/navigation/NavBadgeItem.tsx |
Introduces shared wrapper for nav badge sizing/spacing/interaction. |
graylog2-web-interface/src/components/bootstrap/Badge.tsx |
Adds support for passing Mantine variant through the wrapped badge component. |
graylog2-web-interface/src/@types/graylog-web-plugin/index.d.ts |
Updates plugin badge contract comment to reflect new “render alongside” behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
/nocl
Description
Cluster health and notifications are separate signals with separate destinations, so combining them made the count ambiguous. The badges share size, spacing, and interaction for consistency, while distinct colors, icons, and count meanings make each purpose immediately clear without adding visual noise.
Motivation and Context
fixes https://github.com/Graylog2/graylog-plugin-enterprise/issues/15030
Screenshots (if appropriate):
Types of changes
Checklist: