Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4186 +/- ##
==========================================
+ Coverage 97.30% 97.32% +0.01%
==========================================
Files 888 890 +2
Lines 26012 26182 +170
Branches 9408 9476 +68
==========================================
+ Hits 25312 25481 +169
- Misses 694 695 +1
Partials 6 6 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
4fa101b to
efb51d9
Compare
8343dd7 to
aea04d1
Compare
2e7cb8e to
1f4c85f
Compare
221927b to
4379ee3
Compare
493d050 to
fbd48d1
Compare
9dc81fc to
6c9b625
Compare
c2e7af7 to
ac99ca3
Compare
| return; | ||
| } | ||
| if (drawersIds.includes(featureNotificationsData.id)) { | ||
| featurePromptRef?.current?.show(); |
There was a problem hiding this comment.
Why not set focus immediately after opening the drawer? The drawer opens on the next react rendering cycle, so if we set focus right after registering, the dom element doesn't exist yet. Same issue in use-focus-control: https://github.com/cloudscape-design/components/blob/main/src/app-layout/utils/use-focus-control.ts#L145
| triggerRef?.current!.focus(); | ||
| } | ||
| setFeaturePromptDismissed(true); | ||
| Promise.resolve().then(() => { |
There was a problem hiding this comment.
Async problem - we need to unset tooltip suppress after shifting focus to it.
| * clicking outside the prompt, shifting focus out of the prompt or pressing ESC. | ||
| */ | ||
| onDismiss?: NonCancelableEventHandler<null>; | ||
| onDismiss?: NonCancelableEventHandler<{ method?: string }>; |
There was a problem hiding this comment.
The method is a way the feature prompt was closed - blur, escape, close-button, click-outside.
Description
Introduced a feature notifications API that allows dynamically injecting a feature notifications drawer on pages using the AppLayout component.
The new API includes 3 methods:
registerFeatureNotifications- registers a new drawershowFeaturePromptIfPossible- manually shows a feature prompt next to the drawer's trigger buttonclearFeatureNotifications- clears the feature notifications drawerAlso enhanced the existing feature prompt internal component by adding dismissal context to the onDismiss method (blur, close-button, outside-click, etc.).
Related links, issue #, if available: n/a
How has this been tested?
U tests / manually
Review checklist
The following items are to be evaluated by the author(s) and the reviewer(s).
Correctness
CONTRIBUTING.md.CONTRIBUTING.md.Security
checkSafeUrlfunction.Testing
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.