eslint.org icon indicating copy to clipboard operation
eslint.org copied to clipboard

Suggestion: [playground] Provide an option to reset to the default configuration

Open amareshsm opened this issue 1 year ago • 4 comments

What problem do you want to solve?

Currently, in the playground, if we modify some configurations and later wish to revert to the default settings, it can be challenging for the user to remember the newly added configurations and remove them correctly to return to the default Config.

For instance, if a user enables all the rules to check for all errors and then wants to revert to the default configuration, it will be very difficult for them.

What do you think is the correct solution?

We provide a 'Reset to Defaults' button in the UI, which restores the configuration to its default (initial) Configs.

Refs: Screenshot 2024-06-27 at 11 45 19 PM Screenshot 2024-06-27 at 11 47 04 PM

Participation

  • [X] I am willing to submit a pull request for this change.

Additional comments

We provide a 'Reset to Default' button in the UI similar to the below image. Open for any other suggestions also.

Screenshot 2024-06-28 at 12 06 08 AM

amareshsm avatar Jun 27 '24 18:06 amareshsm

This seems helpful, I'm fine with this change. I'd like to know what other team members think.

// @eslint/eslint-team

snitin315 avatar Jun 30 '24 04:06 snitin315

Personally, I support this proposal :+1: I've often been the guy who was looking for that button, only to realize it wasn't there every time again. Even so, I'm aware of recommendations not to use reset buttons in forms for various reasons like this one, or this one from MDN (in the note), so I'd be interested in other opinions.

fasttime avatar Jun 30 '24 09:06 fasttime

👍 from me on the proposal in general, and also 👍 on @fasttime's comment that this should not fall into the common reset button accessibility traps. At the very least the solution should have an 'undo' option per https://www.w3.org/WAI/WCAG2/supplemental/patterns/o4p05-form-undo.

JoshuaKGoldberg avatar Jun 30 '24 21:06 JoshuaKGoldberg

👍 from me on the proposal in general, and also 👍 on @fasttime's comment that this should not fall into the common reset button accessibility traps. At the very least the solution should have an 'undo' option per https://www.w3.org/WAI/WCAG2/supplemental/patterns/o4p05-form-undo.

Naming the button as "Revert to Default," "Clear Custom Configs," or "Restore to Recommended Configs" would be suitable? Users might misunderstand "Undo" as reverting the last action performed.

amareshsm avatar Jul 13 '24 14:07 amareshsm

This reset will reset the entire playground right (all sections such as versions/rules/file-format)?

Maybe we should name it as Reset playground configs

harish-sethuraman avatar Aug 13 '24 05:08 harish-sethuraman