Skip to content

Modified document body to adjust left margin according to toggling on off of side bar in docs. #88301

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

Closed
wants to merge 5 commits into from

Conversation

amaush
Copy link

@amaush amaush commented Aug 24, 2021

When browsing the documentation locally, I frequently have to jump around different files and the keeping the side bar open is not possible because it overlaps with the page. Like this
old_open_menu

The minimal changes that I made allow the menu to stay open thus easing navigation within a project.
open_menu

r? @steveklabnik

@rust-highfive
Copy link
Contributor

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez

@rust-highfive
Copy link
Contributor

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @CraftSpider (or someone else) soon.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 24, 2021
@GuillaumeGomez
Copy link
Member

This is a good idea. Not sure if changing the left property on the <body> is a good idea though...

@jackh726 jackh726 added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Aug 24, 2021
@amaush
Copy link
Author

amaush commented Aug 24, 2021

The other option is to apply the fix on the main class but that leaves the search bar partially hidden which could be fine I suppose.

main_class

Another minor issue is that without applying some kind of css animation, the toggling is rather abrupt. I applied the minimum change that would get the side bar to stop overlaying the text in keeping with the established style already in the file as a guideline. I don't know what the policy is re: transitions which would make it more polished.

@GuillaumeGomez
Copy link
Member

Please add a CSS transition then.

I just thought about something as well: we could make the files sidebar top not go up to the top of the page so we don't have to wonder about the search input. Reminds me of what we did recently on docs.rs haha.

@rust-lang/rustdoc: Which approach do you prefer?

@amaush
Copy link
Author

amaush commented Aug 24, 2021

I added a transition to make it feel a bit more natural as well as fixing the logo which was obscured previously. I have tested it in Chrome 92 and Firefox 91.

transition.mp4

@rust-log-analyzer
Copy link
Collaborator

The job mingw-check failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
configure: rust.channel         := nightly
configure: rust.debug-assertions := True
configure: llvm.assertions      := True
configure: dist.missing-tools   := True
configure: build.configure-args := ['--enable-sccache', '--disable-manage-submodu ...
configure: writing `config.toml` in current directory
configure: 
configure: run `python /checkout/x.py --help`
configure: 
---
ES-Check: there were no ES version matching errors!  🎉
+ eslint ../src/librustdoc/html/static/js/main.js ../src/librustdoc/html/static/js/search.js ../src/librustdoc/html/static/js/settings.js ../src/librustdoc/html/static/js/source-script.js ../src/librustdoc/html/static/js/storage.js

/checkout/src/librustdoc/html/static/js/main.js
  193:17  error  'getCurrentValue' is not defined  no-undef
  207:17  error  'getCurrentValue' is not defined  no-undef

✖ 2 problems (2 errors, 0 warnings)

@camelid
Copy link
Member

camelid commented Aug 25, 2021

rust-lang/rust has a "No-Merge Policy". Please rebase instead of merging in upstream changes. Detailed instructions are here. Thank you!

@JohnCSimon
Copy link
Member

ping from triage:
@amaush
Returning to you to address build failures and after that, please switch back to S-waiting-on-review.
thanks.

@rustbot label: +S-waiting-on-author -S-waiting-on-review

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 13, 2021
@jsha
Copy link
Contributor

jsha commented Sep 24, 2021 via email

@jsha
Copy link
Contributor

jsha commented Sep 27, 2021

I took a look at how we handle sidebars on doc pages, and it's the same as you have it here, so please disregard my prior feedback.

@GuillaumeGomez
Copy link
Member

We could do something similar to what we did in docs.rs: rust-lang/docs.rs#1464 (having the sidebar always visible with a button to expand it).

@JohnCSimon
Copy link
Member

ping from triage:
@amaush
can you address the comments from the reviewer?

@JohnCSimon
Copy link
Member

ping again from triage:
@amaush
can you address the comments from the reviewer?

@GuillaumeGomez
Copy link
Member

#89385 actually took over so I think it's best to close this PR.

Thanks a lot for starting this @amaush! Don't hesitate to give a try to another part of rustdoc if you have time. 😉

@jyn514 jyn514 closed this Nov 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.