Skip to content

Optional highlight around focused panel - #7881

Merged
gtritchie merged 3 commits into
masterfrom
feature/show-focused-panel
Sep 25, 2020
Merged

gtritchie merged 3 commits into
masterfrom
feature/show-focused-panel

Conversation

@gtritchie

@gtritchie gtritchie commented Sep 25, 2020 •

Copy link
Copy Markdown
Member

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 of accessibility options showing highlight focused panel checkbox

Screenshot showing source panel having focus:

screenshot

Screenshot showing console panel having focus:

screenshot

Approach

Uses the focusin DOM 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 style focusedWindowFrameObject. 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.).

@gtritchie gtritchie added this to the v1.4 milestone Sep 25, 2020
@jmcphers

Copy link
Copy Markdown
Member

Let's add a NEWS entry for this.

@gtritchie
gtritchie merged commit d928188 into master Sep 25, 2020
@valerie-rstudio
valerie-rstudio deleted the feature/show-focused-panel branch January 21, 2022 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Visually indicate which pane has focus

2 participants