readme/dev/accessibility.md
Joplin has a strong focus on accessibility. It's important to make sure that new pull requests and features keep Joplin accessible.
When creating new components, it's important to make sure that they're accessible. How to do this varies a bit between desktop and mobile, but in general:
For a full list of accessibility guidelines, see the WCAG 2.2.
For more information, see:
Joplin should be accessible to screen readers. A big part of this is testing changes to the UI with a screen reader. Here's how to do that.
Most systems have a built-in screen reader that can be enabled and disabled in settings, or with keyboard shortcuts:
orca.Each of these screen readers has its own keyboard shortcuts and navigation methods. In general, however, it's possible to use keyboard shortcuts such as <kbd>tab</kbd> and <kbd>shift</kbd>-<kbd>tab</kbd> to navigate while a screen reader is enabled. See the documentation links above for documentation specific to each screen reader.
Notes:
Like desktop, most physical Android and iOS devices come with screen readers. However, setting up a screen reader on an Android emulator or iOS simulator can be a bit more difficult:
developer.android.com's guide for testing with TalkBack.On a physical mobile device, VoiceOver and TalkBack share certain gestures:
The desktop and mobile apps use different frameworks for checking for accessibility-related regressions: The desktop app uses Playwright and the mobile app uses react-native-testing-library.
Existing Playwright automated tests can be found in packages/app-desktop/integration-tests. See the integration-tests/README.md file for details.
For general accessibility issues (e.g. contrast, missing labels), we use @axe-core/playwright. This library scans everything visible on the screen and returns a set of errors. See integration-tests/wcag.spec.ts for existing tests that make use of this library.
Keyboard interface tests should go in the other test files. For example, richText.spec.ts currently includes several tests related to using the editor with a keyboard. While writing these tests, the expect.toBeFocused, keyboard.press, and getByRole APIs might be particularly useful.
The getByRole API can also be used to verify that components have specific role information.
On mobile, react-native-testing-library also provides a getByRole selector that can be used to ensure that accessibility information is present. See, for example, this test for list of installed plugins.