-
-
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: Accessibility: Improve "change application layout" screen keyboard accessibility #11718
Desktop: Accessibility: Improve "change application layout" screen keyboard accessibility #11718
Conversation
type ReactButtonProps = React.DetailedHTMLProps<React.HTMLAttributes<HTMLButtonElement>, HTMLButtonElement>; | ||
interface Props extends Omit<ReactButtonProps, 'onClick'> { |
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.
Most of the changes to the Button
component are to pass unused props through to the <button>
component it wraps. This removes the need to enumerate all aria-*
props that can be used with custom <Button>
s.
|
||
const viewInfo = pluginUtils.viewInfoByViewId(plugins, key); | ||
if (viewInfo) { | ||
return PluginService.instance().safePluginNameById(viewInfo.plugin.id); |
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.
return PluginService.instance().safePluginNameById(viewInfo.plugin.id); | |
return PluginService.instance().pluginNameById(viewInfo.plugin.id); |
The above is currently used to label panels from plugins. The "safe" in "safePluginNameById" was intended to mean that the method doesn't throw
if the plugin isn't installed/loaded. However, just pluginNameById
may make more sense.
&.-fullscreen { | ||
max-width: 100vw; | ||
max-height: 100vh; | ||
|
||
&::backdrop { | ||
background-color: var(--joplin-background-color); | ||
} | ||
|
||
> .content { | ||
width: calc(100% - 20px); | ||
padding: 10px; | ||
margin: 0; | ||
padding: 0; |
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.
These changes allow the "change application layout" screen to completely overlay the main app content. At present,
- The application panels are shown behind the application layout
<dialog>
. The modal<dialog>
prevents these panels from receiving keyboard focus while changing the application layout. - The layout
<dialog>
contains the movement controls and a resizable region for each panel.
Summary
This pull request improves the accessibility of the "change application layout" screen. In particular, it,
<dialog>
, which causes Electron to prevent keyboard focus from interacting with content behind the "change application layout" screen while open.Note: This pull request refactors parts of
ResizableLayout
to improve type safety.Related to #10795.
To-do
For this pull request:
For a follow-up pull request:
Testing plan
This pull request adds automated end-to-end tests that verify: 1) the change layout screen opens and passes the automated accessibility scanner and 2) clicking "move right" for the sidebar keeps the "move right" button focused.
Manual testing (Fedora 41):
Use the arrows to move the layout items. Press "Escape" to exit.
thenSidebar panel, Move right button
.Note list panel, move left button
.