Skip to content

Simplify codeblock and their associated tooltip #101613

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 2 commits into from
Sep 11, 2022

Conversation

GuillaumeGomez
Copy link
Member

It is based on #101600 so it needs to wait for this one to be merged first.

This PR does two things:

  • Remove CSS class duplication by setting CSS classes such as compile_fail directly on the div wrapping both the codeblock and the tooltip.
  • Simplify DOM: no need to wrap the tooltip into a <div>, it can work just as well without it.

You can test it here.

r? @notriddle

@rustbot rustbot added the T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. label Sep 9, 2022
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 9, 2022
@rustbot
Copy link
Collaborator

rustbot commented Sep 9, 2022

Some changes occurred in HTML/CSS/JS.

cc @GuillaumeGomez, @Folyd, @jsha

@rust-log-analyzer

This comment has been minimized.

@GuillaumeGomez
Copy link
Member Author

I'll give it a try locally to see how it looks like but that seems like a really good idea.

@GuillaumeGomez
Copy link
Member Author

Applied your idea and updated the online demo.

@notriddle
Copy link
Contributor

@GuillaumeGomez Can you rebase this, please?

@GuillaumeGomez
Copy link
Member Author

Done!

@notriddle
Copy link
Contributor

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 10, 2022

📌 Commit 8ba06d4 has been approved by notriddle

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 10, 2022
compiler-errors added a commit to compiler-errors/rust that referenced this pull request Sep 10, 2022
…r=notriddle

Simplify codeblock and their associated tooltip

It is based on rust-lang#101600 so it needs to wait for this one to be merged first.

This PR does two things:

 * Remove CSS class duplication by setting CSS classes such as `compile_fail` directly on the `div` wrapping both the codeblock and the tooltip.
 * Simplify DOM: no need to wrap the tooltip into a `<div>`, it can work just as well without it.

You can test it [here](https://rustdoc.crud.net/imperio/codeblock-tooltip/std/string/struct.String.html#deref).

r? `@notriddle`
@bors
Copy link
Collaborator

bors commented Sep 10, 2022

⌛ Testing commit 8ba06d4 with merge 781ef3e...

@bors
Copy link
Collaborator

bors commented Sep 11, 2022

☀️ Test successful - checks-actions
Approved by: notriddle
Pushing 781ef3e to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 11, 2022
@bors bors merged commit 781ef3e into rust-lang:master Sep 11, 2022
@rustbot rustbot added this to the 1.65.0 milestone Sep 11, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (781ef3e): comparison URL.

Overall result: ❌ regressions - ACTION NEEDED

Next Steps: If you can justify the regressions found in this perf run, please indicate this with @rustbot label: +perf-regression-triaged along with sufficient written justification. If you cannot justify the regressions please open an issue or create a new PR that fixes the regressions, add a comment linking to the newly created issue or PR, and then add the perf-regression-triaged label to this PR.

@rustbot label: +perf-regression
cc @rust-lang/wg-compiler-performance

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
1.3% [1.3%, 1.3%] 1
Regressions ❌
(secondary)
3.4% [3.1%, 3.9%] 6
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) 1.3% [1.3%, 1.3%] 1

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.4% [1.0%, 3.3%] 4
Improvements ✅
(primary)
-4.7% [-4.7%, -4.7%] 1
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) -4.7% [-4.7%, -4.7%] 1

Cycles

This benchmark run did not return any relevant results for this metric.

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

@rustbot rustbot added the perf-regression Performance regression. label Sep 11, 2022
@GuillaumeGomez
Copy link
Member Author

Perf results are noise. No perf change should be detected in here.

@GuillaumeGomez GuillaumeGomez deleted the codeblock-tooltip branch September 11, 2022 08:53
@lqd
Copy link
Member

lqd commented Sep 11, 2022

@rustbot label: +perf-regression-triaged

@rustbot rustbot added the perf-regression-triaged The performance regression has been triaged. label Sep 11, 2022
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
merged-by-bors This PR was explicitly merged by bors. perf-regression Performance regression. perf-regression-triaged The performance regression has been triaged. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

8 participants