Skip to content

Rustdoc does not show more of the item summary if there is enough room for it #145509

@lolbinarycat

Description

@lolbinarycat

Code

/// some really long summary paragraph that doesn't fit on one screen at all and will be truncated.
pub fn foo() {}

Reproduction Steps

  • document the crate and open it (via cargo doc --open or directly via rustdoc)
  • search "foo"
  • zoom out
  • collapse sidebar
  • in firefox, make sure "Zoom text only" is enabled

Expected Outcome

All of the extra space means the summary paragraph is visible now.

Actual Output

still an ellipsis.

Image

Version

rustdoc 1.90.0-nightly (9748d87 2025-07-21)

Additional Details

grid-template-columns generally seems to be given very rough values that do not adapt very well to different screen sizes. This applies both in search results and also to the module pages to some extent.

I used calc(min(33%, 20em)) auto which seemed to work better for large screen sizes while also working the same for small screens.

The search results page adds a hard ellipsis using js instead of using text-overflow: elipsis (which I usually dislike but I think is the correct thing to use here)

Metadata

Metadata

Assignees

Labels

A-rustdoc-searchArea: Rustdoc's search featureA-rustdoc-uiArea: Rustdoc UI (generated HTML)C-bugCategory: This is a bug.T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.T-rustdoc-frontendRelevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions