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

Switch Window #25145

Closed
chrmarti opened this issue Apr 21, 2017 · 19 comments
Closed

Switch Window #25145

chrmarti opened this issue Apr 21, 2017 · 19 comments
Assignees
Labels
feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@chrmarti
Copy link
Collaborator

  • Should have a keyboard shortcut (e.g., Ctrl + Shift + R).
  • Use the same labels as Open Recent (Ctrl + R) to not be confusing.
  • Show entries in MRU order.
  • Support cycling through by holding modifiers while pressing the main key repeatedly.
@chrmarti chrmarti added the feature-request Request for new features or functionality label Apr 21, 2017
@bpasero bpasero removed their assignment Apr 23, 2017
@bpasero
Copy link
Member

bpasero commented Apr 23, 2017

I think our current "Open Recent" is coming very close to this?

@chrmarti
Copy link
Collaborator Author

You might be right, I'll try working with that for a bit.

@bpasero
Copy link
Member

bpasero commented May 24, 2017

/cc @dbaeumer

@dbaeumer
Copy link
Member

@bpasero Thanks.

As discussed would be cool to cycle through them as we can cycle with Ctrl+P through files.

@bpasero
Copy link
Member

bpasero commented Jun 6, 2017

@chrmarti @dbaeumer now I just realized that we do have a picker for windows:

image

image

This is a good start, can you let me know how it works for you?

Meanwhile I am pushing the following changes to this picker:

  • make it discoverable from the picker help by using a quick open prefix "window "
  • allow to use the picker with quick navigate keys (so that you can bind a keybinding to navigate through windows and pick it when releasing that key)
  • show icons

image

I am not 100% convinced this list should be MRU, rather I think it should be stable and you should always start from the top to find your window. But I am open to change this if we think it does not work.

@bpasero bpasero added this to the June 2017 milestone Jun 6, 2017
@bpasero bpasero self-assigned this Jun 6, 2017
bpasero added a commit that referenced this issue Jun 6, 2017
bpasero added a commit that referenced this issue Jun 6, 2017
@chrmarti
Copy link
Collaborator Author

chrmarti commented Jun 6, 2017

Quick navigation works except for rare cases where it immediately navigates before I release the modifiers. (Using Ctrl+Shift+R for next, Ctrl+R for previous.)

It would be great if the labels would show the folder first and then its path, similar to Open Recent. The current list is hard to read.

@dbaeumer
Copy link
Member

dbaeumer commented Jun 6, 2017

What I like about Ctrl+R is that I don't have to think about whether the windows is open or not. With switch window I do :-). I am already a heavy user of Ctrl+R now.

@jens1o
Copy link
Contributor

jens1o commented Jun 6, 2017

Just tried it out.

LOVE IT. ❤️
I don't need something else, it's just great.

@chrmarti
Copy link
Collaborator Author

chrmarti commented Jun 6, 2017

What I miss with Open Recent (Ctrl+R) is the quick navigation (repeated Ctrl+R), maybe that can be added?

Having a list of only the open windows/folders like with Switch Window can be helpful because it represents my "working set".

I'm using Ctrl+R and Cmd+ quite often, but find both have their shortcomings, so I tried using Switch Window. (Cmd+ is Mac's shortcut to switch between windows of the same application.)

@bpasero
Copy link
Member

bpasero commented Jun 6, 2017

@chrmarti there is a bug with quick navigation that should be fixed in my new implementation, can you give it a try via "running out of sources"?

As for the labels, I chose to pick the exact same label that the window actually has and since the window title is configurable (via settings), maybe you can get it to a state where the label works for you? For example:

"window.title": "${rootName}${separator}${activeEditorShort}"

Produces:

image

@jens1o cool

@chrmarti @dbaeumer yes, we can add quick navigation to Ctrl+R, I can probably do that by turning it into a real picker, similar to what the window switcher is now. It seems to me that once we have that you would no longer use Switch Window. Is something else missing for the recent picker? Would you want to know which of the recent things is opened in another window?

