Skip to content

DOC: dropdowns in userguide #24493

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

Closed
wants to merge 9 commits into from
Closed

DOC: dropdowns in userguide #24493

wants to merge 9 commits into from

Conversation

story645
Copy link
Member

@story645 story645 commented Nov 18, 2022

PR Summary

wrapped most of the 2nd level menus in the user guide in dropdowns:
image

My reasoning was that this page kind of didn't seem to have enough content to be a site map but had too much to be easily scannable as an index, so I think the drop downs may provide a way to scan for the content folks might want. I mostly kept the titles from each page, except Explanations->Guide to Matplotlib 'cause those docs seem like the closest to a narrative user guide.

ETA: also did not touch the ordering except to add a link to the third-party-page 'cause I can never find it and that's honestly why I touched this page in the first place.

ETA2: Circle Link

@story645 story645 added the Documentation: website layout/behavior/styling changes label Nov 18, 2022
Copy link
Contributor

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

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

My 2 cents:

I think that this is a clever way of providing top-level information to help others quickly scan the page without being over-loaded. There's always a trade-off between "hiding things behind a click" and "showing so much that it's overwhelming", and this seems like a reasonable balance between the two. It also somehow feels a bit more polished to me because of the UI elements instead of lists of raw links. I think it's worth trying and seeing what kind of feedback readers give

@timhoffm
Copy link
Member

timhoffm commented Nov 18, 2022

I totally agree that the current index is way too much information. Towards that, this is a significant improvement. However, I'm not a fan of using dropdowns here, because you have to click a lot to know where you may want to be going. I'd rather shorten the list of targets. One may or may not still have visual grouping or panels or whatever to make the GUI look nicer.

Shortening: For a number of the sections, we don't need to reference the subsections on the overview page. For example, linking Installation is enough. We don't need all the subsection links. They anyway go to the same page, which has the TOC in the sidebar. It's better to just click Installation and be on the page and then use the naviation on that page.

