-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
feat: Add "Enable all rules" option in playground #462
Conversation
✅ Deploy Preview for new-eslint ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for ja-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for es-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for hi-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for fr-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for pt-br-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for de-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for zh-hans-eslint ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
I'm not sure the UI is right on this. If I check the checkbox then it adds all rules, but when I uncheck the box, I'm not sure what it's supposed to do. |
|
I don't think a checkbox is the right way to implement this. Maybe we should use a button instead? So it says "Enable All Rules" and when you click on it, it changes to "Reset Rules" (or something similar)? |
Yeah, we can have a button and change it accordingly. I will make the changes. |
changes made by me:
|
@nzakas can you take a look at this now? @eslint/website-team would like some review on this one? |
LGTM, I have updated the PR description with the latest changes. Thanks @harish-sethuraman |
@harish-sethuraman I'm still seeing the select even when all rules are enabled. I also feel that the button is just way too big. I don't think this is a common use case, so it shouldn't be reflected with such a large UI element. Instead, I'd suggest adding a link next to "Add Rule" that says "Add All Rules". |
@nzakas probably all the rules are not selected in the screenshot you shared? Can you try opening the dropdown to check if it is empty? because this is how it looks for me when all rules are selected. ![]()
|
I just checked again. When I click the button, I get errors in the console and nothing happens. I'm using Firefox. I still think the button is too big regardless of the functionality. |
@nzakas Have fixed the above issue. and changed the button to a smaller one similar to add rule button 👍🏻 |
Thanks! This is looking good. Only issue now: When I click "Enable all rules", it sets focus to the most recently added textbox. That works okay when there are no rules enabled, but if you already have a bunch of rules enabled, then it scrolls the entire side panel down. Can we change it so that it always sets focus to the first visible textbox instead? |
there are two cases
They both seem to be consistent. |
Yes, I'm saying this behavior is not desirable because it can cause the sidebar to scroll, which is very disorienting. |
I have updated the PR accordingly now it always sets focus to the first visible textbox. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect! Thanks for all the work on this.
Prerequisites checklist
What is the purpose of this pull request?
What changes did you make? (Give an overview)
Added "Enable all rules" option to enable all the rules in one go.
Screen.Recording.2024-01-25.at.1.23.00.AM.mov
Related Issues
#423
Is there anything you'd like reviewers to focus on?