Skip to content

Refine runtime textarea workspace detection#614

Merged
chubes4 merged 1 commit into
trunkfrom
fix/ssi-generic-translation-iteration-v2
Jul 16, 2026
Merged

Refine runtime textarea workspace detection#614
chubes4 merged 1 commit into
trunkfrom
fix/ssi-generic-translation-iteration-v2

Conversation

@chubes4

@chubes4 chubes4 commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Summary

  • distinguish runtime textarea editors from real forms and structural pseudo-forms
  • preserve only the tight JavaScript-owned editor island while keeping surrounding editorial layout native and editable
  • cover real forms, pseudo-forms, standalone editors, nested editors, and unrelated runtime targets with parity fixtures

This addresses a generic transformer failure found while investigating Automattic/static-site-importer#623 under Automattic/static-site-importer#489: a runtime-targeted textarea could cause an ordinary contact or editorial wrapper to be preserved wholesale as core/html.

Implementation

hasWorkspaceSurface() now treats a textarea as workspace evidence only when it is runtime-bound and is not part of a real form. Structural pseudo-forms remain on form semantics unless the tight pseudo-form candidate contains an internal runtime-bound non-control target, such as a preview. That editor evidence applies only to the tight candidate, so outer editorial ancestors remain native blocks.

How to test

  1. Check out this branch on a fresh clone.
  2. Run composer --working-dir=php-transformer test.
  3. Confirm the full transformer suite passes, including 235 parity fixtures.
  4. Run php -l php-transformer/src/HtmlToBlocks/HtmlTransformer.php.
  5. Confirm the syntax check reports no errors.

Validation

  • composer --working-dir=php-transformer test passed.
  • PHP transformer parity fixtures passed: 235 fixtures.
  • php -l php-transformer/src/HtmlToBlocks/HtmlTransformer.php passed.
  • git diff --check passed.
  • An SSI control/candidate visual matrix over six representative fixtures completed with unchanged mismatch rates, native conversion rates, fallback ratios, editor validity, and failure categories. The only delta was one additional acceptable form-graft diagnostic caused by the tighter boundary.
  • A full ArtifactCompiler comparison compiled all 383 HTML entrypoints in the Blocks Engine fixture corpus with each site's HTML, CSS, and JavaScript bundle. 363 outputs were byte-identical. The 20 changed outputs were all textarea/form boundary cases.
  • Across those 20 outputs, the candidate exposed 683 additional native blocks and reduced opaque core/html content by 77,558 bytes, with no aggregate increase in core/html block count.
  • In 19 outputs, a broad section-level app shell became a bounded form-level island. The 20 newly visible fallback records describe content that was already hidden inside those broad app shells: 19 runtime forms and one unsupported progress element.

Compatibility

This intentionally changes runtime-island classification for runtime-bound textareas. Real forms and structural pseudo-forms retain bounded form/control preservation, while genuine textarea editors retain bounded app-shell preservation. No public APIs or extension paths change.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenAI GPT-5.6 Sol with OpenCode
  • Used for: Investigating transformer evidence, implementing the classification boundary and parity fixtures, and reviewing regression cases. Chris Huber reviewed and remains responsible for the change.

@chubes4
chubes4 marked this pull request as ready for review July 16, 2026 16:48
@chubes4
chubes4 merged commit ed7d081 into trunk Jul 16, 2026
1 check passed
@chubes4
chubes4 deleted the fix/ssi-generic-translation-iteration-v2 branch July 16, 2026 16:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant