Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/librustdoc/html/static/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ function preLoadCss(cssUrl) {
aria-label="Run search in the documentation"
autocomplete="off"
spellcheck="false"
placeholder="Type ‘S’ or ‘/’ to search, ‘?’ for more options…"
placeholder="Search API docs"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer to keep it as is until we come up with a solution on how to tell people that this shortcut exists.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Already told to people by help button.

Copy link
Contributor

@notriddle notriddle Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the current placeholder is a good idea at all.

  • It's shown auto-focused, which is confusing just like liigo says.
  • It's telling you how to open search mode after search mode is already open, which is too late to be useful.

In other words, I agree with the change in this PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discovering a shortcut while using a feature is better than hiding it all the time. The help menu is not a good place to discover shortcuts sadly. Also, when the input is focused, as long as it's empty, the placeholder is displayed (at least on firefox).

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue still remains though.

type="search">
</form>
</nav><div class="search-switcher"></div>`;
Expand Down Expand Up @@ -683,6 +683,7 @@ function preLoadCss(cssUrl) {
break;

case "+":
case "=":
ev.preventDefault();
expandAllDocs();
break;
Expand Down Expand Up @@ -1620,7 +1621,7 @@ function preLoadCss(cssUrl) {
["↓", "Move down in search results"],
["← / →", "Switch result tab (when results focused)"],
["&#9166;", "Go to active search result"],
["+", "Expand all sections"],
["+ / =", "Expand all sections"],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We generally avoid adding new shortcuts to not overwrite existing browser/user's shortcuts.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the current + shortcut is not just only +, it's really shift+=.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

User press - (no shift needed), it works. But if he press + (without shift), it not works, this is a bit weird, or not convenient.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It works with just + for me without shift.

Copy link
Contributor

@lolbinarycat lolbinarycat Nov 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not the case for me on firefox, what browser and keyboard layout are you using?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qwerty and firefox

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very strange, that's the same here, you don't happen to have any extensions or userscripts that could be changing that behavior, do you?

What's your exact browser version?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only adblock. Version 143.0.3.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah ok, I understand the issue now. It's because I use the numpad. Well I guess = is fine then.

["-", "Collapse all sections"],
// for the sake of brevity, we don't say "inherit impl blocks",
// although that would be more correct,
Expand Down
Loading