Fancy GUI: For example for the "Tutorials and examples" section, I suggest three clickable cards in a row (https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/web-components.html#cards).

@story645
Copy link
Member Author

story645 commented Nov 18, 2022

Tim your suggestions are great but at that point this page is then just recreating the docs landing page and then the question is does more of this stuff need to get pushed there and then this page can go away? Which like I wouldn't disagree with either...but while this page exists some of my reasoning for including the level 2 TOC is so folks can browse through them and see if the installation page is really what they want.

@jklymak
Copy link
Member

jklymak commented Nov 18, 2022

I think the User Guide Page is a bit of a misnomer, but that aside, I prefer the information content unfolded as it currently is. I think it's unattractive, but it's pretty easy to skim for the correct information, whereas folding hides a lot of content. A multicolumn layout or some such would be fine, but I think the more fundamental issue is the awkward match between the rst docs and the tutorials/gallery; much of what is in the tutorials would more logically be called part of a Users Guide.

@tacaswell tacaswell added this to the v3.7.0 milestone Nov 18, 2022
@story645
Copy link
Member Author

it's unattractive, but it's pretty easy to skim for the correct information

I have the opposite problem - I find it really overwhelming and like being able to unfold as I go. But maybe grids + styling the cards so they look more like accordions? I'm trying that, might be a bit cause the icons are annoying.

@anntzer
Copy link
Contributor

anntzer commented Nov 18, 2022

I think the more fundamental issue is the awkward match between the rst docs and the tutorials/gallery; much of what is in the tutorials would more logically be called part of a Users Guide.

FWIW I think that moving the tutorials to use sphinx-gallery was a mistake -- s-g works well for short examples, but the "tutorials" are (should be?) first and foremost text, with some code interspersed, for which the plot directive works just fine (especially with download icons, per #24205 (comment)); moving back to plain rst should simplify better organization.

@tacaswell
Copy link
Member

Either way, I think this is too big to backport.

I am sympathetic to both the pro and con to switching to the foldable things. Can we start all the folds open? That way if people just want to skim they can and there is an easy way to hide things that you have already looked to reduce the noise?

@story645
Copy link
Member Author

story645 commented Nov 18, 2022

Yes but I think this actually looks pretty good/less a lot than I thought it would be:
image

ETA: I put this view in the second commit. I can't quite sort out the .css to remove all the styling though.
ETA2: circle link

@story645
Copy link
Member Author

So decided to shuffle a bit b/c I think it focuses things a bit and kinda ties into Anthony's point that our tutorials/narrative docs boundary isn't as clean as the divio structure:

image

I am not at all sure about the section titles but these are more or less the ones currently there. I'd possibly even get rid of them since they don't show up in the sidebar since they're card titles.

story645 added a commit to story645/matplotlib that referenced this pull request Nov 18, 2022
Mostly it just looks really odd in autogenerated table of contents (xref matplotlib#24493)/
@story645
Copy link
Member Author

And 3rd commit is a full shuffle based on how my brain works:
image

@timhoffm
Copy link
Member

timhoffm commented Nov 18, 2022

👍 on the structure

Still not on board with the dropdowns. We can't leave vast amounts of white space and force the users to expand everything manually:

image

@jklymak
Copy link
Member

jklymak commented Nov 18, 2022

Obviously a taste thing, but I usually resent drilling down webpages to find things. I think we can use styling or better bullets etc to make the page less overwhelming.

@story645
Copy link
Member Author

On my computer there's almost no white space, but I'll tweak drop downs to be open by default and maybe styled plain and then I'll post that screenshot.

@story645
Copy link
Member Author

story645 commented Nov 20, 2022

So joy, lots of white space on my big screen, none on my laptop screen :/

I think with default open it's probably better to keep the styling: (ETA: also I can't figure out how to change it 🙃)
image

ETA: Also like I want to change all the titles and stuff so everything is in a similar voice/tense but totally out of scope here.

Copy link
Member

@timhoffm timhoffm left a comment

Choose a reason for hiding this comment

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

Semi off-topic: This page claims to be the user guide but is actually more a table of contents of the whole page. This is currently by design, but is a mismatch between claimed and actual content (see also #21251 (comment)).

I think the visual change here is an improvement, but I feel this is not the final solution.

###########
Users guide
###########
.. grid-item-card:: Information
Copy link
Member

Choose a reason for hiding this comment

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

Can you leave the card out and replace it with a regular title? I feel the double nesting of cards and dropdowns is a bit much.

Copy link
Member Author

Choose a reason for hiding this comment

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

Let me try regular grid instead of card?

Copy link
Member Author

Choose a reason for hiding this comment

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

ok, so regular grid is worse cause the responsiveness of cards is better but it might be fixable w/ styling.

Copy link
Member Author

Choose a reason for hiding this comment

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

ok so responsiveness has nothing to do w/ cards just w/ grid but I have a hacked together thing going here

Copy link
Member Author

@story645 story645 Nov 22, 2022

Choose a reason for hiding this comment

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

ok, so added a commit w/ grids no cards but don't like that the titles are teensy:
image

circle link

@story645
Copy link
Member Author

story645 commented Nov 22, 2022

This page claims to be the user guide but is actually more a table of contents of the whole page.

Yeah totally agree, and I think the real solution is some combination of information architecture and something in line w/ what @anntzer and @jklymak are saying about how our tutorial/guide boundaries are fuzzy and I think could be consolidated/unified, but I think that's maybe a good GSOD proposal if there are RFPs in February.

I wouldn't mind this not being in the navigation bar or renaming the link to documentation. Um is mpl.css the right place to add the styling or should I be using something else? Also if we want dropdowns anywhere else, I think I'm gonna have to package everything into a class.

8?th commit is cards + dropdowns, but styled so it's kind of invisible/looks like the toc-tree:
image

I am very much not a fan of the user guide page title here but couldn't figure out how to get the html title working. Also, removing the title adds back the left sidebar

@jklymak
Copy link
Member

jklymak commented Nov 23, 2022

The problem with the screenshot above is that the title of the subsection has a smaller font (though demi-bold) than topics below them. That makes it pretty hard to parse and looks like a mistake.

@story645
Copy link
Member Author

I can try putting a color or something back in? my goal was that when closed it wouldn't look cluttered:
image

@jklymak
Copy link
Member

jklymak commented Nov 23, 2022

I think there is plenty of room for the heading font size to be larger. But certainly you should not have the heading font size smaller than its content.

@story645
Copy link
Member Author

story645 commented Nov 23, 2022

Ok, so this is just everything is one size up
image

Hmm, I think w/ an indent, size becomes good enough to not need the grid top: (which @timhoffm I can't figure out how to do)
image

Edit: Also while not 100% accurate, "Information, Explanation, Reference" might be good enough?

@story645
Copy link
Member Author

story645 commented Nov 23, 2022

Ok so @timhoffm I did figure out the border but probably in the hackiest way and I'm cool w/ commits against this that tweak styles more.
image

@timhoffm
Copy link
Member

Ok so @timhoffm I did figure out the border but probably in the hackiest way and I'm cool w/ commits against this that tweak styles more.

I can have a look, though I’m not a CSS expert either. But likely not before the weekend. This is not necessarily a blocker. We can always fine-tune in a follow-up PR.

@story645
Copy link
Member Author

No idea why/what I did differently but now the borders don't disappear on fold up but this is commit 9
image

padding: 0;
}

:root {
Copy link
Member

Choose a reason for hiding this comment

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

The rest of the file seems to have been duplicated from above.

Copy link
Member Author

Choose a reason for hiding this comment

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

🤦‍♀️ yeah I uh accidentally edited the build/html and hastly c&pd it here. Thanks! Also do these changes even go in this file or somewhere else? I also feel like I should learn IDs 'cause this is gonna globally style drop downs, or cross that bridge in a follow up?

Copy link
Member

Choose a reason for hiding this comment

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

If you expect to use dropdowns elsewhere (or we already have some), then it would be best to add another class on these ones (an ID must be unique, so you'd have to add a bunch here.)

Copy link
Member Author

@story645 story645 Nov 24, 2022

Choose a reason for hiding this comment

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

I think that the only other places we currently have drop downs is the nav-toc which is not flagged as a drop down/classed separately, and the version switcher which is also its own thing.

But I guess a list of IDs #id1, ... #id2 isn't that bad - would I still need the exact class? So like would I be stuck doing #id1.li>toc or does it broadcast?

Sorry- how do I turn this into a class? I'm happy to bundle all the css info one thing that could then pass back to sphinx - I tried using the drop-down container class option and couldn't get it working.

Eta: I also opened an issue on pydata-sphinx about making it it's own directive and I wonder if that's the best way to do it?

Copy link
Member

Choose a reason for hiding this comment

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

It seems simpler to me to just add a single class to every dropdown here and to the CSS selector rather than come up with unique IDs to use for every dropdown and repeat the CSS selector for each one.

Copy link
Member Author

Choose a reason for hiding this comment

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

That definitely sounds more reasonable, I just don't know enough css to know how & I couldn't get the class-container option on drop-downs to work - I think i should have been able to remove shadows that way.

@story645
Copy link
Member Author

Since this has kind of run away, @melissawm and @noatamir what suggestions do you have about organizing this information? Particularly do these categories make sense, a different taxonomy? Also please help me name things if you have suggestions.

Explanations
------------

API Documentation
Copy link
Member

Choose a reason for hiding this comment

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

I think this is a confusing change as the difference between "API Reference" and "API Documentation" is very small in my reading.

Copy link
Member Author

Choose a reason for hiding this comment

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

Is there something more narrow/specific than explanations but less specific than API documentation?

@tacaswell
Copy link
Member

What is the current state of this PR?

@melissawm
Copy link
Member

Oops sorry I had lost this ping! Let me respond below.

@story645
Copy link
Member Author

@tacaswell not sure which of the 6 options (if any) folks are leaning towards & if this is enough of a UX improvement to be worth going in, and I probably should pull the styling into its own class.

@tacaswell
Copy link
Member

The concrete question is do we try to get this in for 3.7 or push this out to 3.8?

@story645
Copy link
Member Author

@tacaswell let's put it on the call?

I'm fine w/ pushing this out to 3.8/scrapping it in favor of a better UX suggestion, but if it doesn't seem like that's gonna happen in the next couple of release cycles than I can try and wrap this one up this weekend if we've decided on styles and names.

@story645 story645 modified the milestones: v3.7.0, v3.8.0 Dec 15, 2022
@story645 story645 marked this pull request as draft December 15, 2022 20:52
@story645
Copy link
Member Author

So talked w/ @melissawm offline and thinking an alternative proposal is to use the cards/grid to make a holistic TOC of sorts and keep the level two trees underneath so that folks can skim for holistic or all the things.

melissawm pushed a commit to melissawm/matplotlib that referenced this pull request Dec 19, 2022
Mostly it just looks really odd in autogenerated table of contents (xref matplotlib#24493)/
@story645
Copy link
Member Author

At this point, would make more sense to open a new PR with some of the distilled ideas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: website layout/behavior/styling changes status: needs rebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants