-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rustdoc: when running a function-signature search, tweak the tab bar #96590
Conversation
Some changes occurred in HTML/CSS/JS. |
r? @CraftSpider (rust-highfive has picked a reviewer for you, use r? to override) |
Considering it's a UI/UX change, I'd like to have @jsha and @Manishearth's opinion before going further. Personally I think it'd be a nice improvement. |
I think it's a good call! |
Agreed! This is something that's bugged me for a while. Thanks for fixing it. |
Ok so just remains to add a differentiation between returned value and "in function signature" and then let's go! |
There is a JS error when the results are displayed: The left/right arrows should be disabled in case there is only one column displayed, otherwise it looks like this (no "selected" header): Please add a check in your GUI test for the left/right arrows in such case to ensure that it doesn't change the selected header. |
This comment has been minimized.
This comment has been minimized.
1a4840f
to
88aabf8
Compare
Okay, I've got the keyboard shortcut thing fixed. |
I can confirm it's working locally as expected. 👍 |
I see. The error came up when there was a parse error, because the code doesn't work well when there's no tabs at all. To avoid adding a bunch of special-cases just for the parse error screen, I've added an "In Names" tab (conceptually, this is where doc aliases go), fixing the console log error. |
Just one last weird thing: It's a bit of strange rendering with doc aliases. Not a blocker though. You can try it with: #[doc(alias = "->a")]
pub struct Foo; Just confirming it's not an issue then let's go! What do you think of this @Manishearth @jsha ? I personally think it's fine but asking just in case. |
I get why this seems strange, but
|
I think @notriddle's comment makes sense and I think the image @GuillaumeGomez showed is fine. |
☔ The latest upstream changes (presumably #96720) made this pull request unmergeable. Please resolve the merge conflicts. |
I said I was fine with it but thanks for the extra explanations. :) r=me once you fixed the conflict. |
Co-Authored-By: Guillaume Gomez <[email protected]>
* If it's just `-> a`, use "In Function Return Types" * If it's just `a b`, use "In Function Parameters" * Otherwise, still use "In Function Signatures"
45cf0be
to
4c183cd
Compare
@bors r=GuillaumeGomez,jsha |
📌 Commit 4c183cd has been approved by |
…ch, r=GuillaumeGomez,jsha rustdoc: when running a function-signature search, tweak the tab bar # Before ![In Names (7) / In Parameters (0) / In Return types (0)](https://user-images.githubusercontent.com/1593513/166122875-ffdeafe6-8d4d-4e61-84a6-f5986b50ac35.png) # After ![In Function Signature (7)](https://user-images.githubusercontent.com/1593513/166122883-9a3d7515-3235-4ee3-8c4b-5401d109e099.png)
…ch, r=GuillaumeGomez,jsha rustdoc: when running a function-signature search, tweak the tab bar # Before ![In Names (7) / In Parameters (0) / In Return types (0)](https://user-images.githubusercontent.com/1593513/166122875-ffdeafe6-8d4d-4e61-84a6-f5986b50ac35.png) # After ![In Function Signature (7)](https://user-images.githubusercontent.com/1593513/166122883-9a3d7515-3235-4ee3-8c4b-5401d109e099.png)
…ch, r=GuillaumeGomez,jsha rustdoc: when running a function-signature search, tweak the tab bar # Before ![In Names (7) / In Parameters (0) / In Return types (0)](https://user-images.githubusercontent.com/1593513/166122875-ffdeafe6-8d4d-4e61-84a6-f5986b50ac35.png) # After ![In Function Signature (7)](https://user-images.githubusercontent.com/1593513/166122883-9a3d7515-3235-4ee3-8c4b-5401d109e099.png)
…ch, r=GuillaumeGomez,jsha rustdoc: when running a function-signature search, tweak the tab bar # Before ![In Names (7) / In Parameters (0) / In Return types (0)](https://user-images.githubusercontent.com/1593513/166122875-ffdeafe6-8d4d-4e61-84a6-f5986b50ac35.png) # After ![In Function Signature (7)](https://user-images.githubusercontent.com/1593513/166122883-9a3d7515-3235-4ee3-8c4b-5401d109e099.png)
…laumeGomez Rollup of 10 pull requests Successful merges: - rust-lang#96557 (Allow inline consts to reference generic params) - rust-lang#96590 (rustdoc: when running a function-signature search, tweak the tab bar) - rust-lang#96650 (Collect function instance used in `global_asm!` sym operand) - rust-lang#96733 (turn `append_place_to_string` from recursion into iteration) - rust-lang#96748 (Fixes reexports in search) - rust-lang#96752 (Put the incompatible_closure_captures lint messages in alphabetical order) - rust-lang#96754 (rustdoc: ensure HTML/JS side implementors don't have dups) - rust-lang#96772 (Suggest fully qualified path with appropriate params) - rust-lang#96776 (Fix two minor issues in hir.rs) - rust-lang#96782 (a small `mirror_expr` cleanup) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Before
After