canonical / vanilla-framework

From community websites to web applications, this CSS framework will help you achieve a consistent look and feel.
https://vanillaframework.io
GNU Lesser General Public License v3.0
841 stars 167 forks source link

A new "Show-more" pattern #2815

Closed solazio closed 2 years ago

solazio commented 4 years ago

This would be used to wrap any tall <tag> and "truncate" it to a specific height. Once clicking the "Show more" button the full size of the <tag>.

Currently this pattern is used on snapcraft in 3 locations:

Link to codepen: https://codepen.io/solazio/pen/gOpYVqQ

bartaz commented 4 years ago

Extends on existing "back to top"

WG:

@danielmutis Provide examples where it works where it doesn't

danielmutis commented 4 years ago

Examples of places where it works

Snapcraft first snap flow: Screenshot 2020-02-26 at 14.01.28.png

Snapcraft list of users by distro for a single snap: Screenshot 2020-02-26 at 14.02.37.png

Example where it looks odd

Builds table: Screenshot 2020-02-26 at 14.03.50.png

matthewpaulthomas commented 4 years ago

Extends on existing "back to top"

I don’t know how much the similarity with “Back to top” is intentional. But things that act different should look different, and the behaviour of “Show more” is completely different from “Back to top”. So I think it’s misleading for them to look as similar as they do.

Interaction-wise, this is bog-standard progressive disclosure. Vanilla has an existing element for progressive disclosure, though it’s not currently described: <details>.

And Vanilla sites currently use a variety of icons for progressive disclosure, for example “+” and “–” in MAAS:

Now, we don’t have to use the same icon or style for this everywhere. For example, GitHub uses three different icons for progressive disclosure in different layout situations. What I do think we need, if we’re going to have more than one, is an explanation of when to use each one.

Snapcraft first snap flow: Screenshot 2020-02-26 at 14.01.28.png

That probably isn’t a good example to base a pattern on, for two reasons. First, it’s usually hiding ten lines or fewer, so it’s probably consuming more time in clicking than it saves in scrolling. And second, the purpose of that block is to show off how short and simple the Yaml is, so hiding part of it by default is defeating the point.

Example where it looks odd

Builds table:

I don’t understand the purpose of this one either, since there’s nothing below that table except the footer, so you won’t be trying to scroll past it. That aside, can you elaborate on why it looks odd? Some possibilities:

In short, I think this needs:

bartaz commented 4 years ago

We could use the new 'Show more' styling used in modular table, with an addition of faded background.

We should propose a new container component that uses the ones mentioned above.

bartaz commented 3 years ago

This have been through WG before, but because it needs UX work we should pass it though our new process.

clagom commented 3 years ago

@elioqoshi to investigate this and look at the modular table spec for existing solutions.

clagom commented 3 years ago

@SirSamTumless ready for planning

clagom commented 3 years ago

WG: keeping it simple, this should just be a command blue link (related to the command link discussion) without lines, icons or any other elements.

clagom commented 3 years ago

WG: on the link area in Vanilla include this "show-more" option recommending using the command-link: https://vanillaframework.io/docs/patterns/links

clagom commented 2 years ago

Work in progress here: https://app.zenhub.com/workspaces/-design-system-tribe-59438c953747487777fbe484/issues/canonical-web-and-design/vanilla-framework/3923