refactor: ein Helfer für Gruppen-Kurznamen (NodeSummary::groupShortName), ESCAPED_LETTER_REGEX am UsageQuery-Interface, Docblock DiviComposition::presets; Tests für Muster, Kurzname und Gruppen-Überdeckung

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Jan-Niclas Loosen
2026-10-18 17:40:21 +02:00
co-authored by Claude Sonnet 5.5
parent 6d7c59e3fa
commit e7793fd595
13 changed files with 70 additions and 16 deletions
@@ -23,6 +23,12 @@ final class NodeSummary
/** The admin label is a one-line title in the layers panel, never an unbounded copy. */
private const LABEL_LIMIT = 80;
/** "font-body" for the group name "divi/font-body" – the key "group_presets" of the write tools takes. */
public static function groupShortName(string $groupName): string
{
return str_starts_with($groupName, 'divi/') ? substr($groupName, 5) : $groupName;
}
public static function label(Block $block): string
{
$attrs = $block->name() === 'divi/global-layout' && is_array($block->attrs()['localAttrs'] ?? null)
+1 -2
View File
@@ -174,8 +174,7 @@ final class Outline
{
$lines = [];
foreach (NodeSummary::groupPresets($block) as $group) {
$name = $group['groupName'];
$short = str_starts_with($name, 'divi/') ? substr($name, 5) : $name;
$short = NodeSummary::groupShortName($group['groupName']);
$lines[] = $short . ': ' . implode(', ', $this->namesOf($group['presetIds']));
}