jsaction entries with only custom event names are reported as lost interactive controls

オープン 初心者向け
#4,355 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

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

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
75/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
backend

調査の方向性

まず、issueが診断経路として特定している SourceAttribute::DECLARED_EVENTS、SourceDom::eventMetadata()、InteractionFallbackReporter::appendInteractiveControlBehaviorLossFallbacks()を読んでください。省略された型の既定値が click になる場合も含め、jsactionのイベント型がどのように解析されるかを確認してください。カスタムイベントのみのエントリではインタラクティブコントロールのフォールバックが発生せず、clickなどのDOMインタラクションイベントでは引き続き発生すれば完了です。

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

説明

Summary

jsaction entries that declare only custom (non-DOM) event names are reported as interactive_control_behavior_lost, which fails the import quality gate on ordinary content.

SourceAttribute::DECLARED_EVENTS treats any non-empty jsaction as a declared event, so SourceDom::eventMetadata() returns an event for it, and InteractionFallbackReporter::appendInteractiveControlBehaviorLossFallbacks() emits an unsupported fallback for every such element. JSAction's grammar is [eventType:]handler separated by ; (an omitted event type means click). Entries such as zXBUYb:zTPCnb name library-internal custom events dispatched by descendants. They do not make the element a user control.

Reduced reproduction

<!doctype html><html><head><meta charset="utf-8"><title>Declared custom events</title>
<style>.card{padding:16px;border:1px solid #ccc;margin:8px}</style></head>
<body>
<div class="card" jsaction="zXBUYb:zTPCnb;zQF9Uc:Qxe3nd;"><p>First card</p></div>
<div class="card" jsaction="rcuQ6b:WYd;GvneHb:og1FDd;"><p>Second card</p></div>
<div class="card" jsaction="zXBUYb:zTPCnb;"><p>Third card</p></div>
</body></html>

studio create --from page.html → static_site_importer_quality_failed: 3 unsupported_html_fallback failures, all interactive_control_behavior_lost.

Expected

Only jsaction entries whose event type is a DOM user-interaction event (click, keydown, input, change, submit, focus, touchstart, … or an omitted type, which defaults to click) count as declared events. Custom event names are not interaction evidence. The reduced page imports with zero fallbacks. Elements declaring click:handler keep being reported as before.

Real-world impact

On a 70-route Google Sites import, 7000 of 7069 unsupported fallbacks came from this diagnostic, capped at 100 per page. About 1750 elements carried only custom-event jsaction values.

Environment

Static Site Importer 1.33.331, Blocks Engine php-transformer (bundled), Data Liberation Agent 0.33.120, WordPress 7.1.4.

AI assistance

Claude via Pi (Roadie) ran the import, traced the diagnostic to SourceAttribute::DECLARED_EVENTS and reduced the page. Chris Huber directed the work.

主要言語
PHP
スター
25
フォーク
3
平均マージ
5時間 32分
マージ済み PR(30日)
949

環境構築

はじめの一歩

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

Automattic/blocks-engine のほかの issue

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

似ている issue

PHP の issue をもっと見る

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

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