Commit Graph

20 Commits

Author SHA1 Message Date
Michael Howell
d05323c7b4 rustdoc: redesign toolbar and disclosure widgets
This adds labels to the icons and moves them away from the search box.

These changes are made together, because they work together, but are based on
several complaints:

* The [+/-] thing are a Reddit-ism. They don't look like buttons, but look
  like syntax
  <https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/More.20visual.20difference.20for.20the.20.2B.2F-.20.20Icons>,
  <https://github.com/rust-lang/rust/issues/59851>
  (some of these are laundry lists with more suggestions, but they all
  mention [+/-] looking wrong)

* The settings, help, and summary buttons are also too hard to recognize
  <https://lwn.net/Articles/987070/>,
  <https://github.com/rust-lang/rust/issues/90310>,
  <https://github.com/rust-lang/rust/issues/14475#issuecomment-274241997>,
  <https://internals.rust-lang.org/t/improve-rustdoc-design/12758>
  ("Not all functionality is self-explanatory, for example the [+] button in
  the top right corner, the theme picker or the settings button.")

The toggle-all and toggle-individual buttons both need done at once, since we
want them to look like they go together. This changes them from both being
[+/-] to both being arrows.

Settings and Help are also migrated, so that the whole group can benefit from
being described using actual words.

Additionally, the Help button is only shown on SERPs, not all the time.
This is done for two major reasons:

* Most of what's in there is search-related. The things that aren't are
  keyboard commands, and the search box tells you about that anyway.
  Pressing <kbd>?</kbd> will temporarily show the button and its popover.
* I'm trading it off by showing the help button, even on mobile.
  It's useful since you can use the search engine suggestions there.
* The three buttons were causing line wrapping on too many desktop layouts.
2024-09-10 17:56:05 -07:00
Guillaume Gomez
e460901b13 Add GUI regression test for setting's cog color 2024-05-05 20:07:12 +02:00
Guillaume Gomez
66bc97cc88 Make theme switching closer to reality 2024-04-08 12:14:41 +02:00
Guillaume Gomez
7659ef47f0 Use include command to reduce code duplication 2024-04-05 21:38:55 +02:00
Guillaume Gomez
59120d0ef5 Update to new browser-ui-test version 2024-04-01 22:25:01 +02:00
Guillaume Gomez
fa1f16116e Migrate GUI colors test to original CSS color format 2023-06-24 14:47:16 +02:00
Michael Howell
24913bd768 rustdoc: remove unneeded position: relative setting CSS
This was added to control percentage sizes, in
79956b96e8

Now, the only percentage size is [`border-radius`], which is
based on the size of the box itself, not its containing block.
This leaves the property unused.

[`border-radius`]: https://developer.mozilla.org/en-US/docs/Web/CSS/border-radius
2023-05-22 16:46:29 -07:00
Guillaume Gomez
0630283e9d Migrate to 0.16.0 browser-ui-test version 2023-05-11 11:34:22 +02:00
Michael Howell
5cefe75436 rustdoc: remove unneeded handleKey from settings.js
This code was added in 9dc5dfb975
and 704050da23 because the browser-
native checkbox was `display: none`, breaking native keyboard
accessibility.

The native checkbox is now merely `appearance: none`, which does
not turn off [behavior semantics], so JavaScript to
reimplement it isn't needed any more.

[behavior semantics]: https://w3c.github.io/csswg-drafts/css-ui/#appearance-semantics
2023-04-21 16:42:23 -07:00
Matthias Krüger
b53817df19
Rollup merge of #110205 - notriddle:notriddle/pixelated-border, r=GuillaumeGomez
rustdoc: make settings radio and checks thicker, less contrast

This is very dependent on subjectivity and what screen you use, but this change makes the radio buttons' outer circle less ugly.

This is because I could see the pixels very clearly, thanks to the very thin line and high contrast. This change makes both less severe, giving your browser's antialiasing algorithm more to work with. Since it's thicker, lowering the contrast shouldn't impact visibility.

## Preview

https://notriddle.com/rustdoc-demo-html-3/pixelated-border/settings.html

## Before

![image](https://user-images.githubusercontent.com/1593513/231274191-143acbea-c433-4fb1-b46d-e5e4fe328d60.png)

## After

![image](https://user-images.githubusercontent.com/1593513/231287415-c1e59fe8-8bf8-489d-b607-95ebb71e4ac5.png)

<details><summary>Original "after" image with 2px border around checked box</summary>

![image](https://user-images.githubusercontent.com/1593513/231274253-8b5011c6-82fb-4396-84d0-47b6bdff2260.png)

</details>
2023-04-12 20:56:23 +02:00
Michael Howell
ad9a89eef2 rustdoc: make settings radio and checks thicker, less contrast
This is very dependent on subjectivity and what screen you use,
but this change makes the radio buttons' outer circle less ugly.

This is because I could see the pixels very clearly, thanks to the
very thin line and high contrast. This change makes both less
severe, giving your browser's antialiasing algorithm more to
work with. Since it's thicker, lowering the contrast shouldn't
impact visibility.
2023-04-12 08:39:43 -07:00
Guillaume Gomez
010fa00b80 Update rustdoc GUI tests to new browser-ui-test version 2023-04-11 19:14:35 +02:00
Michael Howell
5dd87c58aa rustdoc: simplify settings popover DOM
* Changes the class names so that they all start with `setting-`.
  That should make it harder to accidentally use a setting class outside
  the settings popover, where loading the CSS might accidentally change
  the styles of something unrelated.
* Get rid of an unnecessary wrapper DIV around the radio button line.
* Simplify CSS selectors by making the DOM easier and more intuitive
  to target.
2023-01-23 15:08:33 -07:00
Michael Goulet
e12c6b277f
Rollup merge of #107045 - notriddle:notriddle/settings-css-setting-line, r=GuillaumeGomez
rustdoc: remove redundant CSS rule `#settings .setting-line`

Since the current version of settings.js always nests things below a div with ID `settings`, this rule always overrode the one above.
2023-01-18 18:00:31 -05:00
Michael Howell
34d595dda1 rustdoc: add test case for setting-line margin on settings.html 2023-01-18 12:48:24 -07:00
Michael Howell
bb5fb53b30 rustdoc: fix "?" keyboard command when radio button is focused
This extends the special case with checkbox settings to also cover radios.
2023-01-18 12:14:00 -07:00
Michael Howell
deb05758c8 rustdoc: put focus on the help link when opening it from keyboard
This prevents some strange blur-event-related bugs with the "?" command
by ensuring that the focus remains in the same spot when the settings
area closes.
2023-01-18 12:14:00 -07:00
Michael Howell
a242a2c6ad rustdoc: add test cases for settings radio button layout 2023-01-17 12:09:53 -07:00
Michael Howell
1d328de3ec rustdoc: rename CSS rustdoc-toggle -> toggle and toggle -> settings-toggle
This swaps things around so that the class that gets used more often has
the shorter name.
2023-01-13 12:38:03 -07:00
Albert Larsan
cf2dff2b1e
Move /src/test to /tests 2023-01-11 09:32:08 +00:00