Skip to content

[rustdoc] discoverability of parameter and return type search results #55056

@memoryruins

Description

@memoryruins

spawned from https://github.com/onur/docs.rs/issues/241

The ability to search by parameter and return types sometimes goes undiscovered, even when the feature is desired (see the issue above). Part of this might be because the options do not appear until after the first search.

Currently, results look like the following. It seems benign if one knows to read it as "Results for PAddr In Names", but that might not be immediately obvious.

paddr_name

Some ideas:
Move the bar closer to the search bar (removed the "In"s). This change alone might not be entirely obvious either, although it gives the tabs more breathing space.
paddr_edit_2

To help show that the tabs affect the search results, we could change the tab titles to be read as actions.
paddr_edit

from @Havvy

I like both suggestions. I even have one more to add. In the "Results for X", it should say "Results for X in Parameters" when searching parameters. Though that won't help with discoverability. "Results for X in Names" would look weird though, so leave that one off.

Variation of the above:

Name Results for X
Parameter Results for X
Return Type Results for X

Metadata

Metadata

Labels

T-rustdocRelevant to the rustdoc team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions