Footer containing a form is not extracted as a shared template part in device-split captures (shell retained: incomplete)

未关闭
#6,323 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
52/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
php, wordpress
领域
backend, web-dev

调研方向

Start in ShellExtraction.php near line 1737, where an empty footer cluster list produces the incomplete diagnostic. Compare how the reduced fixture’s footer candidates are filtered with and without the form, checking route specific form actions and per device control IDs as the issue suggests. Confirm which detail disqualifies the candidates, then verify equivalent device split footers with forms produce one referenced footer part across the templates.

由索引模型根据 Issue 内容生成。

描述

Summary

A shared footer that contains a form is not extracted as the footer template part when the capture carries desktop and mobile device documents. Extraction reports wordpress_site_plan_shell_retained_incomplete ("footer shell candidates do not establish a dominant semantic cluster", reason incomplete, empty sources). A footer-content part is written but no template references it, so the theme's shared shell fails and each page keeps its own footer. The same two routes without the form extract parts/footer.html and every template references it.

Seen on a real two-device import with a newsletter form in the footer: no footer part, and 13 pages each carry a full copy of the footer in post content (300–870 KB per page). That import's report gave responsive_variant_retained for the footer, the same class of failure.

Reduced fixture

Two routes, index.html and about/index.html, identical except for <title>. Each has a desktop and a mobile device document with the same header and footer:

<!doctype html><html lang="en"><head><meta charset="utf-8"><style data-blocks-engine-capture-device-visibility="">/* standard capture device-visibility stylesheet */</style><title>Home</title><style>body{margin:0;background:#111;color:#fff}header,footer{padding:20px;background:#333}</style></head><body><div class="data-blocks-engine-capture-desktop-document" data-blocks-engine-capture-device-document="desktop" data-blocks-engine-capture-document-scope=""><header id="SITE_HEADER"><nav><a href="/">Home</a> <a href="/about/">About</a></nav></header><main><span id="anchors-ltgwp8xp4" data-blocks-engine-capture-anchor-target="anchors-ltgwp8xp4" data-blocks-engine-capture-anchor-source-id="comp-ltgwp8xo" aria-hidden="true" style="position: absolute;overflow: hidden;pointer-events: none;width: 0px;height: 0px" data-blocks-engine-capture-device-inline="{&quot;tablet&quot;:&quot;position: absolute;overflow: hidden;pointer-events: none;scroll-margin-top: 192px;width: 0px;height: 0px&quot;}"></span><h1>Page</h1><p>Body text.</p></main><footer id="SITE_FOOTER"><p>© 2026 Example Co.</p><form action="/subscribe" method="post"><label for="ed">Email</label><input id="ed" type="email" name="email"><button type="submit">Subscribe</button></form></footer></div><div class="device-mobile-optimized data-blocks-engine-capture-mobile-document" data-blocks-engine-capture-device-document="mobile" data-blocks-engine-capture-document-scope=""><header id="SITE_HEADER--m"><nav><a href="/">Home</a> <a href="/about/">About</a></nav></header><main><h1>Page</h1><p>Body text.</p></main><footer id="SITE_FOOTER--m"><p>© 2026 Example Co.</p><form action="/subscribe" method="post"><label for="em">Email</label><input id="em" type="email" name="email"><button type="submit">Subscribe</button></form></footer></div></body></html>

The control is the same two files with the <form>…</form> removed from both footers.

Observed (studio create --from <dir>, SSI 1.34.104)

parts/ templates reference footer shell diagnostic
Footer with form header.html, footer-content.html (unreferenced) none of 404, index, page, single footer retained / incomplete
Control (no form) header.html, footer.html all footer extracted

block_theme_scorecard.shared_shell: templates_missing_shell: [404, index, page, single], unreferenced_parts: [footer-content].

Root cause (pointer)

ShellExtraction.php (~L1737) finds no footer clusters (array() === $clusters ⇒ incomplete) once a form is present. That means the footer candidates are dropped before clustering, not split by a comparison. Likely suspects: route-specific form identity (the rendered form action follows the current route), or per-device control ids (ed/em) entering the footer fingerprint. Confirm which one disqualifies the candidates.

Expected

Footers that are equivalent across routes and device documents, form included, extract as one footer part that every template references, the same as the control.

Owning stage: WordPress materialization (Blocks Engine shell extraction). Generic; any device-split capture with a footer form hits it.

Reduced and filed with AI assistance (Claude, via coding agent).

主要语言
PHP
星标
28
派生
5
平均合并
2 小时 59 分钟
30 天内合并 PR
942

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

Automattic/blocks-engine 的其他 Issue

查看 Automattic/blocks-engine 的全部 Issue

相似的 Issue

更多 PHP Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。