Improve Figma image projection and responsive layout - #663
Conversation
|
Browser verification update for
Reproduction uses SSI AI assistance: OpenCode with |
|
Post-fix Lab browser verification is currently blocked before candidate startup by a stale shared WordPress archive cache lock, not by this branch. Both the primary and recovery Local verification for commit |
|
Correction to the Lab blocker note above: direct inspection shows The solved-site promotion check also failed independently because SSI could not compile fixture |
|
Stacked Lab acceptance after upgrading
Retained evidence: This validates the structural boundary: source geometry remains on canonical wrappers, and only out-of-flow source images receive nested fill geometry. |
…fety Keep positioned media layouts out of galleries
…lectors # Conflicts: # php-transformer/tests/unit/artifact-author-stylesheet-projection.php
Summary
core/imagewrappers and project presentation to nested image elements without replaying relative source geometryFixes #662.
Root causes
Image declarations originally stopped at the canonical WordPress image wrapper, leaving the nested raster with incorrect presentation. Replaying every source declaration on that raster was also incorrect for relative geometry because it applied percentages twice.
The responsive failures came from desktop-only Figma exports whose source frames had no mobile variant. Generic fluid fallback rules stacked horizontal collections, but retained wrapping, shrinking, canvas coordinates, or fixed shared component widths could still collapse content or create overflow.
Verification
cd figma-transformer && composer testgit diff --check640pxwide atleft:24px, producing exactly274pxoverflow in a390pxviewportcalc(100vw - 48px)(342pxat the tested viewport), placing their right edge at366px; contract coverage verifies the rule is emitted for desktop-only responsive outputThe full contract suite also covers:
imgselector specificity and root-child imagesHow to test
cd php-transformer && composer validate --strict && composer test.cd ../figma-transformer && composer test.figma-transformer/bin/figma-transformer <fixture.fig> --multi-page --output-dir=<output>using the configured Kiwi decoder.390pxmobile widths.core/imagewrappers while positioned nested images fill their wrappers and flow images retain intrinsic sizing.Compatibility
No public API or custom block-attribute changes. The behavior is implemented through generated author styles, semantic HTML emission, and generic responsive fallback policy.
AI assistance
Substantive implementation, test drafting, fixture diagnosis, and verification were performed with OpenCode using
openai/gpt-5.6-sol. Chris Huber directed the work and remains responsible for the submitted changes.