Fix/245 notification read unread distinction#278
Merged
Conversation
Initialize both the ref and a new state variable from localStorage so the timestamp can be exposed to consumers and trigger re-renders when updated.
When the user marks all notifications as read, update both the ref (for immediate unread-count filtering) and the state (for downstream consumers that need the value as a prop).
Consumers can now pass this timestamp to NotificationBell to distinguish read from unread notification items.
Uses lastSeenTimestamp to check if a notification arrived after the last time the user opened the dropdown. Returns false when the prop is null to treat everything as read by default.
The green dot now only appears next to notifications that arrived after lastSeenTimestamp. Read notifications no longer show the dot.
Unread items get a light blue background (bg-blue-50 in light mode, bg-blue-900/20 in dark mode) to make them visually distinct from already-read notifications.
Covers empty address, event filtering, and unread count based on lastSeen timestamp.
Covers: unread dot visibility, read dot hiding, background highlight, mixed read/unread items, null lastSeenTimestamp treating all as read, and zero lastSeenTimestamp treating all as unread.
…side Adds boundary tests for exact and one-second-after lastSeen, loading and empty state rendering, aria-label correctness, region role, and click-outside dropdown dismissal.
Covers item rendering, 20-item limit, dot CSS classes, simultaneous highlight of multiple unread items, and mark-all-read button behavior.
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.
Closes #245