atom / settings-view

🔧 Edit Atom settings
MIT License
272 stars 275 forks source link

add hidden property #1144

Closed UziTech closed 1 year ago

UziTech commented 4 years ago

Description of the Change

Allow certain config settings to be hidden from the settings panel.

{
    "config": {
        "someSetting": {
            "type": "boolean",
            "default": false,
            "hidden": true
        }
    }
}

Alternate Designs

Use an automatically collapsed object to hide the settings, but they can still be shown.

image

Benefits

packages can hide configuration settings that users shouldn't change manually.

Possible Drawbacks

none

Applicable Issues

1143

UziTech commented 4 years ago

@atom @rafeca @nathansobo any feedback?

UziTech commented 4 years ago

@atom @50Wliu @lee-dohm @Arcanemagus @jasonrudolph

Did this get looked at? Is it on anyone's TODO list?

UziTech commented 4 years ago

@atom @50Wliu @lee-dohm @Arcanemagus @jasonrudolph @rafeca @nathansobo @lkashef @smashwilson

Has anyone looked at this? I feel like it shouldn't be too much to ask for someone to look at a PR within 3 months.

the-j0k3r commented 3 years ago

packages can hide configuration settings that users shouldn't change manually.

You mean via UI, cause it obviously would be able to be changed manually.

UziTech commented 3 years ago

Yes, which is why I said shouldn't change manually not can't change manually

UziTech commented 3 years ago

Sync-settings has a few config properties that are hidden. For example, the time of the last back. I thought about storing it in local storage instead but then ran into issues because local storage is not synced between Atom windows.

Pretty much any information a package needs to store and sync between Atom windows. As far as I know there isn't a better place to store that information.

idleberg commented 3 years ago

Use an automatically collapsed object to hide the settings, but they can still be shown

Could you explain the motivation for this? If the property is called hidden, why is the related setting visible in the UI? Hidden is the opposite of visible, this makes no sense.

Maybe you can answer the following questions:

Don't get me wrong, I understand the need for a developer to save settings that aren't meant to be edited by the user. I've done this myself using indexedDB or localStorage. If the config schema had a way to deal with "developer settings", I'd welcome it. I'm just questioning the semantics.

UziTech commented 3 years ago

are these settings just collapsed?

These settings would not be visible in the settings ui.

are these settings read-only in the UI and can only be edited through the Config API?

hidden in the ui but can be changed through the config api.

are they hidden in the UI unless some condition is met (e.g. atom.inDevMode())

always hidden

UziTech commented 3 years ago

Use an automatically collapsed object to hide the settings, but they can still be shown

That is an alternate design that works currently. This PR would hide it completely.