ui_patterns
ui_patterns copied to clipboard
Sort patterns by label on the overview page
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.
I would actually add a weight field to the definition, what do your think?
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.
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?
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.
Yes we could use the same way Symfony uses tags on services, with weights and all.
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