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.
Comments
Comment #4
deciphered