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

Support reading a object type setting with simple value types #234517

Merged
merged 4 commits into from
Nov 27, 2024

Conversation

sandy081
Copy link
Member

@sandy081 sandy081 commented Nov 24, 2024

With #84756, I have added a new setting extensions.allowed that will have a list of extensions that will be allowed. The value of this setting is of type object and the value of each key is true | false | "stable" | array of string versions. At present user can view the value of this setting only from settings.json file. If it is made a policy setting then the setting editor does not support showing the value of this setting.

Hence, I added support for showing the value of such setting type where the value is an object with simple value types. User can now view the value from the settings editor and to update we show the link to edit in settings.json file as below

image

@sandy081 sandy081 self-assigned this Nov 24, 2024
@sandy081 sandy081 enabled auto-merge (squash) November 24, 2024 21:23
@vs-code-engineering vs-code-engineering bot added this to the November 2024 milestone Nov 24, 2024
Copy link
Contributor

@rzhao271 rzhao271 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. When I edit the setting in settings.json, accept the default value '*', and go back to the Settings editor, I get an error message saying "Setting has an invalid type".
  2. Using a link instead of a button for "Edit in settings.json" LGTM because clicking on it changes the view. Could you add some padding between the table and the link so that the link doesn't look like it's one of the table entries? Also, NVDA states the element is a button instead of a link, even though it looks like a link. Could the element type be changed to a link?

@sandy081
Copy link
Member Author

Thanks for the feedback.

When I edit the setting in settings.json, accept the default value '*', and go back to the Settings editor, I get an error message saying "Setting has an invalid type".

Good catch. It is currently a limitation because of the policy setting. Please check this note here:

// Note: Type is set only to object because to support policies generation during build time, where single type is expected.

Also, NVDA states the element is a button instead of a link, even though it looks like a link. Could the element type be changed to a link?

I took the same link element from complex setting renderer here:

const openSettingsButton = DOM.append(common.controlElement, $('a.edit-in-settings-button'));
openSettingsButton.classList.add(AbstractSettingRenderer.CONTROL_CLASS);
openSettingsButton.role = 'button';

Do you want to change both then?

@sandy081 sandy081 closed this Nov 26, 2024
auto-merge was automatically disabled November 26, 2024 11:45

Pull request was closed

@sandy081 sandy081 reopened this Nov 26, 2024
Copy link
Contributor

@rzhao271 rzhao271 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll take another look at the complex link/button during debt week or housekeeping.
LGTM!

@sandy081 sandy081 merged commit 709e28f into main Nov 27, 2024
12 checks passed
@sandy081 sandy081 deleted the sandy081/inherent-halibut branch November 27, 2024 08:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants