-
Notifications
You must be signed in to change notification settings - Fork 201
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
Add new notification displayed when there are pending updates #6256
Conversation
32751cb
to
d41f6b8
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6256 +/- ##
==========================================
- Coverage 99.44% 99.43% -0.02%
==========================================
Files 266 267 +1
Lines 10135 10177 +42
Branches 2400 2418 +18
==========================================
+ Hits 10079 10119 +40
- Misses 56 58 +2 ☔ View full report in Codecov by Sentry. |
f4ff71d
to
17b1b77
Compare
Codecov is marking as not covered two lines annotated with |
17b1b77
to
b00e30e
Compare
I found an issue where the notice does not appear when there are pending deletions but no pending updates.
|
I experienced the same during testing, but I thought this was by design, because the existing |
b00e30e
to
5b6d1b3
Compare
I'm can't remember if that was intentional or not. Looking at the behavior with fresh eyes, I think it would be better to change this so that deletions, additions and updates are all handled the same way. |
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.
This looks good. I provided some feedback on handling of deletions but I think that can be addressed in a subsequent PR.
assert.calledOnce(fakeSetTimeout); | ||
|
||
await promise; // Wait for timeout callback to be invoked | ||
wrapper.update(); |
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.
wrapper.update
's main function is to sync the wrapper with the rendered DOM, which is not immediately updated after the timeout fires, however it does also flush any pending state updates first. Since the state update is queued inside the timeout callback, this is OK.
Agreed. I found it a bit counter-intuitive when I saw it. |
5b6d1b3
to
7a76ae3
Compare
Part of #6255
This PR adds the initial logic to display a toast-like notification when new updates are available (new annotations, updated annotations, etc).
The notification is fully displayed for 5 seconds, and then collapsed to be less intrusive. When hovered it gets uncollapsed. When clicked, it loads all pending updates.
The notification replaces the existing
PendingUpdatesButton
, and is currently handled by a feature flag.notification-2024-03-15_15.32.30.mp4
Testing steps
PendingUpdatesButton
.pending_updates_notification
feature.PendingUpdatesButton
Out of scope
Some things will be eventually implemented but are out of the scope of this specific PR:
slide-from-right
animation when the notification is presented. I just added afade-in
because the existingslide-in-from-right
one expects the element to be positioned based on the left side, so we would need a variation of it.Considerations
TODO