thorium-reader icon indicating copy to clipboard operation
thorium-reader copied to clipboard

[new GUI] arrow keys left/right should be disabled when keyboard focus is active inside modals

Open danielweck opened this issue 1 year ago • 3 comments

Screenshot 2024-04-24 at 18 55 14 Screenshot 2024-04-24 at 18 57 54

danielweck avatar Apr 24 '24 18:04 danielweck

Also, I notice that when I activate a TOC link the focus remains inside the navigation panel (instead of automatically reaching into the content area) ... I totally understand the rationale for this in the context of the new GUI design but we need to make sure that screen reader users who were used to pre-3.x experience don't feel completely lost. I am wondering what to do...

danielweck avatar Apr 24 '24 18:04 danielweck

In Thorium 2.4, hitting ENTER on a TOC link redirects the keyboard focus to the content area, consequently a screen reader automatically reaches the publication HTML that the user hyperlinked into. The keyboard modifiers SHIFT CONTROL ALT can be used to keep the navigation panel open and preserve the keyboard focus inside the TOC (or landmarks, or page list, or search results, etc.) Thorium 3.x breaks this established UX pattern. Not sure what we should do...

danielweck avatar Apr 24 '24 18:04 danielweck

Technical reference: shortcutEnable React state + prop drilling:

https://github.com/edrlab/thorium-reader/blob/0a430ace83d339d6a11789979b0dfa86ab690b9a/src/renderer/reader/components/Reader.tsx#L1721-L1736

...note the hack (EDIT: this event name seems unused, probably needs to be removed now)

https://github.com/edrlab/thorium-reader/blob/0a430ace83d339d6a11789979b0dfa86ab690b9a/src/renderer/reader/components/Reader.tsx#L438-L442

Also, I am not sure how this is handled now with the new GUI lib:

https://github.com/edrlab/thorium-reader/blob/0a430ace83d339d6a11789979b0dfa86ab690b9a/src/renderer/reader/components/Reader.tsx#L2198-L2212

https://github.com/edrlab/thorium-reader/blob/0a430ace83d339d6a11789979b0dfa86ab690b9a/src/renderer/reader/components/Reader.tsx#L2550-L2562

danielweck avatar May 06 '24 10:05 danielweck

To be clear for the scope of this issue, that is only this : "arrow keys left/right should be disabled when keyboard focus is active inside modals" or do I miss something ?

panaC avatar May 06 '24 11:05 panaC

all keyboard shortcut for the navigation should be disabled, right ? Not only arrow left and right ?

panaC avatar May 06 '24 11:05 panaC

understood, I added a ternary on shortcutEnable both on Settings and Menu to disable shortcut when the menu is open and in full mode (undocked mode)

I prepare a commit to close this issue.

Daniel feel free to reopen it :)

panaC avatar May 06 '24 11:05 panaC