Repository navigation
Fix Console output focus outline after mouse focus; focus a hidden Console - #19823
Merged
Merged
Conversation
Focus Console Output called focus() on a chunk the browser wasn't rendering, so with the Console minimized, behind another tab, or hidden by a maximized pane, nothing happened and nothing was announced. It now activates the Console and waits for it to finish showing, sharing the retry loop Focus Last Console Error already used. Addresses #19812.
Run the hidden-Console restore cases for Focus Console Output as well as Focus Last Console Error, and add a case with the Console behind another tab. Addresses #19812.
…-pointer-focus-outline
RStudio E2E - all platformsAll tests passed!
All platforms - commit |
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.
Follow-up to #19818. Addresses #19812.
Outline after mouse focus
#19818 outlined the Console output whenever a chunk had focus without a mouse mark, and cleared that mark whenever focus left the output. Dialogs (
ModalDialogBase) and the main menu bar (BaseMenuBar.FocusTracker) blur the focused element and restore it afterwards. So a mouse user who drag-selected output and then opened Global Options, or chose Edit > Copy on Server, got the keyboard outline.The mark now records keyboard arrival instead:
ConsoleOutputWriter.focusEnd(), the only keyboard route onto a chunk, setsrstudio-keyboard-focus, and a mousedown in the output clears it. The mark is kept when focus leaves, so a dialog opened from keyboard focus brings the outline back when it closes. The mouse mark remains only for the rule that hides:focus-visibleon the output<pre>itself.Focus Console Output with a hidden Console
Focus Console Output did nothing, and announced nothing, when the Console was minimized, behind another tab, or hidden by a zoomed pane. It now activates the Console and retries until focus can land, using the loop Focus Last Console Error already had (moved into a shared
focusInConsolehelper). If focus still can't land, it announces "Could not move focus to the Console output".Testing
ConsoleOutputWriterTests: the keyboard mark is set byfocusEnd(), cleared by mousedown, and kept when focus moves elsewhere;hasOutput()andcanFocusEnd().console_pane.test.ts: the hidden-Console restore cases now run for both commands, with a new Console-behind-another-tab case. 16/16 pass on desktop-dev. The six minimized/behind-tab Focus Console Output cases fail with the fix reverted.