Skip to content

break long words to prevent horizontal scroll#3384

Merged
GuillaumeGomez merged 3 commits into
rust-lang:mainfrom
darricheng:crate-description-text-overflow
Jul 2, 2026
Merged

break long words to prevent horizontal scroll#3384
GuillaumeGomez merged 3 commits into
rust-lang:mainfrom
darricheng:crate-description-text-overflow

Conversation

@darricheng

Copy link
Copy Markdown
Contributor

Came across this crate with a description that was overflowing and breaking the layout:
Screenshot 2026-06-22 at 11 15 39 AM

For this specific crate description, it only breaks the layout on Safari or Chrome related browsers as Firefox breaks long words on slashes as well. A long word would break the layout on any browser, but I think that kind of case would be rarer. This CSS change breaks the word if they get too long, so that the layout doesn't break.

Screenshot 2026-06-22 at 11 20 31 AM

There's a few other CSS options that could resolve this as detailed in css-tricks, but I thought this one was the most effective and minimal change to resolve this.

@darricheng darricheng requested a review from a team as a code owner June 22, 2026 04:02
@github-actions github-actions Bot added the S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed label Jun 22, 2026
@GuillaumeGomez

Copy link
Copy Markdown
Member

Fix looks good to me, thanks! Please add a GUI regression test (don't hesitate to ask if you need help).

@darricheng

Copy link
Copy Markdown
Contributor Author

@GuillaumeGomez I added an initial test based on my interpretation of the docs. However, I'm not certain it's correct mainly because I'm not sure how to go about validating the test (run it pre and post fix, that the test file syntax is actually valid, etc.). The test itself takes >15mins with github actions.

I'm curious how you guys do it? E.g. do you run it locally or rely on github actions? Or maybe some other way?

@darricheng

Copy link
Copy Markdown
Contributor Author

To follow up on the previous comment, I can see the failure in the test. I'm more curious as to the workflow you guys use because the feedback loop is long in the case of the gui tests.

@GuillaumeGomez

Copy link
Copy Markdown
Member

I run them directly without docker (because it takes too much time).

@darricheng

Copy link
Copy Markdown
Contributor Author

@GuillaumeGomez I think I figured it out. Do correct me if I'm wrong.

As per the README, running node gui-tests/tester.js opens docs.rs at http://127.0.0.1:3000. As long as we have a docs.rs server running on that localhost port, with or without docker, the tests will correctly check against the running server. Doing it as such is indeed very fast like you mentioned.

@GuillaumeGomez

Copy link
Copy Markdown
Member

Looks great, thanks a lot!

@GuillaumeGomez GuillaumeGomez merged commit 760d9e0 into rust-lang:main Jul 2, 2026
12 checks passed
@github-actions github-actions Bot added S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it and removed S-waiting-on-review Status: This pull request has been implemented and needs to be reviewed labels Jul 2, 2026
@darricheng darricheng deleted the crate-description-text-overflow branch July 2, 2026 13:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-deploy This PR is ready to be merged, but is waiting for an admin to have time to deploy it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants