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

“Copy item path to clipboard” button gives wrong string for modules #131021

Closed
steffahn opened this issue Sep 29, 2024 · 1 comment · Fixed by #131023
Closed

“Copy item path to clipboard” button gives wrong string for modules #131021

steffahn opened this issue Sep 29, 2024 · 1 comment · Fixed by #131023
Assignees
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Comments

@steffahn
Copy link
Member

steffahn commented Sep 29, 2024

Image

Compare e..g https://doc.rust-lang.org/1.81.0/std/boxed/index.html, where the button correctly produces std::boxed in the clipboard,
with https://doc.rust-lang.org/nightly/std/boxed/index.html, where it currently gives me std::std::boxed instead!

I would guess, this is a change that came with the redesign in #129545, though I haven’t checked to confirm that.

This only happen with modules; things like structs, macros, type synonyms… als seem to work correctly.

cc @GuillaumeGomez, @notriddle

@rustbot label +T-rustdoc +T-rustdoc-frontend +A-rustdoc-ui

@steffahn steffahn added the C-bug Category: This is a bug. label Sep 29, 2024
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. A-rustdoc-ui Area: Rustdoc UI (generated HTML) T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Sep 29, 2024
@clubby789
Copy link
Contributor

        const path = [];
        onEachLazy(document.querySelectorAll(".rustdoc-breadcrumbs a"), a => {
            path.push(a.textContent);
        });
        path.push(document.querySelector("title").textContent.split(" ")[0]);

Most pages have the title <Item> in path::to::module - but modules don't have this, so the title of the page is just appended to std.
@rustbot claim

@clubby789 clubby789 removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Sep 29, 2024
@GuillaumeGomez GuillaumeGomez removed the A-rustdoc-ui Area: Rustdoc UI (generated HTML) label Sep 29, 2024
@bors bors closed this as completed in b6b43af Sep 30, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Sep 30, 2024
Rollup merge of rust-lang#131023 - clubby789:doc-item-path, r=notriddle

Copy correct path to clipboard for modules/keywords/primitives

Fixes rust-lang#131021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants