Skip to content
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

rustdoc: Correctly handle long crate names on mobile #120526

Merged
merged 2 commits into from Feb 18, 2024

Conversation

GuillaumeGomez
Copy link
Member

@GuillaumeGomez GuillaumeGomez commented Jan 31, 2024

Fixes #120471.

It now renders like this:

image

r? @notriddle

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. labels Jan 31, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jan 31, 2024

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @jsha

@notriddle
Copy link
Contributor

notriddle commented Jan 31, 2024

Don’t overly-long type names make it “…” truncate? If so, crates should probably do the same thing.

go-to: "file://" + |DOC_PATH| + "/lib2/too_long/struct.SuperIncrediblyLongLongLongLongLongLongLongGigaGigaGigaMegaLongLongLongStructName.html"

@GuillaumeGomez
Copy link
Member Author

GuillaumeGomez commented Jan 31, 2024

I don't think the use case is the same in both cases: you can't click on the crate name on mobile, so being able to scroll to see it full is a better approach (imo).

@notriddle
Copy link
Contributor

you can't click on the crate name on mobile

Let’s fix that, and make it truncate, instead?

I really don’t like the idea of doing vertical scrolling in such a tiny viewport. It’s only usable with a wheel. I hit the top edge of the screen if I touchscreen-scroll, and the scroll bar is too small and sensitive at this size.

@GuillaumeGomez
Copy link
Member Author

Fine by me. 👍

@GuillaumeGomez
Copy link
Member Author

Just one question though: should we make it apparent that this is a link by using the usual link color or not?

@GuillaumeGomez
Copy link
Member Author

Oh wait, it's already a link if we're not at the top. So just keeping things as is.

@GuillaumeGomez
Copy link
Member Author

The crate name is now a link (for coherency with the other pages) and I updated how the text ellipsis is applied to make it work in case you have text in both h2 and the a inside it.

@notriddle notriddle 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 Feb 18, 2024
@notriddle
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 18, 2024

📌 Commit 5d29f5a has been approved by notriddle

It is now in the queue for this repository.

@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 Feb 18, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request Feb 18, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#120526 (rustdoc: Correctly handle long crate names on mobile)
 - rust-lang#121100 (Detect when method call on argument could be removed to fulfill failed trait bound)
 - rust-lang#121160 (rustdoc: fix and refactor HTML rendering a bit)
 - rust-lang#121198 (Add more checks for `unnamed_fields` during HIR analysis)
 - rust-lang#121218 (Fix missing trait impls for type in rustc docs)
 - rust-lang#121221 (AstConv: Refactor lowering of associated item bindings a bit)
 - rust-lang#121237 (Use better heuristic for printing Cargo specific diagnostics)

r? `@ghost`
`@rustbot` modify labels: rollup
CKingX added a commit to CKingX/rust that referenced this pull request Feb 18, 2024
…ame, r=notriddle

rustdoc: Correctly handle long crate names on mobile

Fixes rust-lang#120471.

It now renders like this:

![image](https://github.com/rust-lang/rust/assets/3050060/065b4b8b-ba55-4163-a928-8d7bf735c111)

r? ``@notriddle``
@bors bors merged commit fb5982f into rust-lang:master Feb 18, 2024
11 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 18, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Feb 18, 2024
Rollup merge of rust-lang#120526 - GuillaumeGomez:mobile-long-crate-name, r=notriddle

rustdoc: Correctly handle long crate names on mobile

Fixes rust-lang#120471.

It now renders like this:

![image](https://github.com/rust-lang/rust/assets/3050060/065b4b8b-ba55-4163-a928-8d7bf735c111)

r? `@notriddle`
@GuillaumeGomez GuillaumeGomez deleted the mobile-long-crate-name branch February 18, 2024 10:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

Crate name not well rendered when it is to long
4 participants