From 0531a5ffb1b00b4b6e4c9a217c330b44531d9e3f Mon Sep 17 00:00:00 2001 From: Jan-Niclas Loosen Date: Sat, 26 Sep 2026 19:23:47 +0200 Subject: [PATCH] docs: lit-divi-catalog shows both result shapes (trial) Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7 --- docs/guides/divi-attrs.md | 4 ++++ src/Integrations/Divi/Schema/DiviCatalogAbility.php | 6 +++++- .../Divi/Schema/DiviCatalogAbilityTest.php | 10 ++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/docs/guides/divi-attrs.md b/docs/guides/divi-attrs.md index 9de9be7..f07f680 100644 --- a/docs/guides/divi-attrs.md +++ b/docs/guides/divi-attrs.md @@ -53,6 +53,10 @@ mit eigenen HTML-/Attribut-Feldern beim Speichern – nur wenn die Seite noch ni `linkUrl`) ist der Eintrag stattdessen eine Zuordnung Unterfeld → Feldart (`{"text": "text", "linkUrl": "url"}`), soweit für die einzelnen Unterfelder ableitbar; fehlende Pfade oder Unterfelder gelten als unbekannt, statt eine Feldart zu raten. +- Ergebnisform ohne `module`: `{"modules": [{"name": "divi/heading", "title": "Heading", "category": "module", + "children": [], "shortform": true}, …], "notes": […]}`; mit `module`: `{"module": {"name": "divi/heading", + "title": …, "children": […], "item_type": null, "shortform": {"text": {"path": "title.innerContent", …}}, + "paths": […], "path_kinds": {…}}, "notes": […]}`. - `lit-divi-node-get` zeigt die gesetzten Werte eines vorhandenen Knotens in genau dieser Form (`attrs`). - Schrift-Gruppen liegen eine Ebene tiefer: `…decoration.font.font`, `…decoration.bodyFont.body.font`, `…decoration.headingFont.h2.font`, `module.advanced.text.text`. diff --git a/src/Integrations/Divi/Schema/DiviCatalogAbility.php b/src/Integrations/Divi/Schema/DiviCatalogAbility.php index 0c50857..9c0da80 100644 --- a/src/Integrations/Divi/Schema/DiviCatalogAbility.php +++ b/src/Integrations/Divi/Schema/DiviCatalogAbility.php @@ -38,7 +38,11 @@ final class DiviCatalogAbility implements Ability return 'Listet die Divi-Module dieser Website (Name, Titel, Art, erlaubte Kind-Module) und welche eine ' . 'Kurzform haben; ohne module alle Module. Mit module: Kurzform-Felder und alle gültigen ' . 'Attributpfade des Moduls für die Vollform, je Pfad nach Möglichkeit mit Feldart (path_kinds), bei ' - . 'zusammengesetzten Pfaden als Zuordnung Unterfeld => Feldart.'; + . 'zusammengesetzten Pfaden als Zuordnung Unterfeld => Feldart. Ergebnis ohne module: ' + . '{"modules": [{"name": "divi/heading", "title": "Heading", "category": "module", "children": [], ' + . '"shortform": true}, …], "notes": […]}; mit module: {"module": {"name": "divi/heading", "title", ' + . '"category", "children", "item_type", "shortform": {Feld: {path, sub, kind, description}}, "paths": ' + . '[…], "path_kinds": {Pfad: Feldart}}, "notes": […]}.'; } public function inputSchema(): array diff --git a/tests/Unit/Integrations/Divi/Schema/DiviCatalogAbilityTest.php b/tests/Unit/Integrations/Divi/Schema/DiviCatalogAbilityTest.php index 21836c4..fde2bb9 100644 --- a/tests/Unit/Integrations/Divi/Schema/DiviCatalogAbilityTest.php +++ b/tests/Unit/Integrations/Divi/Schema/DiviCatalogAbilityTest.php @@ -21,6 +21,16 @@ final class DiviCatalogAbilityTest extends TestCase return new DiviCatalogAbility($modules); } + /** Trial feedback: both result shapes as one-line examples. */ + public function testDescriptionShowsBothResultShapes(): void + { + $description = $this->ability()->description(); + + self::assertStringContainsString('{"modules": [{"name": "divi/heading"', $description); + self::assertStringContainsString('{"module": {"name": "divi/heading"', $description); + self::assertStringContainsString('"notes": [', $description); + } + public function testListsModulesWithShortformFlag(): void { $result = $this->ability()->execute([]);