-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
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
Desktop: Improve notification accessibility #11752
base: dev
Are you sure you want to change the base?
Desktop: Improve notification accessibility #11752
Conversation
const messageHtml = ` | ||
<div class="update-notification" style="color: ${theme.color2};"> | ||
${noUpdateMessageHtml} | ||
const notification = popupManager.createPopup(() => ( | ||
<div className='update-notification'> | ||
{_('No updates available')} | ||
</div> | ||
`; |
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.
API: With this change, notifications use React components instead of raw HTML.
GitHub's diff is having trouble with the changes to the licenses.md file (probably due to the file size).
Adds a command that shows a dialog with recent notifications. Inspiered by VSCode. Goal: Partially satisfy the "provide enough time" requirement.
notifications (to show the decorative background element)
packages/app-desktop/gui/PopupNotification/NotificationHistoryDialog.tsx
Outdated
Show resolved
Hide resolved
I wish this change had been discussed in advance because it's huge and it's not clear it's worth the effort. Not to mention that's a lot of extra code that will need to be maintained vs a lib that did most of what we needed for free. |
|
…lity/popup-accessibility
…lity/popup-accessibility
Summary
Goal: Make toast notifications shown in the desktop app more accessible and easier to create/update.
This pull request replaces Notyf with a custom component. This allows fixing a few issues:
Note
This pull request makes an effort for the new notifications to appear roughly the same as the Notyf notifications.
Fixes #11742. Related to #10795.
Screenshots
Screen recording
The below screen recording shows two "moved to the trash" notifications being shown, then auto-dismissing after several seconds. When both are visible, one notification is shown above the other, with a vertical gap between the two:
Screencast.from.2025-02-19.11-34-35.webm
Before/after
Accessibility
Timing Adjustable (WCAG 2.2 SC 2.2.1)
The "Timing Adjustable" success criterion states:
Warning
This pull request's "Recent notifications" dialog may not be sufficient for this. Although it does allow users to review recent notifications without a time limit,
Joplin's toast notifications auto-dismiss after a few seconds. This is a time limit set by Joplin. Thus, some change needs to be made.
For comparison, VSCode also shows popup notifications. However, actionable notifications don't seem to auto-dismiss. Instead, they must be dismissed manually by the user. Unactionable progress notifications do auto-dismiss.
Screen reader/keyboard accessibility
Prior to this pull request, it was very difficult to move the keyboard focus to a popup notification. This is necessary, for example, to select an option when auto-updates are enabled, or to click "cancel" when deleting to the trash.
VSCode has a notification center with a list of recent notifications. Opening this notification center with the keyboard causes focus to jump to the first notification:

Additionally, a notification center is an approach discussed in this blog post and this other blog post.
This pull request adds a notification center to Joplin(this was removed):This notification center can currently only be opened from the command palette. Ideally, however, there would be a button in the UI (perhaps similar to VSCode?) to open this dialog. Suggestions on what to do here would be welcome!
Important
The notification history screen has been removed for now.
Details
This pull request replaces Notyf with a custom component with similar styles/animations to Notyf. Unlike Notyf,
To-do
<button
s that are styled to look like links.alert
is the correct role for these notifications.Testing plan
Note: This pull request adds an automated test that verifies that a "deleted" notification is shown when deleting to the trash.
:showNotificationDialog
in the command palette.Screen reader transcript
Issues observed during the above test: