Repository navigation
Optional highlight around focused panel - #7881
Merged
Merged
Conversation
jmcphers
approved these changes
Sep 25, 2020
Member
|
Let's add a NEWS entry for this. |
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Intent
Provides optional support (off by default) for indicating which panel has keyboard focus via a dotted outline. Someone will presumably have a better visual treatment, but for 1.4 this seems sufficient. "Panel" in our terminology refers to the main regions of the page (formerly each of the 4 quadrants, but now also includes source columns).
Enable in accessibility options via new "Highlight focused panel" checkbox.
Screenshot showing source panel having focus:
Screenshot showing console panel having focus:
Approach
Uses the
focusinDOM event which is fired whenever focus changes in the page, then (if the option is enabled) checks if the currently focused element belongs to a panel and adds or removes the CSS stylefocusedWindowFrameObject. The CSS adds an outline.So this indicator is truly representing keyboard focus being within a panel, not just a logical concept of focus, and is helpful in diagnosing focus issues in general. Many of our commands that show a specific pane do not actually move focus to it (#5652). Also some operations such as using the main menu in RStudio Server can leave focus nowhere (actually on the page body), which will cause none of the panels to show the focus outline (#6197).
QA Notes
With option off, there should be no differences observable in the UI as you click/tab around the UI.
Then enable the option, and check that the dotted outline appears as you move focus around. Try F6 / Shift+F6 to move between panels via keyboard, or clicking or Tab key.
Check that you can see it with a variety of RStudio and Editor themes, and that is also works with source columns.
This mechanism is not active in secondary windows (popped out editor, Git, etc.).