-
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
Improve styles of filtering options for Clippy's lint list #8070
Improve styles of filtering options for Clippy's lint list #8070
Conversation
r? @camsteffen (rust-highfive has picked a reviewer for you, use r? to override) |
The dropdowns look really nice! I think there should be some sort of always-visible indicator of what is selected. Possibly just the number of selected items, or maybe even just a different style to indicate that the default selection has been changed. My main concern being that it's easy to forget that you are not looking at a complete list. |
Nice. I think the badge could be the same color as the lint category badges. Also can we see what it looks like on the right side of the button? |
Also, a +1 from me for the dropdown menus, they look really nice 👍 The website also supports the different color themes from mdBook. The change theme button is in the upper-left corner. Can you make sure that your changes also support the change of color? You can find the available css values here: https://github.com/rust-lang/mdBook/blob/master/src/theme/css/variables.css |
@xFrednet @camsteffen Have a look on this video: ClippyLints.mp4 |
I really like it, nice work! 👍 Also cc: @flip1995 since you've suggested this tabbed filter layout. 🙃 |
I am seeing JavaScript errors upon selecting options. The button style seems to change from selected to deselected after clicking one of the options. Maybe this could be fixed with a CSS rule? If not it's probably fine. |
I could see the error in Firefox browser, but not in Chrome. Replaced invalid code with correct one.
There was a style from bootstrap. I replaced it with custom one. Now selected drop-down should be slightly darker than others. |
I think it would be wise to use the Bootstrap dropdown js plugin (link), especially since we're already using Bootstrap CSS. This would be an added dependency though. @rust-lang/clippy Everyone good with the general direction here? |
I like the general approach and how the drop down menus look. I don't know anything about JS / CSS, so I can't really review or give opinions on that front. Only concern is, if it works and how it looks on mobile. |
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.
Selecting "All" has a small lag. This was especially noticeable on mobile.
Here's a link to a deployed version of this branch (rebased on current master): https://flip1995.github.io/rust-clippy/master/index.html
One issue I found on mobile is, that the color scheme drop down is behind the other drop downs. Otherwise it LGTM on mobile as well.
The "Filter" field could be on the same line and wrap responsively. |
Implemented this one.
Fixed this one
Does it support multi-select? As you can see, current dropdown supports selecting multiple entries. Also, it doesn't close dropdown, so user can select multiple items and close it by clicking on the button or somewhere in the page. |
Another thing we could do about the lag is make the lint panel expanded contents render lazily with something like
I'm only judging by the docs, but I think the dropdown plugin is pretty unopinionated - you can put any HTML in the dropdown menu and you can close it programmatically like you currently are (but I would try out the default behavior first). |
Redeployed: https://flip1995.github.io/rust-clippy/master/index.html Another thing I noticed on mobile (tangentially related to this PR): The "Fork me on GitHub" banner in the top right corner slightly overlaps with the Lint groups dropdown. So when you try to open the dropdown by pressing on the error it redirects you to the Clippy GH repo, instead of opening the dropdown. |
Fixed this issue with |
@flip1995 @camsteffen @xFrednet I went through all the reviews, and it looks like all the issues are resolved. Let me know if I missed something. |
Oh I didn't realize it requires jQuery. That's fine then. I hate jQuery lol. I still need to do a full review but I feel confident about this PR overall. |
The performance increase while searching is wonderful. I really like the changes! |
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 looks really good now. I love the perf improvement. Thank you for addressing all of our reviews so quickly!
Before this can be merged, please rebase your commits, in order to get rid of the merge commit.
0a54144
to
2eaa17e
Compare
I rebased my commits and added one new change:
|
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.
color: var(--searchbar-fg); | ||
border-color: var(--theme-popup-border); | ||
filter: brightness(90%); | ||
} |
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.
Bootstrap theming is normally done by downloading bootstrap-theme.css
and modifying the values. We don't need an entire theme, but I think we should copy parts of that code, and add a comment saying as much.
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.
These variables are coming from rust mdBook styles. Which code do you mean?
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.
You can get bootstrap-theme.css
from the "Download Bootstrap" link here.
From there you can copy and modify the following CSS rule, for example. Ideally all theming can be done this way.
/* Bootstrap Theme - rules copied from bootstrap-theme.css with modified values */
.btn-default:active,
.btn-default.active {
- background-color: #e0e0e0;
- border-color: #dbdbdb;
+ background-color: var(--searchbar-bg);
+ border-color: var(--theme-popup-border);
}
5e42d1e
to
296af08
Compare
@camsteffen I reviewed your suggestions and applied them. One comment is still under review, have a look. Let me know if you have any other concerns. |
@CrazyRoka just checking in. There's still one open thread. But honestly it's not super important and we can just wrap this up if you prefer. |
Hey @camsteffen, do we want to merge it, since @CrazyRoka hasn't replied yet? I like these changes and would like to have them merged before they conflict with new changes 🙃 |
Okay. @bors r+ |
📌 Commit 296af08 has been approved by |
…msteffen Improve styles of filtering options for Clippy's lint list Particularly solves #7958 Updated styles for filtering options. It now uses dropdown menus. ![image](https://user-images.githubusercontent.com/19844144/144608479-cdd9de0b-f101-4d49-a135-0969efb01a11.png)
💔 Test failed - checks-action_test |
@bors retry |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Partially solves #7958
Updated styles for filtering options. It now uses dropdown menus.
changelog: none