Skip to content

fix: override rust doc to handle long line comment - #3620

Open
Its-Just-Nans wants to merge 3 commits into
rust-lang:mainfrom
Its-Just-Nans:handle-long-line-comment
Open

Its-Just-Nans wants to merge 3 commits into
rust-lang:mainfrom
Its-Just-Nans:handle-long-line-comment

Conversation

@Its-Just-Nans

@Its-Just-Nans Its-Just-Nans commented Oct 19, 2026 •

Copy link
Copy Markdown

Handle long comment in the source code viewer. When the comment/code is too long, the header is cut. (see video)

Following rust-lang/rust#164577

rustodc

@Its-Just-Nans
Its-Just-Nans requested a review from a team as a code owner October 19, 2026 14:13
@github-actions github-actions Bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Oct 19, 2026
Comment thread crates/bin/docs_rs_web/templates/style/_rustdoc-common.scss Outdated
@GuillaumeGomez

Copy link
Copy Markdown
Member

The solution here would be to make the top navbar position: fixed and to set margin-top on <main> (like we already do for the sidebar).

@Its-Just-Nans

Copy link
Copy Markdown
Author

The solution here would be to make the top navbar position: fixed and to set margin-top on <main> (like we already do for the sidebar).

I'm not sure to understand why the overflow is problematic. See on the video below. We can do the same (scroll) but without overflowing the page

rustdoc

@Its-Just-Nans

Copy link
Copy Markdown
Author

The solution here would be to make the top navbar position: fixed and to set margin-top on <main> (like we already do for the sidebar).

I've updated with a change like that

I now understand the main issue: rust-lang/rust#109865 was created a explains that a horizontal scroll inside a container is a bug rust-lang/rust#109865 (comment)

Then you fixed it with rust-lang/rust#109932

And now, in this MR, I am trying to fix the top header/navigation

I've updated the MR

@GuillaumeGomez

Copy link
Copy Markdown
Member

Please add a GUI test too.

}

main {
margin-top: 32px; /* Offset of the fixed navigation bar */

@GuillaumeGomez GuillaumeGomez Oct 21, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
margin-top: 32px; /* Offset of the fixed navigation bar */
margin-top: $top-navbar-height;

View changes since the review

// topbar).
assert-window-property: {"innerWidth": |width|}
wait-for-document-property: {"documentElement"."clientWidth": |width|}
assert-css: ("body > .nav-container", {"position": "fixed"})

@GuillaumeGomez GuillaumeGomez Oct 21, 2026 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not testing anything. ^^'

You need to reduce the window's width and scroll to the side to ensure that the topbar is not scrolled.

View changes since the review

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants