Problem/Motivation

The Frontend picker on the preview screen is one flat list. Each option repeats its consumer's label before the target's own. With several consumers, an editor has to read every label to find a frontend.

Proposed resolution

Group the targets by consumer in the Frontend picker, with one optgroup for each consumer.

  • The settings.php targets come first, in a group labelled "Site".
  • The consumers follow in label order. Inside a group, each option shows the target's own label.
  • When two groups have the same label, each consumer group adds its consumer ID, such as "Nuxt (3)". A consumer labelled "Site" then does not join the site group.
  • The target keys and the flat options do not change, so ?frontend= links keep working.

Remaining tasks

  • Review the merge request.

User interface changes

The Frontend picker shows option groups: screenshot.

API changes

Adds PreviewTargetsProviderInterface::getGroupedTargetOptions(). The targets from getAllTargets() also gain group, group_id and option_label values.

Data model changes

None.

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

deciphered created an issue. See original summary.

  • deciphered committed a5393d65 on 1.0.x
    feat(#3634696): group the Frontend picker's targets by consumer
    
deciphered’s picture

Status: Active » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.