diff --git a/docs/superpowers/specs/2026-08-12-related-stories-layouts-design.md b/docs/superpowers/specs/2026-08-12-related-stories-layouts-design.md index 86072ad..89a3ba6 100644 --- a/docs/superpowers/specs/2026-08-12-related-stories-layouts-design.md +++ b/docs/superpowers/specs/2026-08-12-related-stories-layouts-design.md @@ -29,6 +29,10 @@ The block editor adds an inspector panel named “Related stories settings” wi - A `SelectControl` named “Layout” containing “Adaptive,” “Grid,” and “Carousel.” - Short help text: adaptive uses a grid on larger screens and horizontal scrolling on smaller screens. +`SelectControl` returns strings. Its `limit` handler strictly allowlists the incoming value and persists an integer: `setAttributes({ limit: Number(value) === 5 ? 5 : 3 })`. Tests prove the saved attribute is numeric `5`, never string `"5"`. + +The block metadata declares `editorScript: file:../../assets/js/editor-related-posts.js`. Its adjacent asset metadata declares the WordPress dependencies used by a narrowly scoped `editor.BlockEdit` wrapper. This makes the controls available both in the post editor and in the Site Editor, where the Single template owns the default block instance; it does not rely on the post-only enqueue guard in `inc/editor.php`. + The server renderer owns validation. Malformed or legacy attributes fail closed to the defaults. Editor controls cannot be the only validation boundary. ## Rendered contract @@ -38,10 +42,10 @@ The existing semantic section and card markup stay intact. The list wrapper chan ```html