fix: correct entry layout, light mode and editor parity
The single/page/404 templates set contentSize to 70ch, which resolves against each child's own font size: the display-size h1 asked for ~2660px and broke full bleed while the body stayed narrow. They now inherit the 720px from theme.json. Also drops the About facets that duplicated the portrait, adds the missing prefers-color-scheme branch for the character stage copy surface (dark text on a dark panel in System light), loads components.css in the editor, and replaces the unstyled index fallback with the journal stream. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
13 files changed
+221
-92
No files matched your search
+30
-24
@@ -68,12 +68,12 @@ class PatternsTest extends WP_UnitTestCase {
|
||||
$this->assertMatchesRegularExpression( '/<img\b[^>]*\bloading="lazy"[^>]*\bdecoding="async"/i', $content, $name );
|
||||
}
|
||||
$music = $this->render_pattern( get_theme_file_path( 'patterns/music-landing.php' ) );
|
||||
$this->assertStringContainsString( 'the-no-names-collage.jpeg', $music );
|
||||
$this->assertStringContainsString( 'the-no-names-musician-cutout.png', $music );
|
||||
$this->assertStringContainsString( 'the-no-names-collage-768.webp', $music );
|
||||
$this->assertStringContainsString( 'the-no-names-musician-cutout-768.webp', $music );
|
||||
$this->assertSame( 2, substr_count( $music, '<img' ) );
|
||||
|
||||
$show = $this->render_pattern( get_theme_file_path( 'patterns/podcast-show.php' ) );
|
||||
$this->assertStringContainsString( 'alter-ego-podcasts.png', $show );
|
||||
$this->assertStringContainsString( 'alter-ego-podcasts-768.webp', $show );
|
||||
$this->assertStringContainsString( 'alt=""', $show );
|
||||
$this->assertStringContainsString( 'aria-hidden="true"', $show );
|
||||
}
|
||||
@@ -89,9 +89,9 @@ class PatternsTest extends WP_UnitTestCase {
|
||||
$this->assertStringContainsString( 'the-no-names-collage-768.webp 768w', $content );
|
||||
$this->assertStringContainsString( 'sizes="(max-width: 599px) 100vw, 720px"', $content );
|
||||
$this->assertMatchesRegularExpression( '/class="chrnx-character-stage__collage"[^>]*loading="lazy"[^>]*alt=""/', $content );
|
||||
$this->assertStringContainsString( 'the-no-names-musician-cutout.png', $content );
|
||||
$this->assertStringContainsString( 'the-no-names-musician-cutout-768.webp', $content );
|
||||
$this->assertLessThan(
|
||||
strpos( $content, 'the-no-names-musician-cutout.png' ),
|
||||
strpos( $content, 'the-no-names-musician-cutout-768.webp' ),
|
||||
strpos( $content, 'the-no-names-collage-384.avif' )
|
||||
);
|
||||
}
|
||||
@@ -103,18 +103,22 @@ class PatternsTest extends WP_UnitTestCase {
|
||||
'Grunge mexicano para cerebros que no se callan.',
|
||||
'grunge en español mexicano desde Sinaloa',
|
||||
'estudio crudo, cero live',
|
||||
'El Hermoso Caos que habita en mi cabeza',
|
||||
'13-track debut album',
|
||||
'Ando Bien Arriba',
|
||||
'six-track bright mirrored EP',
|
||||
'Aquí se Rompió una Jerga',
|
||||
'six-track dark mirrored EP',
|
||||
'draft/in production',
|
||||
'generative AI',
|
||||
'Chrnx',
|
||||
) as $copy ) {
|
||||
$this->assertStringContainsString( $copy, wp_strip_all_tags( $content ), $copy );
|
||||
}
|
||||
|
||||
// Release names moved out of the pattern into the chrnx_release vocabulary.
|
||||
$releases = chrnx_get_editorial_taxonomies()['chrnx_release']['terms'];
|
||||
foreach ( array(
|
||||
'El Hermoso Caos que habita en mi cabeza',
|
||||
'Ando Bien Arriba',
|
||||
'Aquí se Rompió una Jerga',
|
||||
) as $release ) {
|
||||
$this->assertContains( $release, $releases, $release );
|
||||
}
|
||||
$this->assertStringContainsString( 'chrnx/release-list', file_get_contents( get_theme_file_path( 'patterns/music-landing.php' ) ) ); // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- Local test fixture.
|
||||
$this->assertDoesNotMatchRegularExpression( '/concert|rehearsal|coming live|tour/i', $content );
|
||||
}
|
||||
|
||||
@@ -202,22 +206,23 @@ class PatternsTest extends WP_UnitTestCase {
|
||||
$contracts = array(
|
||||
'home-projects' => array(
|
||||
'heading' => 'Selected work',
|
||||
'order' => array( 'Selected work', 'Expressive Tea', 'Ailed', 'Published research' ),
|
||||
'art' => 'alter-ego-code.png',
|
||||
// The project names come from chrnx/selected-work now, not the pattern.
|
||||
'order' => array( 'Selected work' ),
|
||||
'art' => 'alter-ego-code-768.webp',
|
||||
'art_alt' => '',
|
||||
'atmosphere' => 'chrnx-character-stage__secondary-art',
|
||||
),
|
||||
'home-music' => array(
|
||||
'heading' => 'The No Names',
|
||||
'order' => array( 'The No Names', 'Grunge mexicano para cerebros que no se callan.', 'Un proyecto de banda activo hecho en Sinaloa: estudio crudo, cero live.' ),
|
||||
'art' => 'the-no-names-musician-cutout.png',
|
||||
'art' => 'the-no-names-musician-cutout-768.webp',
|
||||
'art_alt' => 'The No Names musician portrait',
|
||||
'atmosphere' => 'chrnx-character-stage__collage',
|
||||
),
|
||||
'music-landing' => array(
|
||||
'heading' => 'The No Names',
|
||||
'order' => array( 'The No Names', 'Grunge mexicano para cerebros que no se callan.', 'The No Names es una banda activa' ),
|
||||
'art' => 'the-no-names-musician-cutout.png',
|
||||
'art' => 'the-no-names-musician-cutout-768.webp',
|
||||
'art_alt' => 'The No Names musician portrait',
|
||||
'atmosphere' => 'chrnx-character-stage__collage',
|
||||
'atmos_alt' => 'The No Names collage',
|
||||
@@ -226,16 +231,15 @@ class PatternsTest extends WP_UnitTestCase {
|
||||
'podcast-landing' => array(
|
||||
'heading' => 'Podcasts',
|
||||
'order' => array( 'Podcasts', 'Conversations about the work behind software, research, music, and games.' ),
|
||||
'art' => 'alter-ego-podcasts.png',
|
||||
'art' => 'alter-ego-podcasts-768.webp',
|
||||
'art_alt' => '',
|
||||
'atmosphere' => 'chrnx-character-stage__frequency',
|
||||
),
|
||||
'about' => array(
|
||||
'heading' => 'About',
|
||||
'order' => array( 'About', 'I work as Lead Developer @Expressive Tea', 'I am a published researcher.', 'I am an autistic Level 1 software developer and researcher.', 'Beyond the work', 'I am the father of three wonderful children' ),
|
||||
'art' => 'alter-ego-life.png',
|
||||
'art' => 'alter-ego-life-768.webp',
|
||||
'art_alt' => '',
|
||||
'facets' => array( 'alter-ego-literature.png', 'alter-ego-gaming-half-body.png' ),
|
||||
),
|
||||
);
|
||||
|
||||
@@ -343,8 +347,9 @@ class PatternsTest extends WP_UnitTestCase {
|
||||
$music_root = $music_xpath->query( '//*[@id="chrnx-test-root"]/*[1]' )->item( 0 );
|
||||
|
||||
$this->assertInstanceOf( DOMElement::class, $music_stage );
|
||||
$this->assertSame( 1, substr_count( $music, 'the-no-names-collage.jpeg' ) );
|
||||
$this->assertSame( 1, substr_count( $music, 'the-no-names-musician-cutout.png' ) );
|
||||
// Twice: once in the WebP srcset, once as the <img> fallback src.
|
||||
$this->assertSame( 2, substr_count( $music, 'the-no-names-collage-768.webp' ) );
|
||||
$this->assertSame( 2, substr_count( $music, 'the-no-names-musician-cutout-768.webp' ) );
|
||||
$this->assertSame( 1, $music_xpath->query( './*[1]//img[@alt="The No Names collage"]', $music_stage )->length );
|
||||
$this->assertSame( 0, $music_xpath->query( './*[2]//img[contains(@class,"chrnx-character-stage__collage")]', $music_stage )->length );
|
||||
$this->assertSame( 1, $music_xpath->query( './*[3]//img[@alt="The No Names musician portrait"]', $music_stage )->length );
|
||||
@@ -355,20 +360,21 @@ class PatternsTest extends WP_UnitTestCase {
|
||||
$this->assertInstanceOf( DOMElement::class, $releases );
|
||||
$this->assertSame( $music_stage, $process->previousElementSibling ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase -- DOM API property.
|
||||
$this->assertSame( $process, $releases->previousElementSibling ); // phpcs:ignore WordPress.NamingConventions.ValidVariableName.UsedPropertyNotSnakeCase -- DOM API property.
|
||||
$this->assertSame( array( 2, 3, 4, 4, 4 ), $this->heading_levels( $music_dom ) );
|
||||
// The h4 release headings are rendered by chrnx/release-list now.
|
||||
$this->assertSame( array( 2, 3 ), $this->heading_levels( $music_dom ) );
|
||||
|
||||
$podcast = $this->render_pattern( get_theme_file_path( 'patterns/podcast-landing.php' ) );
|
||||
$podcast_dom = $this->load_html_fragment( $podcast );
|
||||
$podcast_xpath = new DOMXPath( $podcast_dom );
|
||||
$podcast_stage = $podcast_xpath->query( '//*[contains(concat(" ", normalize-space(@class), " "), " chrnx-character-stage ")]' )->item( 0 );
|
||||
$this->assertInstanceOf( DOMElement::class, $podcast_stage );
|
||||
$this->assertSame( 1, substr_count( $podcast, 'podcast-frequency-grunge.png' ) );
|
||||
$this->assertSame( 2, substr_count( $podcast, 'podcast-frequency-grunge-1536.webp' ) );
|
||||
$podcast_atmosphere = $podcast_dom->saveHTML( $podcast_xpath->query( './*[1]', $podcast_stage )->item( 0 ) );
|
||||
$this->assertStringContainsString( '<picture class="chrnx-responsive-atmosphere" aria-hidden="true">', $podcast_atmosphere );
|
||||
$this->assertStringContainsString( 'alt=""', $podcast_atmosphere );
|
||||
$podcast_art = $podcast_dom->saveHTML( $podcast_xpath->query( './*[3]', $podcast_stage )->item( 0 ) );
|
||||
$this->assertStringContainsString( '<picture class="chrnx-responsive-portrait" aria-hidden="true">', $podcast_art );
|
||||
$this->assertStringContainsString( 'alter-ego-podcasts.png', $podcast_art );
|
||||
$this->assertStringContainsString( 'alter-ego-podcasts-768.webp', $podcast_art );
|
||||
$this->assertStringContainsString( 'alt=""', $podcast_art );
|
||||
$this->assertSame( 1, substr_count( $podcast, '<!-- wp:chrnx/latest-podcast /-->' ) );
|
||||
$this->assertSame( 1, substr_count( $podcast, '"metadata":{"name":"chrnx/podcast-show-discovery"}' ) );
|
||||
|
||||
Reference in new issue
Block a user