-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rustdoc-search: let people easily make text selections
This is a GUI affordance that I basically copied from DuckDuckGo. You can make text selections starting in the description by dragging the mouse, even though clicking on the description opens the page.
- Loading branch information
Showing
2 changed files
with
21 additions
and
0 deletions.
There are no files selected for viewing
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
12 changes: 12 additions & 0 deletions
12
tests/rustdoc-gui/search-result-description-selection.goml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// This test is to ensure that the codeblocks are correctly rendered in the search results. | ||
go-to: "file://" + |DOC_PATH| + "/test_docs/index.html?search=some_more_function" | ||
show-text: true // can't select text without showing it | ||
// Waiting for the search results to appear... | ||
wait-for: "#search-tabs" | ||
assert: ".search-results .desc" | ||
store-position: (".search-results .desc", {"x": desc_x, "y": desc_y}) | ||
// select text within the description | ||
// making sure nothing happens after doing so (other than the text select itself) | ||
drag-and-drop: ((|desc_x| + 8, |desc_y| + 8), (|desc_x| + 80, |desc_y| + 8)) | ||
wait-for: 125 | ||
assert: ".search-results .desc" |