crossplane / docs

Repo for Crossplane documentation.
https://docs.crossplane.io
Other
49 stars 112 forks source link

Improve expand box ("accordion") visibility #480

Open plumbis opened 1 year ago

plumbis commented 1 year ago

Spinning out of #473-

expand shortcode blocks are easy to miss The expand shortcode is used to hide blocks of text by default. However, in practice these blocks are really easy to miss when reading or scanning a doc, so I think the content hidden by them very rarely gets viewed.

A specific case where this hurts is when a search result is hidden in one of these blocks. e.g. searching the docs for EnvironmentConfig yields one page result that takes you to docs.crossplane.io/latest/software/install. If you then use your browser to "find on page", you get 0 results. EnvironmentConfig looks to not actually be on that page at all, but it's actually hidden underneath the "feature flags" expand block.

Can the expand blocks be made more visually noticeable?

plumbis commented 1 year ago

In dark mode the boxes are white on black so I don't think we need to address them there (feedback welcome) Screenshot 2023-06-28 at 4 50 00 PM

jbw976 commented 1 year ago

Dark mode is my default and I still miss these boxes all the time. Yes, they are very visually noticeable in the sense that I can see the white box on the page, but discovering that it has content inside of it and I can/should expand it to see the content is something I constantly miss.

So at least in dark mode, the problem doesn't seem to be that the boxes themselves are not visible - we just don't see that we're supposed to do anything with them.

Perhaps there's a way to make the expanding action more noticeable? the expander icon is far away on the right from the text, so maybe it's harder to notice because of that?

What else could be done to make it obvious that you can take action on this box to expand it? can they be auto expanded when search results are contained within them? 🤔

plumbis commented 1 year ago

@jbw976 noticed today they are easier to read when they are inside a callout/hint box.

Need to investigate if we can move all expands into hint boxes or just restyle.

jbw976 commented 9 months ago

I continue running into this problem of it being hard to notice the expand accordion boxes and at least one other community member does too 😂 https://github.com/crossplane/crossplane/discussions/5271#discussioncomment-8203393

plumbis commented 9 months ago

(direct link for reference)

I'm open to ideas on how to improve, but I'm not sure I have any. Do you have any examples of sites (even if they aren't docs) that do this well?

I'm reluctant to remove the collapsable feature since it just moves the problem around (e.g., "oh, i didn't see the link to the external reference") or dilutes the content (i.e., adds a ton of noise)

jeanduplessis commented 9 months ago

I'm currently at a loss on a quick tweak to improve the component to stand out visually without being a distraction.

Maybe with a slight background color change: Before: CleanShot 2024-01-24 at 09 49 42@2x After: CleanShot 2024-01-24 at 09 49 24@2x

I would also make the argument we should have these content areas expanded by default. With the content collapsed, it's not searchable by the native browser find/search (Cmd+F) functionality. If I'm on a page an looking for a specific keyword that's in a collapsed accordion, then I might not be able to find it easily.

jeanduplessis commented 9 months ago

I managed to chat with my former colleague, @quinnkeast, on this topic, and he kindly shared some thoughts that could help resolve this challenge. Below are Quinn's thoughts.


However, in practice these blocks are really easy to miss when reading or scanning a doc, so I think the content hidden by them very rarely gets viewed.

If it's a goal for the content to be viewed, then the content should not be in an accordion. I would anticipate very infrequent viewing and wouldn't consider views alone to be a performance metric for this. Instead, I'd want to see if someone can find an answer that's found within an accordion when they're explicitly looking for that answer. E.g. ask a user to answer a question that requires viewing an accordion's content to answer it, but don't mention anything about the accordions. If the page and content is designed properly, then they should be able to drill in without thinking consciously about it. This would be an example of a page where perhaps both the content and visual design could be improved at the beginning.