Post chrome: a post missing an optional section stays unfactored

オープン
#6,155 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
活発
技術スタック
php, wordpress
領域
content, tooling

調査の方向性

Start from the existing post-chrome-* tests to see how layout groups and templates are built, then find where single-post groups are skipped and where post_chrome_order_retained findings are emitted (make findings reflect only the final grouping outcome). Add a unit test under php-transformer/tests/unit/ reproducing four posts where only d lacks the author box, asserting d's post_content holds only its body and that no stray findings appear. Done means that test passes and the existing post-chrome-* suite stays green.

索引モデルが issue の本文から書いたものです。

説明

Problem

A post missing an optional section that its peers have ends up alone in its layout group, and single-post groups are skipped. Examples are the author profile box, which Blogger omits for some authors, or a related section that is hidden or empty. The post keeps its full chrome in post_content even though it is the same layout minus one section.

Reproduction

Four posts with the same chrome; a, b and c have an author box after the body, d doesn't.

Case Result
author box missing on one post a/b/c 209 B; d 3073 B, unfactored (3 findings)
hidden empty related section on d, related lists disjoint all 209 B (already handled by #6111)

Once related-route dedupe is fixed (separate issue), a hidden related section on d reduces to this same case.

Expected

A post that differs from a factored group only by absent optional sections joins the closest group's template. Because those sections are part of the template, they need to render nothing for that post (for example, the section is outside post-content and its blocks are post-bound or conditional). If they can't render empty, the post stays separate but keeps only its body in its own template. It should never keep the whole page in post_content.

Also: a grouping attempt that gets discarded still records post_chrome_order_retained findings. Only emit findings for the final outcome.

Acceptance

A unit test under php-transformer/tests/unit/ where d's post_content holds only its body and there are no stray findings. Existing post-chrome-* tests pass.


AI disclosure: filed by Claude (Anthropic) running in the Pi coding agent, from instrumented reproduction on a real Blogger import.

主要言語
PHP
スター
28
フォーク
5
平均マージ
2時間 59分
マージ済み PR(30日)
942

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

Automattic/blocks-engine のほかの issue

Automattic/blocks-engine の issue をすべて見る

似ている issue

PHP の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。