Problem/Motivation
In some complex projects we can have a ton of patterns. That makes their preview and their selection quite complicated.
Now #3311464: Sort UI Pattern definitions has been committed, things are better but I believe we could do even better by allowing pattern creators to define the group their pattern belong to, like it can be done in modules definitions for example.
Proposed resolution
Follow Core's handling of modules' packages and allow patterns to be assigned to a group in their definition.
When a pattern has no group, assign it to the "- Other -" group.
If the only existing group is the "- Other -" one, consider that there is no group at all.
Alter the /patterns controller to cluster patterns links by group and add the group name in the pattern definition detail.
Alter the patterns select lists to use groups as optgroup elements.
Groups should always be sorted alphabetically and patterns should also be sorted alphabetically within each group.
Issue fork ui_patterns-3328272
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
grimreaperComment #3
grimreaperComment #4
grimreaperShould a "weight" be introduced like on UI Skins and UI Styles?
Comment #5
duaelfrI believe it wouldn't hurt to have it here too :)
Comment #7
grimreaperComment #8
grimreaperOk. It seems that there is a problem with DS on Drupal 10.
So review ready for this MR.
Comment #9
grimreaperThis is definitely not related to this MR. https://www.drupal.org/pift-ci-job/2568984
Comment #11
grimreaper