Automattic / Automattic/blocks-engine
Preserve collapsed geometry for static select controls
- Dominant language
- PHP
- Stars
- 14
- Forks
- 2
- Avg merge
- 2h 10m
- Merged PRs (30d)
- 561
Description
## Problem
Static non-runtime `` controls are converted into visible `core/list` option inventories. This destroys control geometry and displays every option.
Canonical fixture `20-switchback-woocommerce-extra-hard` contains four styled collapsed selects in its guided selector. The generated candidate emits `core/group.form-select` with a duplicate label paragraph and a visible `core/list` for each control.
Measured at 1280px:
- source page: `1280 x 6761`
- candidate: `1280 x 7245`
- candidate `` expansion: `435.66px`
- footer shift/candidate tail: `484px`
- aligned visual mismatch after prior hero repair: `9.0845%`
The immutable fixture must remain unchanged.
## Owner
`php-transformer/src/HtmlToBlocks/HtmlTransformer.php`: `readableSelectBlockFromElement()` emits the expanded group/list shape. Existing contract coverage currently requires static selects to become readable lists.
## Acceptance
- A static select with authored layout/style remains a compact collapsed control, not an always-visible option list.
- Preserve class, id, name, selected/placeholder state, label association, and applicable authored CSS.
- Keep runtime-targeted select island behavior unchanged.
- Use a generic editable/native control representation with no fixture-specific selectors/classes.
- Fixture 20's four controls restore source main geometry while editor validity and zero-fallback contracts remain green.
- Replace the current visible-list contract with positive static-control and negative runtime-targeted coverage.
## Related
#220 is a forms parity umbrella and #718 covers pseudo-form ownership; neither owns this static control expansion.
## AI assistance
OpenAI gpt-5.6-terra via OpenCode and a general OpenCode subagent compared immutable source/candidate DOM geometry and isolated the static select conversion contract. Chris Huber directed the investigation and remains responsible for the issue and resulting change.
Contributor guide
Research direction
Start in php-transformer/src/HtmlToBlocks/HtmlTransformer.php at readableSelectBlockFromElement(), then inspect the immutable 20-switchback-woocommerce-extra-hard fixture and the existing static-select readable-list contract. Confirm the four styled controls retain compact geometry and authored state while runtime-targeted selects keep their island behavior; editor-validity and zero-fallback contracts should remain green.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- html, php
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100