Skip to content

Rustdoc mobile: put out-of-band info on its own line #92861

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jan 20, 2022

Conversation

jsha
Copy link
Contributor

@jsha jsha commented Jan 13, 2022

Before this, the item name and the stability, source link, and "collapse
all docs" would compete for room on a single line, resulting in awkward
wrapping behavior on mobile. This gives a separate line for that
out-of-band information. It also removes the "copy path" icon on mobile
to make a little more room.

Demo: https://rustdoc.crud.net/jsha/mobile-column-flex/std/string/struct.String.html

r? @GuillaumeGomez

@rust-highfive
Copy link
Contributor

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez,@Folyd

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Jan 13, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 13, 2022
@jsha jsha added the A-rustdoc-ui Area: Rustdoc UI (generated HTML) label Jan 13, 2022
@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member

Looks good to me! Please fix the GUI test and then I can take a last look.

@camelid camelid changed the title Rustdoc mobile: put out-of-band on its own line Rustdoc mobile: put out-of-band info on its own line Jan 15, 2022
@camelid camelid 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 Jan 15, 2022
@jsha jsha force-pushed the mobile-column-flex branch 2 times, most recently from 6643414 to eb1c38f Compare January 16, 2022 22:35
@jsha
Copy link
Contributor Author

jsha commented Jan 16, 2022

GUI test added!

@jsha jsha force-pushed the mobile-column-flex branch 2 times, most recently from c11a3cb to 1164741 Compare January 18, 2022 04:08
@GuillaumeGomez
Copy link
Member

r=me when #92830 is merged.

@bors
Copy link
Collaborator

bors commented Jan 18, 2022

☔ The latest upstream changes (presumably #93021) made this pull request unmergeable. Please resolve the merge conflicts.

@jsha jsha force-pushed the mobile-column-flex branch from 1164741 to b3ff7ae Compare January 18, 2022 18:09
@jsha
Copy link
Contributor Author

jsha commented Jan 18, 2022

@bors r=GuillaumeGomez rollup

@bors
Copy link
Collaborator

bors commented Jan 18, 2022

📌 Commit b3ff7aec8fb071fa10da497171957bc90ab81ba4 has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 18, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 18, 2022
…askrgr

Rollup of 9 pull requests

Successful merges:

 - rust-lang#90782 (Implement raw-dylib support for windows-gnu)
 - rust-lang#91150 (Let qpath contain NtTy: `<$:ty as $:ty>::…`)
 - rust-lang#92425 (Improve SIMD casts)
 - rust-lang#92692 (Simplify and unify rustdoc sidebar styles)
 - rust-lang#92780 (Directly use ConstValue for single literals in blocks)
 - rust-lang#92924 (Delete pretty printer tracing)
 - rust-lang#93018 (Remove some unused `Ord` derives based on `Span`)
 - rust-lang#93026 (fix typo in `max` description for f32/f64)
 - rust-lang#93035 (Fix stdarch submodule pointing to commit outside tree)

Failed merges:

 - rust-lang#92861 (Rustdoc mobile: put out-of-band info on its own line)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors
Copy link
Collaborator

bors commented Jan 19, 2022

☔ The latest upstream changes (presumably #93048) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors removed the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label Jan 19, 2022
@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jan 19, 2022
@jsha jsha force-pushed the mobile-column-flex branch from b3ff7ae to 17a06da Compare January 19, 2022 03:27
@jsha
Copy link
Contributor Author

jsha commented Jan 19, 2022

@GuillaumeGomez I decided to make some changes so this would work better and more consistently. They're substantive changes, so this will need a re-review.

The problem with the old way: Sometimes, even on a medium-sized screen (>700px), a type name will be long enough to bump into the out-of-band info. We'd like that situation to also bump out-of-band onto the next line.

To do that, I added flex-wrap: wrap on .main-heading, and set the spacing using justify-content: space-between rather than margin-left: auto (which would have caused out-of-band to stay flush-right even after it wrapped).

Here's an example of a name long enough to cause wrapping even on a >700px screen:

https://rustdoc.crud.net/jsha/mobile-column-flex/core/arch/x86/fn._mm512_test_epi16_mask.html

@bors
Copy link
Collaborator

bors commented Jan 19, 2022

☔ The latest upstream changes (presumably #93069) made this pull request unmergeable. Please resolve the merge conflicts.

@jsha jsha force-pushed the mobile-column-flex branch 3 times, most recently from cb9254e to 096ebc3 Compare January 19, 2022 20:21
Before this, the item name and the stability, source link, and "collapse
all docs" would compete for room on a single line, resulting in awkward
wrapping behavior on mobile. This gives a separate line for that
out-of-band information. It also removes the "copy path" icon on mobile
to make a little more room.

Also, switch to flex-wrap: wrap, so anytime there's not enough room for
`source`, it gets bumped to the next line.
@jsha jsha force-pushed the mobile-column-flex branch from 096ebc3 to 152e888 Compare January 20, 2022 04:52
@GuillaumeGomez
Copy link
Member

Thanks!

@bors: r+ rollup

@bors
Copy link
Collaborator

bors commented Jan 20, 2022

📌 Commit 152e888 has been approved by GuillaumeGomez

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jan 20, 2022
bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 20, 2022
…askrgr

Rollup of 13 pull requests

Successful merges:

 - rust-lang#89747 (Add MaybeUninit::(slice_)as_bytes(_mut))
 - rust-lang#89764 (Fix variant index / discriminant confusion in uninhabited enum branching)
 - rust-lang#91606 (Stabilize `-Z print-link-args` as `--print link-args`)
 - rust-lang#91694 (rustdoc: decouple stability and const-stability)
 - rust-lang#92183 (Point at correct argument when async fn output type lifetime disagrees with signature)
 - rust-lang#92582 (improve `_` constants in item signature handling)
 - rust-lang#92680 (intra-doc: Use the impl's assoc item where possible)
 - rust-lang#92704 (Change lint message to be stronger for &T -> &mut T transmute)
 - rust-lang#92861 (Rustdoc mobile: put out-of-band info on its own line)
 - rust-lang#92992 (Help optimize out backtraces when disabled)
 - rust-lang#93038 (Fix star handling in block doc comments)
 - rust-lang#93108 (:arrow_up: rust-analyzer)
 - rust-lang#93112 (Fix CVE-2022-21658)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit ed3bf67 into rust-lang:master Jan 20, 2022
@rustbot rustbot added this to the 1.60.0 milestone Jan 20, 2022
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 22, 2022
rustdoc: remove dashed underline under main heading

This was removed in rust-lang#92797 but accidentally re-introduced by a bad merge in rust-lang#92861.

r? `@camelid`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 22, 2022
rustdoc: remove dashed underline under main heading

This was removed in rust-lang#92797 but accidentally re-introduced by a bad merge in rust-lang#92861.

r? ``@camelid``
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Jan 22, 2022
rustdoc: remove dashed underline under main heading

This was removed in rust-lang#92797 but accidentally re-introduced by a bad merge in rust-lang#92861.

r? ```@camelid```
@jsha jsha deleted the mobile-column-flex branch January 30, 2022 13:37
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

7 participants