-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Rewrite lints page #13269
Rewrite lints page #13269
Conversation
Fixed both DOM issues. |
I've found that it's slower to load than the current site, not so much on my desktop but it's noticeable on my laptop/phone. There may be some value in keeping the Relatedly having to rerun |
It's slower but since I'm aiming at having the website work even with JS disabled, we can't do much about it unfortunately. I have some tricks up my sleeve to reduce the page size by a lot though. I wanted to send follow-ups since this PR is already quite big.
It's not really a big impact though. I don't expect many people will have this problem. |
To me that's not a worthwhile trade off |
It's the usual: do you prefer users accessibility or users comfort? And in this case, since I plan to make more changes, it might not even be one or the other once I'm done since like I said, I have a lot of others changes lined up. Let me describe them so maybe it'll help you in your decision:
And final argument: this website won't even need a server anymore once this PR is merged to work locally since the JSON file won't exist anymore. Meaning we can even distribute the website very easily and open it locally with |
Personally I find the ctrl + F behaviour of
Sounds good
Seems like it would be a neutral change size wise if it's added to the JS, the menus are pretty small anyway |
Mostly smaller devices like e-reader will have issues with JS. But in any case, it's bad practice to have the rendering done in two passes (one loading JS which in turn generates HTML) as it prevents to have information on the page directly.
Yes, but that's something I wanted to do in another PR originally. Do you want me to do it in this PR directly? Also please note that when hosted on a web server (so not locally), all queries are compressed so the download time shouldn't be impacted much.
Agreed, going to change it then (likely moving the theme-handling JS into a different file, loaded a the beginning).
This is a very good idea!
At least in firefox it doesn't expand
True. But I'll hide them if JS is disabled so at this point, why not just not generate them if the JS disabled. Less CSS required then. ;) |
Yes please, I think we should hit parity before landing it
I did my testing on a server with it hosted alongside the
Unfortunately chrome does |
Ok, going to do it another way (like I did in my blog for the "support me" button). But that's a task for another day anyway. Applying your suggestions in the meantime. |
Moved the theme handling code into its own file, removed some inlined CSS, only run syntax highlighting when needed (when expanding lints) and greatly reduced the generated HTML page size:
|
33a87a7
to
3dfb390
Compare
@Alexendoo Is there anything else to be done here? |
Applied the suggestion for the HTML comment, for the rest, I can't reproduce the bugs locally... |
Fixed the settings button icon position. |
☔ The latest upstream changes (presumably #13384) made this pull request unmergeable. Please resolve the merge conflicts. |
3ad763c
to
044a780
Compare
Fixed merge conflict. |
☔ The latest upstream changes (presumably #13440) made this pull request unmergeable. Please resolve the merge conflicts. |
0f524cf
to
549aba5
Compare
Got an idea on how to prevent this: I simply default numbers in the badges. They get updated when the JS loads but at least the layout doesn't change. Does it look good to you @Alexendoo ? |
549aba5
to
578c70b
Compare
Applied your suggestions, thanks a lot for the thorough reviews. :) |
Thanks, with a squash it looks good to go |
…before first rendering
Since all angular code was removed, there is no conflict anymore before angular and jinja2 syntaxes so we can just use plain jinja2 syntax.
578c70b
to
38a9811
Compare
I squashed some changes and rewrote some parts of the git history so the changes can still be tracked independently. Or do you want just one commit? |
38a9811
to
6039343
Compare
That's 👍 @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Documentation fixes - In [the page describing the lints](https://rust-lang.github.io/rust-clippy/master/index.html), the View Source links are incorrect. This PR removes the extra segment causing them to fail. - Example before: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/clippy_lints/src/absolute_paths.rs#L13 - Example after: https://github.com/rust-lang/rust-clippy/blob/master/clippy_lints/src/absolute_paths.rs#L13 - I think this was introduced in #13269. - I've only checked a few of the lints with the new template, but from what I can tell the metadata is generated in the same way for all of them. The `id_location` contains the full path of the lint declaration in the repository, which is why `clippy_lints` was repeated in the URL. - Separately, fixing a typo in the explanation of `unnecessary_get_then_check`. changelog: none
Allow to go through clippy lints page without javascript Fixes #13536. This is the follow-up of #13269. This PR makes it possible to expand/collapse lints (individually) without JS. To achieve this result, there are two ways: 1. Use `details` and `summary` tags. Problem with this approach is that the web browser search may open the `details` tags automatically if content matching it is inside. From a previous discussion with `@Alexendoo,` it seems to not be a desired behaviour. 2. Use a little trick where you use a `label` and a checkbox where the checkbox is in fact hidden. Then it's just a matter of CSS. r? `@Alexendoo` changelog: Allow to go through clippy lints page without JS
This PR has multiple goals:
r? @Alexendoo
changelog: make lint page work without web server