ui_patterns icon indicating copy to clipboard operation
ui_patterns copied to clipboard

Sort patterns by label on the overview page

Open aleksip opened this issue 8 years ago • 6 comments

Currently patterns seem to be listed in a 'random' order. It would be nice to have them sorted by the pattern label in alphabetical order.

aleksip avatar Jan 27 '17 14:01 aleksip

I would actually add a weight field to the definition, what do your think?

ademarco avatar Jan 27 '17 14:01 ademarco

The I was also thinking to introduce tags on pattern definitions so that we can tag patterns and print better overview pages.

Also tags will be useful to propose patterns by contexts (which will be expressed with tags) so that we don't have a button pattern proposed as a page layout etc.

ademarco avatar Jan 27 '17 14:01 ademarco

I like the tags idea, weight could be hard work to update if there are many patterns? So maybe first sort by tags, then final sort by label alphabetically? :)

Maybe the tags could create a hierarchy, so when e.g. using atomic design principles one could tag a pattern with molecules, text and it would go in top level molecules group and in a text subgroup?

aleksip avatar Jan 27 '17 16:01 aleksip

I Love the idea of tags and weights. I would like to suggest that we add a weight to the tags. This way if I want to use atomic design great. But if I want to roll my own design structure I can decide which tags should receive a higher or lower weight.

kclarkson avatar Feb 11 '17 18:02 kclarkson

Yes we could use the same way Symfony uses tags on services, with weights and all.

ademarco avatar Feb 11 '17 18:02 ademarco

I wonder if using Drupal\Component\Plugin\CategorizingPluginManagerInterface and Drupal\Core\Plugin\CategorizingPluginManagerTrait is a place to start? Provides one level of categorization as well as label sorting out of the box and could be extended beyond that?

Initial implementation would look something like https://github.com/drclaw/ui_patterns/commit/fd94b87987ce80ca13ba42bec5ffa1ee82697906

drclaw avatar Dec 12 '17 01:12 drclaw