Skip to content

Edit object type settings from the settings GUI #99635

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

Closed
9 tasks done
9at8 opened this issue Jun 8, 2020 · 3 comments
Closed
9 tasks done

Edit object type settings from the settings GUI #99635

9at8 opened this issue Jun 8, 2020 · 3 comments
Assignees
Labels
feature-request Request for new features or functionality on-testplan settings-editor VS Code settings editor issues
Milestone

Comments

@9at8
Copy link
Member

9at8 commented Jun 8, 2020

A lot of settings expose configuration in the form of simple non-nested objects. It will be useful to explore different ways to expose editing functionality for these kinds of objects in the GUI.

Before After
image image

Non-nested objects can be broadly put in three different categories:

  1. Static Objects
    • All properties are defined using the properties keyword and default values for all properties are defined.
    • All the properties along with their default values are rendered in the GUI in a tabular format.
    • No additional properties may be added.
    • None of the existing properties can be removed. Instead, each property can be reset to its default value.
  2. Dynamic Objects
  3. A mix of static and dynamic objects

Requirements ✅

  • Optimistic UI - setting should update when immediately, rather than just firing the change event, and waiting for the data to flow in.

Static Objects

  • Show all keys with their default value
  • Show a revert to default value button
  • Hide the 'Add Item' button
  • Keys should not be editable

Dynamic Objects

  • Show all the configured pairs
  • Show the 'Add Item' button
  • Show the remove button
  • New value widget should match additionalProperties / patternProperties type

Some unknowns 🤔

  • Should we limit the number of settings that are shown in the GUI? 10 pairs are fine, but what about 100 pairs? Do such settings exist?
  • Should we show a blue bar beside each pair that's edited? (just like other settings)
  • What should validators look like? Should key-value pairs be validated individually?
  • How should boolean values be rendered?
    • If an object has all values of type boolean, then we should render checkboxes, just like everywhere else in the settings UI.
    • What if an object has a mixture of boolean values and other primitives?
  • Should an autocomplete be shown when adding a new key-value pair?

Impacted Settings ⚙️

  • files.associations
  • emmet.includeLanguages
  • emmet.variables

This is not a complete list. Settings that have type object and define either properties, patternProperties or additionalProperties as a non-nested object might be impacted.

Prototypes

You can play around with the setting by using the insiders build of VSCode.

Latest Prototypes (in insiders)

Example from the go extension:

image

Example: files.associations

image

Old prototypes

Example from the go extension:

image

Example: files.associations

image

cc: @roblourens

@9at8 9at8 added feature-request Request for new features or functionality settings-editor VS Code settings editor issues labels Jun 8, 2020
@JacksonKearl
Copy link
Contributor

You'll want to explicitly add a Milestone to every feature-request or else the bot will auto-assign it to our candidate milestone.

@JacksonKearl JacksonKearl removed this from the Backlog Candidates milestone Jun 8, 2020
@microsoft microsoft deleted a comment Jun 8, 2020
@9at8 9at8 added this to the June 2020 milestone Jun 8, 2020
@savannahostrowski
Copy link

@9at8 With this work, would it be possible to render enums values as a dropdown in the UI? For my specific use case, this would make the UX much better by preventing users from having to read external documentation.

In an ideal case, the keys would be hard-coded in the UI for that setting, and the values would be dropdowns.

@9at8
Copy link
Member Author

9at8 commented Jun 8, 2020

@savannahostrowski yes!

@joaomoreno joaomoreno assigned roblourens and 9at8 and unassigned roblourens Jun 30, 2020
@9at8 9at8 closed this as completed Jul 2, 2020
9at8 added a commit to 9at8/vscode-go that referenced this issue Jul 3, 2020
I'm working on making simple non-nested object type settings editable from the settings GUI in vscode (microsoft/vscode#99635), and I think that setting `"additionalProperties": false` for the objects that don't expect more properties would be great!
gopherbot pushed a commit to golang/vscode-go that referenced this issue Jul 15, 2020
When I'm working on making simple non-nested object type settings editable from the settings GUI in vscode (microsoft/vscode#99635), and I think that setting `additionalProperties` to `false` for the objects that don't expect more properties would be great!

As per microsoft/vscode#101810, vscode (v1.48) will hide the "Add item" button if and only if `additionalProperties` is `false` and all known properties are present.

Change-Id: I92380610b24f7cd6ee790f2e020b9c689c3ff25b
GitHub-Last-Rev: 695aa78
GitHub-Pull-Request: #284
Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/240907
Reviewed-by: Hyang-Ah Hana Kim <[email protected]>
@github-actions github-actions bot locked and limited conversation to collaborators Aug 16, 2020
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 on-testplan settings-editor VS Code settings editor issues
Projects
None yet
Development

No branches or pull requests

5 participants
@roblourens @9at8 @JacksonKearl @savannahostrowski and others