Add integration_test case: image intrinsic height drives container - #151
Open
beaucollins wants to merge 1 commit into
Open
Add integration_test case: image intrinsic height drives container#151beaucollins wants to merge 1 commit into
beaucollins wants to merge 1 commit into
Conversation
An <image width="100%"> with no explicit height must give its auto-height container an intrinsic height from the decoded aspect ratio. Under the new web renderer the inner image is position:absolute and contributes no height, so the container collapses to ~0 and the image renders invisible while still decoding. This case renders the minimal repro (image in an auto-height card) and records decode/asset observations; the web-vs-native snapshot diff catches the collapse. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
📊 PR Size: size/STotal changes: 23 lines (1 files) Top files changed:
Size calculated as additions + deletions. Labels: XS (<10), S (<50), M (<250), L (<1000), XL (1000+) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an
apps/integration_testcase that documents a web-renderer regression on this branch (#148): an<image>sizedwidth:"100%"with no explicit height does not give its auto-height container any height. The image decodes but the container collapses to ~0, so the image is invisible.Root cause
src/valdi_modules/src/valdi/web_renderer/src/elements/ImageElement.ts(~L412/L435) sets the inner<img>/canvas toposition: absolute, so it contributes no intrinsic height to the wrapper; with no explicit height the wrapper staysauto→ 0. Native (and the previous web renderer, where the<img>was in flow) size the container from the image aspect ratio.Repro
Case
image-intrinsic-height-containerrenders an intrinsic-ratio image in an auto-height card and records decode/asset observations. Web snapshot = a thin empty bar; native renders the image at its aspect-ratio height. The web-vs-native diff fails.Suggested fix
Give the wrapper an intrinsic height from the decoded aspect ratio when no explicit height is set (or keep the inner
<img>in flow for that case).This case passes once the wrapper takes the image's intrinsic height.