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: search: color item type and reduce size to avoid clashing #112720

Merged

Conversation

poliorcetics
Copy link
Contributor

  • rustdoc: search: color item type same as item
  • rustdoc: search: reduce item type size to 0.875rem to avoid clashing with path and item

@rustbot
Copy link
Collaborator

rustbot commented Jun 16, 2023

r? @jsha

(rustbot has picked a reviewer for you, use r? to override)

@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 Jun 16, 2023
@rustbot
Copy link
Collaborator

rustbot commented Jun 16, 2023

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

@poliorcetics
Copy link
Contributor Author

Current look:

Screenshot 2023-06-16 at 22 31 55

@poliorcetics
Copy link
Contributor Author

My proposition after #110688, which I find nice but a little too charged and uniform to be truly agreable to use

@GuillaumeGomez
Copy link
Member

Having the color put on the type kind isn't great indeed. ^^'

Also, having the text smaller actually attracts the readers attention to the type kind rather than the item name. Not sure if it's the goal?

@poliorcetics
Copy link
Contributor Author

poliorcetics commented Jun 16, 2023

Screenshot 2023-06-16 at 23 16 51

I like this much better, the uniform grey make it much less eye-catching and allows concentrating on the searched-for item

@poliorcetics poliorcetics force-pushed the rustdoc-item-type-color-same-as-item-color branch from fc6c82e to 3afbfc5 Compare June 16, 2023 21:19
@notriddle
Copy link
Contributor

I think grey is a lot nicer than color in this case.

@GuillaumeGomez
Copy link
Member

Agreed.

@dns2utf8
Copy link
Contributor

dns2utf8 commented Jun 17, 2023

I think it is still a bit visually noisy while looking clearly better.
Could we align the fully qualified type a bit? Maybe with spaces?

Edit: Or use word that are the same length?

@poliorcetics
Copy link
Contributor Author

If someone manages to find nice wording that have almost the same size for all items, I'm interested, but I have no idea for some, like trait method or re export

I suppose we could use Rust syntax, like fn instead of method, I'll try it when I'm on my computer

@GuillaumeGomez
Copy link
Member

method != fn != trait method. ;)

@notriddle
Copy link
Contributor

fnmethodtrait method

Calling a trait method a function is accurate. It’s just not maximally specific.

@GuillaumeGomez
Copy link
Member

But in the docs we make the difference, hence why I commented it this way.

@Sp00ph
Copy link
Member

Sp00ph commented Jun 17, 2023

Would it be possible to add padding to vertically align the item names? I think the fact that the different types have different widths makes the list look more cluttered to me.

@poliorcetics
Copy link
Contributor Author

It was tried in the original PR and didn't look good, it makes it much harder to find the looked-for item

I personally like it as-is but I'll change it if more people want columns

@GuillaumeGomez
Copy link
Member

I think the current display is good too. Can you add a screenshot with "mobile view" too please?

@poliorcetics
Copy link
Contributor Author

IMG_8710F5302837-1

@GuillaumeGomez
Copy link
Member

Please add a GUI test for the color of the type name (in tests/rustdoc-gui). If you need help, don't hesitate to ask me. Once done, I'll r+ it.

@rustbot
Copy link
Collaborator

rustbot commented Jun 18, 2023

Some changes occurred in GUI tests.

cc @GuillaumeGomez

@poliorcetics
Copy link
Contributor Author

Added a test. I'm unsure if I'm correct with it, hopefully I am

@poliorcetics poliorcetics force-pushed the rustdoc-item-type-color-same-as-item-color branch from cf10b9c to 612c3a1 Compare June 19, 2023 21:34
@poliorcetics poliorcetics force-pushed the rustdoc-item-type-color-same-as-item-color branch from 612c3a1 to c3cdf85 Compare June 20, 2023 06:29
@GuillaumeGomez
Copy link
Member

Thanks!

@bors r=notriddle,GuillaumeGomez rollup

@bors
Copy link
Contributor

bors commented Jun 20, 2023

📌 Commit c3cdf85 has been approved by notriddle,GuillaumeGomez

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-review Status: Awaiting review from the assignee but also interested parties. labels Jun 20, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 20, 2023
…llaumeGomez

Rollup of 6 pull requests

Successful merges:

 - rust-lang#112464 (Fix windows `Socket::connect_timeout` overflow)
 - rust-lang#112720 (Rustdoc: search: color item type and reduce size to avoid clashing)
 - rust-lang#112762 (Sort the errors from arguments checking so that suggestions are handled properly)
 - rust-lang#112786 (change binders from tuple structs to named fields)
 - rust-lang#112794 (Fix linker failures when #[global_allocator] is used in a dependency)
 - rust-lang#112819 (Disable feature(unboxed_closures, fn_traits) in weird-exprs)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit a318824 into rust-lang:master Jun 20, 2023
@rustbot rustbot added this to the 1.72.0 milestone Jun 20, 2023
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.

8 participants