Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test UI: Steals focus/cursor when test error is reported #130629

Closed
smcenlly opened this issue Aug 12, 2021 · 4 comments
Closed

Test UI: Steals focus/cursor when test error is reported #130629

smcenlly opened this issue Aug 12, 2021 · 4 comments
Assignees

Comments

@smcenlly
Copy link
Contributor

smcenlly commented Aug 12, 2021

Version: 1.59.0 (Universal)
Commit: 379476f
Date: 2021-08-04T23:14:40.191Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Darwin arm64 20.5.0

Steps to Reproduce:

  1. Clone https://github.com/smcenlly/steal-focus-bug, install dependencies and open in VS Code
  2. Start in Debug/Run mode
  3. Open test.txt (should be an empty document in workspace root)
  4. Go to line 1 and press enter.

At this point, the extension is automatically scheduling a test run (the same way that Wallaby works) and is reporting results. In this case, we're simulating an error and providing the location for the error

  1. Note that the cursor briefly moves to line 2 and then the focus is automatically shifted by VS Code back up to line 1.
    image

This is a contrived example, the UX is much worse when you're actually typing and an error result is displayed and the cursor focus is changed while you're in the middle of making a change. When this happens, some of your text (before test result was available) is in the correct position, and other characters are in the wrong place.

@connor4312
Copy link
Member

This behavior can be configured with testing.automaticallyOpenPeekView, the intention being that if a user manually triggers a test run they probably want to immediately see any failure that happened. If Wallaby is doing its auto run, it could manually change this setting. Note that a formalized autorun mode is coming in the future and is configured via testing.automaticallyOpenPeekViewDuringAutoRun which defaults to false. I think that solves your scenario.

@smcenlly
Copy link
Contributor Author

I don't quite understand your response... I don't understand how to configure VS Code to not have this behavior. See my current settings:

image

The automaticallyOpenPeekView has two options for me:

  • failureVisibleInDocument
  • failureAnywhere

Should I be seeing another option? E.g. never?


Or are you saying that the behavior is expected for now but will be addressed in the future?

@connor4312
Copy link
Member

Oh, good catch. I added a "never" option in the linked commit.

AiverReaver pushed a commit to AiverReaver/vscode that referenced this issue Aug 19, 2021
@connor4312
Copy link
Member

Merging into #134941

@github-actions github-actions bot locked and limited conversation to collaborators Nov 26, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants