-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Use URL parameters for filter states #10834
Conversation
This retains the settings during browser navigation and allows sharing links with additional configuration.
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @xFrednet (or someone else) soon. Please see the contribution instructions for more information. Namely, in order to ensure the minimum review times lag, PR authors and assigned reviewers should ensure that the review label (
|
Hey @whee, thank you for the PR, I'm excited to see this idea becoming a reality!! I haven't looked at the code yet, but played with the linked version. (Thank you for hosting it :D). It already works wonderfully. I have a few suggestions which would make it feel better for me:
As said, I haven't looked at the code yet, so if any of these changes are intentionally or explained there, I'll see it later. Besides these functionally nits, I do love this functionality! Next week I have exams coming up, so it'll most likely take until the end of the week, until I can review the code. You are welcome to push any changes, if you agree with my suggestions above :) |
I appreciate the feedback @xFrednet! I'll try to address each of your points:
The scenario I wanted to address was:
Clicking "Default" explicitly is a good indicator that the user wants defaults and not a specific set, though, when compared to clicking the checkboxes and coincidentally matching the defaults.
I'll try to get these changes in soon. Good luck with exams! |
…nput Update on blur, enter keypress, and a debounced delay of 1000 ms. This keeps the URL updated, but not distractingly so.
Hey, I finally have time to look at this properly, sorry that it took so long. I should be done with my semester now 🎉
I don't think many people will bookmark specific filters. And even then, I think it's unlikely that the filters will change much. We had two changes to the default in the last two years and one of them was the addition of a new lint group. I see arguments for both sides here :) |
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.
The changes look good to me, I'm not an JS expert, but the code makes sense and is even a bit cleaner in parts. Thank you!
I would still be in favor of removing the filter from the URL if the default has been manually selected. As said, we rarely change the filter and even in those cases I would guess that the user would like the defaults over their custom filter, if the filter is equivalent to the current default anyways. For example, if a new lint group would be added, they would probably one that one to be selected.
My main argument for this, is that it would make the URL a lot shorter in most cases.
Another change I would like to see, is that the All
button for lint levels also removes the filter from the URL, as it's equivalent to the Default
button for lint groups.
Besides those nits, I think this looks really promising. Thank you for the time you put into this!
Thanks for taking a look!
Makes sense to me. I'll let you know when I have the rest of the tweaks in and think it's ready for another peek. |
Simplifying the handling of default values was a good call; the code got a bit simpler as well. Hopefully this behavior makes a bit more sense: (This PR matches that deployed version.) The only change I haven't been able to make is getting that |
It looks a bit odd, but the old links still work and the new links also work, so I think it's fine either way. That was a tiny nit, but I don't think we should block the PR based on this :) With that, I can say that this version looks good to me. Thank you for this update, I think it turned out pretty well! @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
This fixes #8510 by storing Clippy Lints page filter configuration in the URL parameters.
This includes:
"Filter" was already present in the URL and its behavior is retained. There is existing support for passing a
sel
query parameter; this is also retained, but I am not sure if it used in the wild.The URL parameters only get included if they are modified after loading the page.
I have these changes available here in case people want to play with it: https://whee.github.io/rust-clippy/master/
An example with levels, groups, and versions set (oddly):
https://whee.github.io/rust-clippy/master/#/?groups=pedantic,perf&levels=allow,warn&versions=gte:53,lte:57,eq:54
Adding a filter:
https://whee.github.io/rust-clippy/master/#/manual_str_repeat?groups=pedantic,perf&levels=allow,warn&versions=gte:53,lte:57,eq:54
changelog: Docs: [
Clippy's lint list
] now stores filter parameters in the URL, to allow easy sharing#10834