Mavenomics / MavenWorks

Agile Dashboarding, anywhere
https://mavenworks.com
GNU General Public License v3.0
18 stars 2 forks source link

Document focus lost after closing dialog or layout region #39

Closed YairMarcowMavenomics closed 4 years ago

YairMarcowMavenomics commented 5 years ago

E.g. Ctrl+G to edit globals, close the dialog, try Ctrl+G again.

Unless we come up with something more general we may need to, for example, reassign focus to the document after dialog close.

quigleyj-mavenomics commented 5 years ago

This also occurs with layout regions, eg "Alt W" on a layout region (or the last tab of a tab panel) will kill page focus and not let it travel to something sensible (like the next sibling, the parent, or the root)

YairMarcowMavenomics commented 5 years ago

E.g. how to repro for last tab:

quigleyj-mavenomics commented 4 years ago

This will require some focus management for dialogs and layout containers. This article goes in-depth into some of the concerns around focus management:

https://medium.com/@matuzo/writing-javascript-with-accessibility-in-mind-a1f6a5f467b9

That article goes very in-depth with a11y, and MavenWorks is not very good with that (beyond the cheap, easy stuff like not-using-divs-as-buttons). But keyboard a11y in particular has positive user-impacts by way of the curb-cut effect- a good keyboard UX is useful to both disabled users and power users.

Right now, this is the biggest 'gotcha' in our keyboard UX, but there's more- the Query Editor has a major keyboard trap, buttons tab-traverse in reverse-order, users cannot navigate multiple dialogs quickly, no dashboard navigation, grid-based options interfere with tab order, IFrames are opaque to focus, etc. A focus manager might eventually have to account for these issues, which is why I mention them now even though this issue doesn't deal with them.

My plan is to implement a primitive focus manager for RegionWithChildren that operates whenever a child has been removed, but keep it as generic as possible in case it later needs to move to the LayoutManager. Separately, the DialogManager will receive it's own focus manager- right now the tasks they accomplish will be very similar, but I expect them to diverge significantly as we work out additional corners in keyboard UX.

YairMarcowMavenomics commented 4 years ago

Some related private notes on focus management are here:

https://docs.google.com/document/d/160ftTbxfQAfgX5ZfT-3Va8gTLcCFBauIbKmsWoHffhg/edit