2022-08-13 08:47:19 -05:00
|
|
|
// This test ensures that the elements in ".search-form" have the expected display.
|
2024-04-05 14:38:55 -05:00
|
|
|
include: "utils.goml"
|
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-08-25 01:11:30 -05:00
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=test"
|
|
|
|
wait-for: "#search-tabs" // Waiting for the search.js to load.
|
2022-08-13 08:47:19 -05:00
|
|
|
show-text: true
|
|
|
|
|
2023-08-19 10:19:46 -05:00
|
|
|
define-function: (
|
|
|
|
"check-search-colors",
|
2024-04-01 14:11:22 -05:00
|
|
|
[
|
2023-08-19 10:51:23 -05:00
|
|
|
theme, border, background, search_input_color, search_input_border_focus,
|
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-08-25 01:11:30 -05:00
|
|
|
menu_button_a_color, menu_button_a_border_hover, menu_a_color,
|
2024-04-01 14:11:22 -05:00
|
|
|
],
|
2023-08-19 10:19:46 -05:00
|
|
|
block {
|
2024-04-05 14:38:55 -05:00
|
|
|
call-function: ("switch-theme", {"theme": |theme|})
|
2023-08-19 10:19:46 -05:00
|
|
|
assert-css: (
|
|
|
|
".search-input",
|
|
|
|
{
|
2023-08-19 10:51:23 -05:00
|
|
|
"border-color": |border|,
|
|
|
|
"background-color": |background|,
|
2023-08-19 10:19:46 -05:00
|
|
|
"color": |search_input_color|,
|
|
|
|
},
|
|
|
|
)
|
|
|
|
// Focus on search input.
|
|
|
|
focus: ".search-input"
|
|
|
|
assert-css: (
|
|
|
|
".search-input",
|
|
|
|
{
|
|
|
|
"border-color": |search_input_border_focus|,
|
2023-08-19 10:51:23 -05:00
|
|
|
"background-color": |background|,
|
2023-08-19 10:19:46 -05:00
|
|
|
"color": |search_input_color|,
|
|
|
|
},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
"#help-button > a",
|
|
|
|
{
|
|
|
|
"color": |menu_button_a_color|,
|
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-08-25 01:11:30 -05:00
|
|
|
"border-color": "transparent",
|
|
|
|
"background-color": "transparent",
|
2023-08-19 10:19:46 -05:00
|
|
|
},
|
|
|
|
)
|
|
|
|
// Hover help button.
|
|
|
|
move-cursor-to: "#help-button"
|
|
|
|
assert-css: (
|
|
|
|
"#help-button > a",
|
|
|
|
{
|
2023-08-19 10:51:23 -05:00
|
|
|
"color": |menu_button_a_color|,
|
2023-08-19 10:19:46 -05:00
|
|
|
"border-color": |menu_button_a_border_hover|,
|
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-08-25 01:11:30 -05:00
|
|
|
"background-color": "transparent",
|
2023-08-19 10:19:46 -05:00
|
|
|
},
|
|
|
|
)
|
|
|
|
// Link color inside
|
|
|
|
click: "#help-button"
|
|
|
|
assert-css: (
|
|
|
|
"#help a",
|
|
|
|
{
|
|
|
|
"color": |menu_a_color|,
|
|
|
|
},
|
|
|
|
)
|
|
|
|
assert-css: (
|
|
|
|
"#settings-menu > a",
|
|
|
|
{
|
|
|
|
"color": |menu_button_a_color|,
|
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-08-25 01:11:30 -05:00
|
|
|
"border-color": "transparent",
|
|
|
|
"background-color": "transparent",
|
2023-08-19 10:19:46 -05:00
|
|
|
},
|
|
|
|
)
|
|
|
|
// Hover settings menu.
|
|
|
|
move-cursor-to: "#settings-menu"
|
|
|
|
assert-css: (
|
|
|
|
"#settings-menu:hover > a",
|
|
|
|
{
|
2023-08-19 10:51:23 -05:00
|
|
|
"color": |menu_button_a_color|,
|
2023-08-19 10:19:46 -05:00
|
|
|
"border-color": |menu_button_a_border_hover|,
|
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-08-25 01:11:30 -05:00
|
|
|
"background-color": "transparent",
|
2023-08-19 10:19:46 -05:00
|
|
|
},
|
|
|
|
)
|
2022-10-15 14:06:16 -05:00
|
|
|
},
|
|
|
|
)
|
2022-08-13 08:47:19 -05:00
|
|
|
|
2023-08-19 10:19:46 -05:00
|
|
|
call-function: (
|
|
|
|
"check-search-colors",
|
|
|
|
{
|
|
|
|
"theme": "ayu",
|
2023-08-19 10:51:47 -05:00
|
|
|
"border": "#5c6773",
|
|
|
|
"background": "#141920",
|
|
|
|
"search_input_color": "#fff",
|
|
|
|
"search_input_border_focus": "#5c6773",
|
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-08-25 01:11:30 -05:00
|
|
|
"menu_button_a_color": "#c5c5c5",
|
2023-08-19 10:51:47 -05:00
|
|
|
"menu_button_a_border_hover": "#e0e0e0",
|
|
|
|
"menu_a_color": "#39afd7",
|
2023-08-19 10:19:46 -05:00
|
|
|
}
|
|
|
|
)
|
|
|
|
call-function: (
|
|
|
|
"check-search-colors",
|
|
|
|
{
|
|
|
|
"theme": "dark",
|
2023-08-19 10:51:47 -05:00
|
|
|
"border": "#e0e0e0",
|
|
|
|
"background": "#f0f0f0",
|
|
|
|
"search_input_color": "#111",
|
|
|
|
"search_input_border_focus": "#008dfd",
|
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-08-25 01:11:30 -05:00
|
|
|
"menu_button_a_color": "#ddd",
|
2023-08-19 10:51:47 -05:00
|
|
|
"menu_button_a_border_hover": "#ffb900",
|
|
|
|
"menu_a_color": "#d2991d",
|
2023-08-19 10:19:46 -05:00
|
|
|
}
|
|
|
|
)
|
|
|
|
call-function: (
|
|
|
|
"check-search-colors",
|
|
|
|
{
|
|
|
|
"theme": "light",
|
2023-08-19 10:51:47 -05:00
|
|
|
"border": "#e0e0e0",
|
|
|
|
"background": "#fff",
|
|
|
|
"search_input_color": "#000",
|
|
|
|
"search_input_border_focus": "#66afe9",
|
|
|
|
"menu_button_a_color": "#000",
|
|
|
|
"menu_button_a_border_hover": "#717171",
|
|
|
|
"menu_a_color": "#3873ad",
|
2023-08-19 10:19:46 -05:00
|
|
|
}
|
2022-08-13 08:47:19 -05:00
|
|
|
)
|
2023-12-26 14:48:56 -06:00
|
|
|
|
|
|
|
// Check that search input correctly decodes form encoding.
|
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=a+b"
|
|
|
|
wait-for: "#search-tabs" // Waiting for the search.js to load.
|
|
|
|
assert-property: (".search-input", { "value": "a b" })
|
|
|
|
// Check that literal + is not treated as space.
|
|
|
|
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=a%2Bb"
|
|
|
|
wait-for: "#search-tabs" // Waiting for the search.js to load.
|
|
|
|
assert-property: (".search-input", { "value": "a+b" })
|