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: macOS touchbar #34760

Closed
2 tasks done
bpasero opened this issue Sep 21, 2017 · 5 comments
Closed
2 tasks done

Test: macOS touchbar #34760

bpasero opened this issue Sep 21, 2017 · 5 comments

Comments

@bpasero
Copy link
Member

bpasero commented Sep 21, 2017

Refs: #14653

Complexity: 3

We enabled support to show commands (with either icon or label) in the macOS touch bar. The commands are context aware and registered per window (switching windows will update the touch bar).

Built-in

  • verify out of the box you get touch bar entries that you can use
  • verify the debug touch bar behaves properly depending on your debug state (running, not running, stopped) and all commands work

Extensions
Extensions can add new commands via the menu API by registering to the touchBar location:

"contributes": {
	"menus": {
		"touchBar": [
			{
				"command": "markdown.showPreview",
				"when": "editorLangId == markdown",
				"group": "navigation"
			}
		]
	}
}

Verify you can register commands to the touch bar and then when condition is respected. The touch bar will always take the context of the active editor to resolve the commands. The resource of the active editor will be passed to the command you register as context.

Note: your command can either have a label or icon. If you chose an icon, make sure to use PNG, as SVG is currently not supported.

@bpasero bpasero added this to the September 2017 milestone Sep 21, 2017
@jrieken jrieken modified the milestone: September 2017 Sep 26, 2017
@alexdima
Copy link
Member

alexdima commented Sep 26, 2017

This is super cool! Is there a way for our main-side code to easily participate in there?

Ideas:

  • when focus is in the find widget, the touchbar should have prev/next icons for prev/next matches
  • when focus is in a diff editor, the touchbar should have prev/next icons for prev/next change

@bpasero : The only surprising thing is that contributing an icon paints both the icon and the text... The space will quickly run out ... Perhaps it can only paint the icon as we do in other places.

@alexdima alexdima removed their assignment Sep 26, 2017
@bpasero
Copy link
Member Author

bpasero commented Sep 26, 2017

@alexandrudima yeah we do not show the label when an icon is present, in your case I suspect an issue with how Electron decides to update the touch bar entries when a change occurs on that level (e.g. I added a label and then added an icon and briefly I saw both showing up but after a full restart only the icon was showing up).

It is very simple to contribute more entries based on a specific context, e.g. see the code for the debug buttons here. Basically all you need is a command and a context.

Space is indeed a bit limited down there and I am trying to optimize for a good experience when the debug toolbar is fully visible. It seems that when there are too many items in the touch bar, the last items will simply be removed from the bar. Unfortunately per group of buttons, the entire group will disappear, not just the last buttons. In the case of the debug tool bar this would mean to loose the entire tool bar.

Maybe file new issues for your suggestions so that we can keep them in mind.

@alexdima
Copy link
Member

Created #35137 and #35138

@varunkumar
Copy link

It would be great to get a first class API to play with TouchBar. Perhaps, a subset of whatever Electron offers. I feel its very restrictive to have access to TouchBar via contribution points only. I wrote an extension which uses completionProvider and want my suggestions to show up on TouchBar. Having an API would be helpful.

@auchenberg
Copy link
Contributor

Touchbar works overall.

Created #35242 and #35244

@auchenberg auchenberg removed their assignment Sep 27, 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.
Projects
None yet
Development

No branches or pull requests

5 participants