Skip to content

fix(php-transformer): adopt existing-panel snapshots as in-place captured dropdowns (#3051) - #3052

Merged
chubes4 merged 1 commit into
trunkfrom
fix/issue-3051-blocks-engine
Oct 19, 2026
Merged

chubes4 merged 1 commit into
trunkfrom
fix/issue-3051-blocks-engine

Conversation

@chubes4

@chubes4 chubes4 commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Summary

A wired panel with an existing-panel snapshot is now always adopted as an in-place captured dropdown bound to its trigger, instead of being restored as a resting panel with dead wiring. The resting snapshot only decides how it presents while closed: the panel keeps its authored resting class/style (so a #2992 desktop nav stays visible where its toggle is hidden, and a class-hidden phone menu stays closed), and the captured-dialog view runtime swaps it to the opened class/style when its trigger opens it and back on close. The view runtime is only syntax-checked with node --check; no DOM test harness exists, so open/close was not exercised in a browser.

What changed

  • CapturedDialogProjector: removed restoreVisibleRestingPanel() and the 'restored' projection flag; added restingPresentation()/restPanel(). A panel with a resting snapshot is wrapped whole, at its resting presentation and without capture-only attributes, by an in-place dropdown div (data-blocks-engine-resting, data-blocks-engine-resting-state) bound to its triggers.
  • CapturedDialogBlockGenerator: new restingState() normalizer (strips capture-only class tokens, bounds values); new block attributes resting/restingState; editor save emits them; stylesheet exempts resting="authored" wrappers from the closed display:none rule and gives resting wrappers display:contents; view runtime replays the panel's closed->opened class/style on open and back on close, reusing replay().
  • CapturedDialogConverter: reads and serializes the resting/restingState attributes to match the editor save.
  • Added tests/unit/captured-dialog-class-hidden-resting-panel.php (issue Class-hidden phone menu restored as a resting panel without a toggle #3051 reduced fixture, registered in composer.json; fails on trunk).
  • Updated tests/unit/captured-dialog-shared-resting-panel.php: only the assertions that encoded the dead toggle ('no captured dialog wraps the nav', 'nav is the header's last child') now assert an in-place dropdown wrapper controlled by the Menu button; the nav-stays-visible-in-place, wp:navigation anchor 'nav', and no-<dialog> checks are kept.

How to test

  1. Run cd php-transformer && composer install --no-interaction --prefer-dist --no-progress && composer test:canonical; expect passes as recorded by Cook's deterministic gate.

Compatibility

Additive block attributes (resting, restingState) with empty defaults, so existing captured-dialog blocks are unchanged. Behaviour change: every wired panel with an existing-panel snapshot, including ones that rest with hidden:true, is now an in-place dropdown instead of a restored panel (hidden:false) or a dropdown under the header (hidden:true without observed placement). composer test:canonical passes; phpstan is clean on the changed files. The view runtime was syntax-checked with node --check but not run in a browser.

Evidence

  • Verified command cd php-transformer && composer install --no-interaction --prefer-dist --no-progress && composer test:canonical: status=succeeded; candidate commit 867e1e71aa4696bbc9ded466a0f14352b4cffb62, tree 7ff1781a9741ee17f6c9de1f3d69c7a78a7c5eb3, fingerprint bd662e16ecd870420d0126b6fb3bedcacf4852657f985a0220ff9bc14ae39168; durable gate gate-1
  • Base unchanged since verification: trunk remains at 20d8b2a.
  • CI expected: Homeboy CI after push
  • Candidate adoption provenance: the candidate was promoted from the recorded Cook task execution.
  • Cook deterministic verification: 1 gate(s) completed green.
  • Durable run execution: Succeeded
  • Reviewer-resolvable evidence from source_refs[0]: Class-hidden phone menu restored as a resting panel without a toggle #3051
  • [operator-only reference omitted]
  • Verified candidate scope: 6 changed file(s): php-transformer/composer.json, php-transformer/src/ArtifactCompiler/CapturedDialogProjector.php, php-transformer/src/HtmlToBlocks/Elements/CapturedDialogConverter.php, php-transformer/src/HtmlToBlocks/Generators/CapturedDialogBlockGenerator.php, php-transformer/tests/unit/captured-dialog-class-hidden-resting-panel.php, php-transformer/tests/unit/captured-dialog-shared-resting-panel.php.
  • Verified finalization base: trunk at 20d8b2a
  • deterministic gate passed: sh -c cd php-transformer && composer install --no-interaction --prefer-dist --no-progress && composer test:canonical (Passed)

AI assistance

@chubes4
chubes4 merged commit 065a379 into trunk Oct 19, 2026
15 checks passed
@chubes4
chubes4 deleted the fix/issue-3051-blocks-engine branch October 19, 2026 11:39
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