-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Prevent feature information to be hidden if it's on the impl directly #79300
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2332,12 +2332,18 @@ function defocusSearchBar() { | |
var dontApplyBlockRule = toggle.parentNode.parentNode.id !== "main"; | ||
if (action === "show") { | ||
removeClass(relatedDoc, "fns-now-collapsed"); | ||
removeClass(docblock, "hidden-by-usual-hider"); | ||
// Stability information is never hidden. | ||
if (hasClass(docblock, "stability") === false) { | ||
removeClass(docblock, "hidden-by-usual-hider"); | ||
} | ||
onEachLazy(toggle.childNodes, adjustToggle(false, dontApplyBlockRule)); | ||
onEachLazy(relatedDoc.childNodes, implHider(false, dontApplyBlockRule)); | ||
} else if (action === "hide") { | ||
addClass(relatedDoc, "fns-now-collapsed"); | ||
addClass(docblock, "hidden-by-usual-hider"); | ||
// Stability information should be shown even when detailed info is hidden. | ||
if (hasClass(docblock, "stability") === false) { | ||
addClass(docblock, "hidden-by-usual-hider"); | ||
} | ||
Comment on lines
+2344
to
+2346
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does stability have to do with it? IIUC this is hiding it when you have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh that's interesting in fact! Let me check that. If you're right, we're badly handling a few things in there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, so "stability" groups a few things, including the feature attributes. Inside it, it is the "portability" class the important one. However, we don't generate items like "deprecated" on implementations as it seems. And even if we did, it'd make sense to print them, and since they're stored inside the <div class="stability">
<div class="stab portability">This is supported on <strong>non-crate feature <code>traits</code></strong> only.</div>
</div> And deprecated looks like this: <div class="stability">
<div class="stab deprecated"><span class="emoji">👎</span> Deprecated</div>
</div> And when you merge both: <div class="stability">
<div class="stab deprecated"><span class="emoji">👎</span> Deprecated</div>
<div class="stab portability">This is supported on <strong>non-crate feature <code>traits</code></strong> only.</div>
</div> So it kinda makes sense, however we should maybe rename the item class. What do you think about renaming it then? However, I'll do it in another PR to prevent mixing too much things. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Printing both, even on implementations, sounds like the right approach to me :) happy to wait for another cleanup PR. |
||
onEachLazy(toggle.childNodes, adjustToggle(true, dontApplyBlockRule)); | ||
onEachLazy(relatedDoc.childNodes, implHider(true, dontApplyBlockRule)); | ||
} | ||
|
Uh oh!
There was an error while loading. Please reload this page.