microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.14k stars 28.83k forks source link

`openLabel` not rendered for simple file dialog #194519

Open joyceerhl opened 1 year ago

joyceerhl commented 1 year ago
  1. Call vscode.window.showOpenDialog({ openLabel: 'some message' }) in a remote window or with "files.simpleDialog.enable": true
  2. :bug: openLabel isn't rendered anywhere
alexr00 commented 1 year ago

@TylerLeonhardt it looks like the quick input doesn't support overriding the label of the "OK" button. Am I reading that correctly? I know about the custom button for quick input, but I can't use it in this case because the simple file picker already uses it for something else.

TylerLeonhardt commented 1 year ago

You're correct. You only get:

We could have the ability to override "OK" to something else... but that might make the button look to wide. I almost feel like the placeholder in the input or the title is a better case for this openLabel as it is basically the prompt.

What do you think?

alexr00 commented 1 year ago

The simple file dialog fills the input box with the path, so placeholder won't work. The title is always set to "Open File", but we can use the open label if it's set. The extension can set the title, and the openLabel specifcially has this documentation:

https://github.com/microsoft/vscode/blob/4f7a76b792d38dcf576c831efc3f5c40cd6624e2/src/vscode-dts/vscode.d.ts#L1993-L1995

TylerLeonhardt commented 1 year ago

Fair enough. Yeah I think it's a fair ask to be able configure the OK button's text. Honestly we really should have like:

or maybe any number of buttons... but that could be more cumbersome as one would need to be marked primary so to ensure something fires onDidAccept