Vereinfache die Abschnittsabstände auf oben, unten und Widget-Abstand.
CI Feature / test (push) Successful in 42s
Deploy Test / test (push) Successful in 37s
Deploy Test / deploy (push) Successful in 31s

Die Abschnittshülle Version 2 kennt genau drei unabhängige Abstände mit
denselben Stufen (Kein Abstand, Kompakt, Normal, Großzügig):
- spacing_top / spacing_bottom: Innenabstand des Abschnitts; zwischen
  zwei Abschnitten addieren sich unten und oben (0 + 0 = 0).
- gap: Abstand zwischen den Plätzen des Rasters, nebeneinander und
  gestapelt. Widget-Innenabstände bleiben im Widget.

Entfallen sind „Abstand oben und unten“, die Abweichung „Abstand oben“
(same/small/none), die versteckte Regel, die oben zwischen zwei
Abschnitten ohne Fläche auf null setzte, und der Trenner „Zusätzlicher
Abstand“.

Hüllen der Version 1 werden beim Lesen ohne Layoutänderung übersetzt
(SectionStyle::migrateSpacing); gespeicherte Revisionen bleiben. Einzige
Abweichung: „Gering“ hat keine eigene Stufe mehr und wird „Kompakt“.

Tests bewusst angepasst (Hüllenversion 2, neue Klassen, Prüfung freier
Werte über die neuen Schlüssel); neue Tests für Addition, Vorgaben und
die Übersetzung aller Fälle der Version 1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
LarsandClaude Opus 5.5 committed 2026-11-18 12:39:57 +01:00
1 parent f4d225d0b2
commit f511ad10de
10 files changed
+238 -94

No files matched your search

+6 -3
View File
@@ -65,7 +65,7 @@ public function test_sections_are_normalized_with_slots_matching_the_layout(): v
$this->assertCount(2, $stored);
$this->assertSame('u1_3', $stored[0]['layout']);
$this->assertSame(1, $stored[0]['v']);
$this->assertSame(2, $stored[0]['v'], 'Hülle Version 2: drei unabhängige Abstände.');
$this->assertSame('dark', $stored[0]['style']['background']);
$this->assertSame('line', $stored[0]['style']['divider']);
$this->assertSame('standard', $stored[0]['style']['width']);
@@ -141,7 +141,9 @@ public function test_free_style_values_and_unknown_layouts_are_rejected(): void
[['layout' => 'u5', 'slots' => []], 'sections.0.layout'],
[$this->section('u4', [], ['background' => '#ff00ff']), 'sections.0.style.background'],
[$this->section('u4', [], ['css' => 'color: red']), 'sections.0.style.css'],
[$this->section('u4', [], ['spacing' => 'riesig']), 'sections.0.style.spacing'],
[$this->section('u4', [], ['spacing_top' => 'riesig']), 'sections.0.style.spacing_top'],
[$this->section('u4', [], ['spacing_bottom' => '0px']), 'sections.0.style.spacing_bottom'],
[$this->section('u4', [], ['gap' => '3rem']), 'sections.0.style.gap'],
] as [$section, $key]) {
try {
$this->sections()->normalize([$section]);
@@ -218,7 +220,8 @@ public function test_reading_without_sections_wraps_legacy_blocks_in_single_colu
$this->assertCount(2, $sections);
$this->assertSame('u4', $sections[0]['layout']);
$this->assertSame('compact', $sections[0]['style']['spacing']);
$this->assertSame(['compact', 'compact', 'normal'], [$sections[0]['style']['spacing_top'], $sections[0]['style']['spacing_bottom'], $sections[0]['style']['gap']]);
$this->assertSame('none', $sections[1]['style']['spacing_top'], 'Wie bisher steht zwischen zwei Altbausteinen nur einmal der kompakte Abstand.');
$this->assertSame('Alt', $sections[0]['slots'][0]['data']['heading']);
$this->assertSame('prose', $sections[1]['slots'][0]['type']);
}