-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Transform help popup into a pocket menu #98297
Conversation
Some changes occurred in HTML/CSS/JS. |
Why is it so wide? This is wider than the current help menu, and wider than the settings menu. It seems like keeping it similar width as the settings menu (it doesn't have to be exact) would increase harmony between the two. |
80f2d9b
to
3ec82da
Compare
Making it the same width would require a lot of height so instead I limited its width to |
This comment has been minimized.
This comment has been minimized.
3ec82da
to
e428aaf
Compare
Fixed eslint errors. |
Nice, great catch! I'll fix it tomorrow. :) |
e428aaf
to
653ad2e
Compare
I updated the demo. The blur and style are now correctly handled. |
653ad2e
to
92b39b3
Compare
I also extended the GUI test to ensure that all borders have the same color. |
How to get both Settings and Help opened at once (at least in Firefox)
How to fix itInstead of solving this in an ad-hoc way by tying Help and Settings close together, I recommend some principled code reuse between these two popovers.
|
It would be much simpler to just hide the other |
3e8f3ea
to
90ad149
Compare
So instead of setting a JS global variable, I simply hide all popovers before showing a new one. Much simpler this way. :) As for the CSS, what would you simplify? |
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 probably going to be the last set of critiques. A lot of rustdoc's CSS seems overly complicated, but doing a comprehensive cleanup should be a separate PR.
I think the way you wrote the window.hidePopoverMenus
function is good. Better than using a global variable. Thanks!
@@ -1387,7 +1396,7 @@ pre.rust { | |||
#copy-path { | |||
height: 34px; | |||
} | |||
#settings-menu > a, #help-button, #copy-path { | |||
#settings-menu > a, #help-button > button, #copy-path { |
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 selector is pretty complicated. Could it be a utility class instead?
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.
Just in case: it's not one selector but three different selectors on which we apply the same rules. If it was what you understood, I'm not sure to understand how simpler it could be though...
You're right, but we're maybe not thinking about the same thing. 😆 I have two cleanups in mind:
|
90ad149
to
e4b2b41
Compare
I simplified the CSS rule as @notriddle suggested. |
…notriddle Transform help popup into a pocket menu Just like we moved the settings menu into a "pocket menu", it's doing the same to the help popup. You can test it [here](https://rustdoc.crud.net/imperio/help-pocket-menu/doc/foo/index.html) and here is a screenshot: ![Screenshot from 2022-06-20 20-58-29](https://user-images.githubusercontent.com/3050060/174663718-538e9d11-3bf9-48b2-8909-f9bfe75af135.png) r? ``@jsha``
…notriddle Transform help popup into a pocket menu Just like we moved the settings menu into a "pocket menu", it's doing the same to the help popup. You can test it [here](https://rustdoc.crud.net/imperio/help-pocket-menu/doc/foo/index.html) and here is a screenshot: ![Screenshot from 2022-06-20 20-58-29](https://user-images.githubusercontent.com/3050060/174663718-538e9d11-3bf9-48b2-8909-f9bfe75af135.png) r? ```@jsha```
…notriddle Transform help popup into a pocket menu Just like we moved the settings menu into a "pocket menu", it's doing the same to the help popup. You can test it [here](https://rustdoc.crud.net/imperio/help-pocket-menu/doc/foo/index.html) and here is a screenshot: ![Screenshot from 2022-06-20 20-58-29](https://user-images.githubusercontent.com/3050060/174663718-538e9d11-3bf9-48b2-8909-f9bfe75af135.png) r? ````@jsha````
…notriddle Transform help popup into a pocket menu Just like we moved the settings menu into a "pocket menu", it's doing the same to the help popup. You can test it [here](https://rustdoc.crud.net/imperio/help-pocket-menu/doc/foo/index.html) and here is a screenshot: ![Screenshot from 2022-06-20 20-58-29](https://user-images.githubusercontent.com/3050060/174663718-538e9d11-3bf9-48b2-8909-f9bfe75af135.png) r? `````@jsha`````
…notriddle Transform help popup into a pocket menu Just like we moved the settings menu into a "pocket menu", it's doing the same to the help popup. You can test it [here](https://rustdoc.crud.net/imperio/help-pocket-menu/doc/foo/index.html) and here is a screenshot: ![Screenshot from 2022-06-20 20-58-29](https://user-images.githubusercontent.com/3050060/174663718-538e9d11-3bf9-48b2-8909-f9bfe75af135.png) r? ``````@jsha``````
…notriddle Transform help popup into a pocket menu Just like we moved the settings menu into a "pocket menu", it's doing the same to the help popup. You can test it [here](https://rustdoc.crud.net/imperio/help-pocket-menu/doc/foo/index.html) and here is a screenshot: ![Screenshot from 2022-06-20 20-58-29](https://user-images.githubusercontent.com/3050060/174663718-538e9d11-3bf9-48b2-8909-f9bfe75af135.png) r? ```````@jsha```````
…notriddle Transform help popup into a pocket menu Just like we moved the settings menu into a "pocket menu", it's doing the same to the help popup. You can test it [here](https://rustdoc.crud.net/imperio/help-pocket-menu/doc/foo/index.html) and here is a screenshot: ![Screenshot from 2022-06-20 20-58-29](https://user-images.githubusercontent.com/3050060/174663718-538e9d11-3bf9-48b2-8909-f9bfe75af135.png) r? ````````@jsha````````
…notriddle Transform help popup into a pocket menu Just like we moved the settings menu into a "pocket menu", it's doing the same to the help popup. You can test it [here](https://rustdoc.crud.net/imperio/help-pocket-menu/doc/foo/index.html) and here is a screenshot: ![Screenshot from 2022-06-20 20-58-29](https://user-images.githubusercontent.com/3050060/174663718-538e9d11-3bf9-48b2-8909-f9bfe75af135.png) r? `````````@jsha`````````
…askrgr Rollup of 11 pull requests Successful merges: - rust-lang#97140 (std: use an event-flag-based thread parker on SOLID) - rust-lang#97295 ([rustc_parse] Forbid `let`s in certain places) - rust-lang#97743 (make const_err show up in future breakage reports) - rust-lang#97908 (Stabilize NonZero* checked operations constness.) - rust-lang#98297 (Transform help popup into a pocket menu) - rust-lang#98428 (macros: use typed identifiers in diag and subdiag derive) - rust-lang#98528 (Respect --color when building rustbuild itself) - rust-lang#98535 (Add regression test for generic const in rustdoc) - rust-lang#98538 (Add a ui test for issue rust-lang#91883) - rust-lang#98540 (Add regression test for rust-lang#87558) - rust-lang#98541 (Update `std::alloc::System` doc example code style) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
…r=jsha Use CSS variables to handle theming This is the start for our simplification of theming. Considering how big the diff quickly becomes, I think it's better to do it in multiple parts. (The 3 first commits come from rust-lang#98297 so once it's merged, they'll disappear). Normally they shouldn't be any UI changes. You can check it [here](https://rustdoc.crud.net/imperio/css-simplification/doc/foo/index.html). cc `@notriddle` r? `@jsha`
Just like we moved the settings menu into a "pocket menu", it's doing the same to the help popup.
You can test it here and here is a screenshot:
r? @jsha