-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[CL-335][CL-336][CL-374] Announce toasts more consistently #13167
base: main
Are you sure you want to change the base?
Conversation
New Issues (10)Checkmarx found the following issues in this Pull Request
Fixed Issues (2)Great job! The following issues were fixed in this Pull Request
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #13167 +/- ##
==========================================
- Coverage 35.48% 35.06% -0.43%
==========================================
Files 3007 3037 +30
Lines 90872 92727 +1855
Branches 16904 16888 -16
==========================================
+ Hits 32250 32511 +261
- Misses 56120 57753 +1633
+ Partials 2502 2463 -39 ☔ View full report in Codecov by Sentry. |
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.
Bug solution looks good, but I would change the way we expose it to consumers of the lib. Issues with current approach:
- An external dep / implementation detail is now exposed to the public API, here and here
- This goes against a code style I want to follow for the CL, the facade pattern. I will add this to our CL code style docs.
- We are duplicating some logic in each app component.
I think both of these issues are fixed by creating small container component: bit-toast-container
. It could directly set ToastrService.overlayContainer
with a reference to itself. That component could then be used in the app components.
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.
Looks good, thanks! Do we need to add <bit-toast-container>
to any stories (I believe the toast story is already broken)? Do we want to document it?
constructor(toastrService: ToastrService, toastPackage: ToastPackage) { | ||
super(toastrService, toastPackage); |
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.
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.
Nice find
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.
Bunch of doc nits, otherwise LGTM
constructor(toastrService: ToastrService, toastPackage: ToastPackage) { | ||
super(toastrService, toastPackage); |
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.
Nice find
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.
Thanks!
🎟️ Tracking
CL-335
CL-336
CL-374
📔 Objective
This PR adds the following screenreader functionality to our toasts in all 3 clients:
aria-live="polite"
(which isngx-toastr
's default) as well as adding a role ofstatus
andaria-atomic
to improve the consistency of toasts being announced. Some circumstances are not addressed by this fix, namely toasts not being announced when focus is lost.aria-role="alert"
on the toast when it is an error toast, which makes sure that screenreaders announce error messagesThis PR also fixes a couple of issues related to Storybook:
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:
) or similar for great changes:memo:
) or ℹ️ (:information_source:
) for notes or general info:question:
) for questions:thinking:
) or 💭 (:thought_balloon:
) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:
) for suggestions / improvements:x:
) or:warning:
) for more significant problems or concerns needing attention:seedling:
) or ♻️ (:recycle:
) for future improvements or indications of technical debt:pick:
) for minor or nitpick changes