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

Allow source link to wrap onto next line #93537

Closed
wants to merge 1 commit into from

Conversation

jsha
Copy link
Contributor

@jsha jsha commented Feb 1, 2022

Like the out-of-band information at the top of the page, this uses flex-wrap: wrap to allow source to move to the next line when space is tight. Also, on mobile layouts move it to the next line always, for a more consistent interface.

This allows more of the method signature to be displayed on a single line, and avoids confusing source with one of the items in the method signature.

Also tweak the padding on summary items slightly so they line up properly with their docblock.

Remove one of the cases in toggle-click-deadspace.goml that tries to click the [-] toggle. It was only "working" by happenstance before, since we don't have a good way to click CSS-generated items in browser-UI-test. And that case is not the core of what's being tested in that file.

Demo: https://rustdoc.crud.net/jsha/wrap-source-link/std/string/struct.String.html

r? @GuillaumeGomez

Fixes #93477

@jsha jsha added T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. A-rustdoc-ui Area: Rustdoc UI (generated HTML) labels Feb 1, 2022
@rust-highfive
Copy link
Collaborator

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez,@Folyd

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 1, 2022
package.json Outdated Show resolved Hide resolved
@jsha jsha force-pushed the wrap-source-link branch from a951517 to f143178 Compare February 1, 2022 21:16
@GuillaumeGomez
Copy link
Member

Looks good to me. Can you add a GUI test for mobile to ensure that the source link is below the method please?

@bors
Copy link
Contributor

bors commented Feb 5, 2022

☔ The latest upstream changes (presumably #93655) made this pull request unmergeable. Please resolve the merge conflicts.

@jsha jsha force-pushed the wrap-source-link branch from f143178 to a4c95c5 Compare February 5, 2022 06:37
@rust-log-analyzer

This comment has been minimized.

@bors
Copy link
Contributor

bors commented Feb 6, 2022

☔ The latest upstream changes (presumably #93689) made this pull request unmergeable. Please resolve the merge conflicts.

@jsha jsha force-pushed the wrap-source-link branch from 6276025 to fb5b091 Compare February 6, 2022 09:33
@rust-log-analyzer

This comment has been minimized.

@jsha jsha force-pushed the wrap-source-link branch from fb5b091 to 04eee9e Compare February 9, 2022 08:16
@jsha
Copy link
Contributor Author

jsha commented Feb 9, 2022

Removed one of the cases in toggle-click-deadspace.goml that tries to click the [-] toggle. It was only "working" by happenstance before, since we don't have a good way to click CSS-generated items in browser-UI-test. And that case is not the core of what's being tested in that file.

@bors
Copy link
Contributor

bors commented Feb 9, 2022

☔ The latest upstream changes (presumably #93795) made this pull request unmergeable. Please resolve the merge conflicts.

@jsha jsha force-pushed the wrap-source-link branch from 04eee9e to 609bde7 Compare February 9, 2022 10:23
@GuillaumeGomez
Copy link
Member

Looks broken:

Screenshot from 2022-02-09 11-32-16

@jsha
Copy link
Contributor Author

jsha commented Feb 11, 2022

I fixed that brokenness, but there's another thing I still need to fix:

image

On the Send page, the item-infos are getting bumped up next to the source link.

@jsha jsha 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 11, 2022
@JohnCSimon JohnCSimon 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-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 20, 2022
@bors
Copy link
Contributor

bors commented Apr 13, 2022

☔ The latest upstream changes (presumably #95990) made this pull request unmergeable. Please resolve the merge conflicts.

@jsha jsha force-pushed the wrap-source-link branch from d7abf04 to 0d87717 Compare May 18, 2022 04:36
@rust-log-analyzer

This comment has been minimized.

Like the out-of-band information at the top of the page, this uses
flex-wrap: wrap to allow `source` to move to the next line when space is
tight. Also, on mobile layouts move it to the next line always, for a
more consistent interface.

This allows more of the method signature to be displayed on a single
line, and avoids confusing `source` with one of the items in the method
signature.

Also tweak the padding on summary items slightly so they line up
properly with their docblock.
@jsha jsha force-pushed the wrap-source-link branch from 0d87717 to 7a51adf Compare June 20, 2022 07:10
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
  IMAGE: x86_64-gnu-tools
##[endgroup]
From https://github.com/rust-lang/rust
 * branch              master     -> FETCH_HEAD
Searching for toolstate changes between 9a0b7749665d925d8f533756149deba74f2db88b and 989591fc3ee7232cf048b3ae1b1714b596b208c0
Rustdoc was updated
##[group]Run src/ci/scripts/verify-channel.sh
src/ci/scripts/verify-channel.sh
shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0}
env:
---
.......... (60/64)
....       (64/64)


/checkout/src/test/rustdoc-gui/item-info-overflow.goml item-info-overflow... FAILED
[ERROR] (line 17) "#impl-SimpleTrait .item-info" not found: for command `compare-elements-property: (
    "#impl-SimpleTrait .item-info",
    "#impl-SimpleTrait + .docblock",
    ["scrollWidth"],
)`
[ERROR] (line 22) "#impl-SimpleTrait .item-info" not found: for command `assert-property: ("#impl-SimpleTrait .item-info", {"scrollWidth": "866"})`
[ERROR] (line 24) "#impl-SimpleTrait .item-info" not found: for command `assert-text: (
    "#impl-SimpleTrait .item-info",
    "Available on Android or Linux or Emscripten or DragonFly BSD",
    STARTS_WITH,


/checkout/src/test/rustdoc-gui/implementors.goml implementors... FAILED
[ERROR] (line 20) "#impl-EmptyTrait3 .item-info" not found: for command `compare-elements-position-near: ("#impl-EmptyTrait3 h3", "#impl-EmptyTrait3 .item-info", {"y": 30})`
Build completed unsuccessfully in 0:00:18

@bors
Copy link
Contributor

bors commented Jul 7, 2022

☔ The latest upstream changes (presumably #99014) made this pull request unmergeable. Please resolve the merge conflicts.

@JohnCSimon
Copy link
Member

@jsha
ping from triage - can you post your status on this PR? This has sat untouched for a while. Thanks!

FYI: when a PR is ready for review, send a message containing
@rustbot ready to switch to S-waiting-on-review so the PR is in the reviewer's backlog.

@Dylan-DPC
Copy link
Member

Closing this pr as inactive.

@Dylan-DPC Dylan-DPC closed this Mar 7, 2023
@Dylan-DPC Dylan-DPC added S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Mar 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rustdoc-ui Area: Rustdoc UI (generated HTML) S-inactive Status: Inactive and waiting on the author. This is often applied to closed PRs. 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.

rustdoc: wrap "source" link to new line on narrow screens
7 participants