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

Open Beginner friendly
#4,355 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
75/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
backend

Research direction

Start by reading SourceAttribute::DECLARED_EVENTS, SourceDom::eventMetadata(), and InteractionFallbackReporter::appendInteractiveControlBehaviorLossFallbacks(), which the issue identifies as the diagnostic path. Check how jsaction event types are parsed, including omitted types that default to click. Done means custom-only entries produce no interactive-control fallback while DOM interaction events such as click still do.

Written by the indexing model from the issue text.

Description

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.

Dominant language
PHP
Stars
25
Forks
3
Avg merge
5h 32m
Merged PRs (30d)
949

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Automattic/blocks-engine

All issues in Automattic/blocks-engine

Similar issues

More PHP issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.