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.

Command icon 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

DuaelFr created an issue. See original summary.

grimreaper’s picture

Assigned: Unassigned » grimreaper
grimreaper’s picture

grimreaper’s picture

Should a "weight" be introduced like on UI Skins and UI Styles?

duaelfr’s picture

I believe it wouldn't hurt to have it here too :)

grimreaper’s picture

Status: Active » Needs review
grimreaper’s picture

Ok. It seems that there is a problem with DS on Drupal 10.

So review ready for this MR.

grimreaper’s picture

This is definitely not related to this MR. https://www.drupal.org/pift-ci-job/2568984

  • Grimreaper committed af379f1f on 8.x-1.x
    Issue #3328272 by Grimreaper, DuaelFr: Group patterns in /patterns and...
grimreaper’s picture

Assigned: grimreaper » Unassigned
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.