Skip to content

feat(header-bar): add expandable notification dot indicator [LIBS-868] - #74

Merged
arina-gutuboe merged 2 commits into
mainfrom
LIBS-868/header-notification-indicator
Oct 5, 2026
Merged

arina-gutuboe merged 2 commits into
mainfrom
LIBS-868/header-notification-indicator

Conversation

@arina-gutuboe

@arina-gutuboe arina-gutuboe commented Aug 5, 2026 •

Copy link
Copy Markdown
Contributor

Implements LIBS-868

This is a follow-up PR that ports the equivalent badge behavior from the ui PR.

Description
Replaces the persistent notification counter badge with a compact indicator dot when unread notifications exist. The full counter badge is shown temporarily after login (3 seconds) and on hover or keyboard focus, then collapses back to the dot.

Known issue
A bug has been identified in the header bar: bgColor always has a default value, which means it is always truthy. As a result, the element background is not darkened when the default color is used, and the hover opacity is always applied.

Note for the reviewer (out of scope)
In this PR, the hoverStyle variable in notification-icon was split into two separate variables to avoid applying opacity to the badge itself. The underlying hover logic, however, was intentionally left unchanged.

My initial thought is that, since this behavior has been in place for a while, it may not be worth reintroducing separate hover styles for the default and custom background colors.

I'm wondering if it would make more sense to either keep the current opacity-based approach for consistency and clean up the old hover logic, or consider a different approach that makes the hover state more noticeable.

A possible alternative would be to adopt an approach similar to useOnlineStatusStyles, where the hover background is adjusted based on contrast:

// "Lighten" on light backgrounds with black text; "darken" on dark backgrounds
const customBgColor =
    color === 'black' ? 'rgba(255,255,255, 0.2)' : 'rgba(0,0,0, 0.2)';

Screenshots
A dot indicator is displayed by default, and a badge appears on hover:
Screenshot 2026-08-05 at 13 44 43
Screenshot 2026-08-05 at 13 45 24

@arina-gutuboe
arina-gutuboe requested review from KaiVandivier and kabaros and removed request for kabaros August 5, 2026 11:46
@sonarqubecloud

Copy link
Copy Markdown

@d-rita d-rita left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The UI fix is consistent with what was done in the UI library. LGTM!

For the question on the hoverstyle logic, the idea to "...adopt an approach similar to useOnlineStatusStyles, where the hover background is adjusted based on contrast" sounds like an implementation that would adjust well against different custom color backgrounds. But I will defer to @kabaros or @KaiVandivier for more context.

@arina-gutuboe
arina-gutuboe merged commit d88d915 into main Oct 5, 2026
5 checks passed
@dhis2-bot

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 1.13.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants