-
-
Notifications
You must be signed in to change notification settings - Fork 3
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 esquery
selector textfield & highlighting of matched code
#80
base: main
Are you sure you want to change the base?
feat: Add esquery
selector textfield & highlighting of matched code
#80
Conversation
✅ Deploy Preview for eslint-code-explorer ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
20dc06d
to
928859e
Compare
928859e
to
9483a16
Compare
Thanks for putting this together. Some notes on the UI:
For some perspective, check out the typescript-eslint playground that has an ESQuery filter: |
sounds good, will do! |
I implemented all suggestions:
In order to have 1 place to apply the match nodes via the esquery selector, I added a The esquery matched nodes need to be prop-drilled everywhere, and the accordion highlighting is duplicated. That's not ideal but I think in the future we could refactor the code anyways to get the accordion code generalized at a central place. |
@nzakas @amareshsm plz re-review :) |
@pkerschbaum This is looking really nice! A few notes from playing around with it:
|
Also added the @nzakas @amareshsm plz re-review :) |
+1 with updating the color to one of the purple shades to align with the design we use across other ESLint sites. We’re using the color shade --color-primary-800 in other parts of the site. we can this change in separate PR also. |
@pkerschbaum no need to ask for reviews, we get the notifications. 😄 We just have a lot to get through every day so your patience is appreciated. Ah, I hadn't even noticed that the focus outline was the same in other form controls. We can leave it as-is for now. No need to bundle unrelated changes in this PR. Let's be sure to stick to the colors that are already in this file: These are all of our theme colors and we don't want to stray outside of that. I think one of the Overall this is looking really good. |
I implemented the rose-red highlighting when the esquery selector has no matches. |
In JSON language, when I enter "STRING" in the ESQuery selector, it causes the UI to break. |
damn, didn't see that... fixed with 4cd9966 |
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.
This is looking so good!
There's one strange behavior I found: When the ESQuery selector has no matches, the background turns reddish but only if the cursor isn't over the textbox. If the cursor is over the textbox, the background turns a lighter color and the reddish color is lost.
I think the reddish color should stay regardless of mouse position. What do you think?
Prerequisites checklist
What is the purpose of this pull request?
MVP for
esquery
selector playground (#79): textfield to enter selectors, matching code get's highlighted:Future ideas:
What changes did you make? (Give an overview)
TextField
, styled similar toButton
Related Issues
Fixes #79
Is there anything you'd like reviewers to focus on?