@dbaeumer
Copy link
Member

dbaeumer commented Jun 6, 2017

Could only be the once sorted to the top. Or. Since it is LRU. I am fine without that info.

@bpasero
Copy link
Member

bpasero commented Jun 6, 2017

@dbaeumer it is worth mentioning that the "open recent" MRU sorting order is not influenced by you switching windows via Alt+Tab on Windows, it is only influenced by actually picking an entry from the list. As long as you stick to that, you are probably fine.

@chrmarti
Copy link
Collaborator Author

chrmarti commented Jun 6, 2017

Open Recent:

Having quick navigation and an indicator for which ones are already open would be great.

While I'm not entirely sure about the indicator, I think it might help navigate in the "working set". It would also help in knowing when to press Cmd (or Ctrl) to open the folder in a new window. Not sure what a good indicator would be, maybe the background color plus something?

Switch Window:

"window.title": "${rootName}${separator}${rootPath}" works well for me with windows on folders (the important case for me), windows without folders might benefit from an alternative label.

The issue with quick nav in Switch Window shows when running the latest from master.

I agree we might not need Switch Window if Open Recent can cover it.

@bpasero
Copy link
Member

bpasero commented Jun 6, 2017

@chrmarti what is your keybinding config for this when running out of master and what is your OS and what are your steps so that quick nav fails?

@dbaeumer
Copy link
Member

dbaeumer commented Jun 6, 2017

@bpasero the only thing I could think of having two groups like Ctrl+P has. One open and one recently open.

@chrmarti
Copy link
Collaborator Author

chrmarti commented Jun 6, 2017

@bpasero This is on Mac. Steps are:

  • Hit Ctrl+Shift+R twice without releasing Ctrl+Shift with releasing R between and at the end.
  • You'd expect the drop-down to stay, but it sometimes closes and switches the window.

This doesn't always happen and I can currently not reproduce. (If that sounds like the problem you fixed, maybe I was running from an old build state, although I thought I had updated that.)

[
	{
		"key": "ctrl+shift+r",
		"command": "workbench.action.switchWindow"
	},
	{
		"key": "ctrl+shift+r",
		"command": "workbench.action.quickOpenNavigateNext",
		"when": "inQuickOpen"
	},
	{
		"key": "ctrl+r",
		"command": "workbench.action.quickOpenNavigatePrevious",
		"when": "inQuickOpen"
	}
]

@bpasero
Copy link
Member

bpasero commented Jun 7, 2017

@chrmarti I can also not reproduce. What I noticed is that there is an issue with switching windows (= giving focus on it) during the keyup-phase so I added a short timeout here to unwind from the callback.

If you can ever reproduce again please see if tweaking that timeout helps.

bpasero added a commit that referenced this issue Jun 7, 2017
bpasero added a commit that referenced this issue Jun 7, 2017
@bpasero
Copy link
Member

bpasero commented Jun 7, 2017

I have pushed additional changes:

  • you can now bind to the new workbench.action.quickOpenRecent command to quick pick from recent
  • you can now bind to the new workbench.action.quickSwitchWindow command to quick pick from windows

Quick Switch Recent

{
	"key": "ctrl+r",
	"command": "workbench.action.quickOpenRecent"
},
{
	"key": "ctrl+r",
	"command": "workbench.action.quickOpenNavigateNext",
	"when": "inQuickOpen"
}

flicker_chrome58

Quick Switch Window

{
	"key": "ctrl+r",
	"command": "workbench.action.quickSwitchWindow"
},
{
	"key": "ctrl+r",
	"command": "workbench.action.quickOpenNavigateNext",
	"when": "inQuickOpen"
}

flicker_chrome58

@bpasero bpasero closed this as completed Jun 7, 2017
@bpasero bpasero added the verification-needed Verification of issue is requested label Jun 22, 2017
@bpasero
Copy link
Member

bpasero commented Jun 22, 2017

See #25145 (comment) for verification.

@roblourens roblourens added the verified Verification succeeded label Jun 28, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

5 participants