Fix bug when rustdoc "go to only result" setting is not working as expected"#158308
Open
GuillaumeGomez wants to merge 1 commit into
Open
Fix bug when rustdoc "go to only result" setting is not working as expected"#158308GuillaumeGomez wants to merge 1 commit into
GuillaumeGomez wants to merge 1 commit into
Conversation
Collaborator
|
Some changes occurred in HTML/CSS/JS. |
GuillaumeGomez
commented
Jun 23, 2026
| go-to: "file://" + |DOC_PATH| + "/lib2/index.html" | ||
| // We enter it into the search. | ||
| click: "#search-button" | ||
| wait-for: "#alternative-display .search-input" |
Member
Author
There was a problem hiding this comment.
I'm surprised it worked before to directly write into the search input even if it's not displayed. It triggered a bug when I wrote Whitespace into it: it only had pace, the beginning was removed. I think it's because the item gets moved in-between and if there are few enough letters, it works, but it's only by change.
GuillaumeGomez
commented
Jun 23, 2026
| write-into: (".search-input", "HasALongTraitWithParams") | ||
| wait-for-document-property: {"title": "HasALongTraitWithParams in lib2 - Rust"} | ||
| assert-window-property: ({"location": "/lib2/struct.HasALongTraitWithParams.html"}, ENDS_WITH) | ||
| assert-window-property: ({"location"."pathname": "/lib2/struct.HasALongTraitWithParams.html"}, ENDS_WITH) |
Member
Author
There was a problem hiding this comment.
I have no clue how this could have work before since window.location is indeed an object. Gonna investigate on browser-ui-test side.
Member
Author
There was a problem hiding this comment.
e2cad95 to
2262b8e
Compare
GuillaumeGomez
commented
Jun 23, 2026
| go-to: "file://" + |DOC_PATH| + "/lib2/index.html" | ||
| show-text: true | ||
|
|
||
| // The setting should be disabled. |
Member
Author
There was a problem hiding this comment.
To confirm this test works, run it without the fix. It should fail. :)
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Can be reproduced as follows on
stddocs:Directly go to item in search if there is only one resultsettingDirectly go to item in search if there is only one resultsettingThanks @poliorcetics for the detailed steps. :)
The problem is that, we don't necessarily create the tabs in one particular order and if any tab has exactly one result, in some cases, it's good enough for the feature. So this PR adds a check to ensure it's only taken into consideration in the first tab, ignoring the other two.
cc @lolbinarycat
r? @notriddle