-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Make scrollbar in the sidebar always visible for visual consistency #90983
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GuillaumeGomez
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
Nov 17, 2021
Some changes occurred in HTML/CSS/JS. |
rust-highfive
added
the
S-waiting-on-review
Status: Awaiting review from the assignee but also interested parties.
label
Nov 17, 2021
Can you put up a demo of this? |
Oh right, sure! |
Here you go: https://rustdoc.crud.net/imperio/sidebar-scrollbar/foo/index.html (Thanks again for providing this server, it's awesome!). |
@bors r+ rollup Thanks for the fix! |
📌 Commit bf10c88 has been approved by |
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
Nov 20, 2021
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Nov 20, 2021
…=jsha Make scrollbar in the sidebar always visible for visual consistency Fixes rust-lang#90943. I had to add a background in `dark` and `ayu` themes, otherwise it was looking strange (like an invisible margin). So it looks like this: ![Screenshot from 2021-11-17 14-45-49](https://user-images.githubusercontent.com/3050060/142212476-18892ae0-ba4b-48e3-8c0f-4ca1dd2f851d.png) ![Screenshot from 2021-11-17 14-45-53](https://user-images.githubusercontent.com/3050060/142212482-e97b2fad-68d2-439a-b62e-b56e6ded5345.png) Sadly, I wasn't able to add a GUI test to ensure that the scrollbar was always displayed because it seems not possible in puppeteer for whatever reason... I used this method: on small pages (like `lib2/sub_mod/index.html`), comparing `.navbar`'s `clientWidth` with `offsetWidth` (the first doesn't include the sidebar in the computed amount). When checking in the browser, it works fine but in puppeteer it almost never works... In case anyone want to try to solve the bug, here is the puppeteer code: <details> More information about this: I tried another approach which was to get the element in `evaluate` directly (by calling it from `page.evaluate(() => { .. });` directly instead of `parseAssertElemProp.evaluate(e => {...});`. ```js const puppeteer = require('puppeteer'); (async () => { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto("file:///path/rust/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc/lib2/sub_mod/index.html"); await page.waitFor(".sidebar"); let parseAssertElemProp = await page.$(".sidebar"); if (parseAssertElemProp === null) { throw '".sidebar" not found'; } await parseAssertElemProp.evaluate(e => { const parseAssertElemPropDict = {"clientWidth": "192", "offsetWidth":"200"}; for (const [parseAssertElemPropKey, parseAssertElemPropValue] of Object.entries(parseAssertElemPropDict)) { if (e[parseAssertElemPropKey] === undefined || String(e[parseAssertElemPropKey]) != parseAssertElemPropValue) { throw 'expected `' + parseAssertElemPropValue + '` for property `' + parseAssertElemPropKey + '` for selector `.sidebar`, found `' + e[parseAssertElemPropKey] + '`'; } } }).catch(e => console.error(e)); await browser.close(); })(); ``` </details> r? `@jsha`
This was referenced Nov 20, 2021
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Nov 20, 2021
…askrgr Rollup of 5 pull requests Successful merges: - rust-lang#90575 (Improve suggestions for compatible variants on type mismatch.) - rust-lang#90628 (Clarify error messages caused by re-exporting `pub(crate)` visibility to outside) - rust-lang#90930 (Fix `non-constant value` ICE (rust-lang#90878)) - rust-lang#90983 (Make scrollbar in the sidebar always visible for visual consistency) - rust-lang#91021 (Elaborate `Future::Output` when printing opaque `impl Future` type) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Nov 25, 2021
…r, r=jsha Fix invalid scrollbar display on source code page Fixes bug introduced in rust-lang#90983: ![Screenshot from 2021-11-25 17-01-08](https://user-images.githubusercontent.com/3050060/143473753-c2e7c43c-ce3f-474d-9d2a-922e63189c51.png) ![Screenshot from 2021-11-25 17-07-08](https://user-images.githubusercontent.com/3050060/143473757-eecaaf2b-f4f0-49e0-a159-ab485e3f7122.png) To fix it, I simply unset the `overflow-y` on the source code page so it's not displayed anymore. r? `@jsha`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Nov 25, 2021
…r, r=jsha Fix invalid scrollbar display on source code page Fixes bug introduced in rust-lang#90983: ![Screenshot from 2021-11-25 17-01-08](https://user-images.githubusercontent.com/3050060/143473753-c2e7c43c-ce3f-474d-9d2a-922e63189c51.png) ![Screenshot from 2021-11-25 17-07-08](https://user-images.githubusercontent.com/3050060/143473757-eecaaf2b-f4f0-49e0-a159-ab485e3f7122.png) To fix it, I simply unset the `overflow-y` on the source code page so it's not displayed anymore. r? ``@jsha``
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Nov 25, 2021
…r, r=jsha Fix invalid scrollbar display on source code page Fixes bug introduced in rust-lang#90983: ![Screenshot from 2021-11-25 17-01-08](https://user-images.githubusercontent.com/3050060/143473753-c2e7c43c-ce3f-474d-9d2a-922e63189c51.png) ![Screenshot from 2021-11-25 17-07-08](https://user-images.githubusercontent.com/3050060/143473757-eecaaf2b-f4f0-49e0-a159-ab485e3f7122.png) To fix it, I simply unset the `overflow-y` on the source code page so it's not displayed anymore. r? ```@jsha```
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Nov 26, 2021
…r, r=jsha Fix invalid scrollbar display on source code page Fixes bug introduced in rust-lang#90983: ![Screenshot from 2021-11-25 17-01-08](https://user-images.githubusercontent.com/3050060/143473753-c2e7c43c-ce3f-474d-9d2a-922e63189c51.png) ![Screenshot from 2021-11-25 17-07-08](https://user-images.githubusercontent.com/3050060/143473757-eecaaf2b-f4f0-49e0-a159-ab485e3f7122.png) To fix it, I simply unset the `overflow-y` on the source code page so it's not displayed anymore. r? `@jsha`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Nov 26, 2021
…r, r=jsha Fix invalid scrollbar display on source code page Fixes bug introduced in rust-lang#90983: ![Screenshot from 2021-11-25 17-01-08](https://user-images.githubusercontent.com/3050060/143473753-c2e7c43c-ce3f-474d-9d2a-922e63189c51.png) ![Screenshot from 2021-11-25 17-07-08](https://user-images.githubusercontent.com/3050060/143473757-eecaaf2b-f4f0-49e0-a159-ab485e3f7122.png) To fix it, I simply unset the `overflow-y` on the source code page so it's not displayed anymore. r? ``@jsha``
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-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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #90943.
I had to add a background in
dark
andayu
themes, otherwise it was looking strange (like an invisible margin). So it looks like this:Sadly, I wasn't able to add a GUI test to ensure that the scrollbar was always displayed because it seems not possible in puppeteer for whatever reason... I used this method: on small pages (like
lib2/sub_mod/index.html
), comparing.navbar
'sclientWidth
withoffsetWidth
(the first doesn't include the sidebar in the computed amount). When checking in the browser, it works fine but in puppeteer it almost never works...In case anyone want to try to solve the bug, here is the puppeteer code:
r? @jsha