fix(snapshots): Render previews with explicit width and height in normal mode - #1457
Merged
Merged
Conversation
…mal mode Previews that set both widthDp and heightDp were rendered with FULL_EXPAND, which measures the root with unbounded constraints. Lazy lists and other scrollables throw on infinite constraints, so these snapshot tests failed. The screen is already sized to the preview dimensions, so NORMAL renders them at exactly that size. Fixes #1456 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
runningcode
requested review from
0xadam-brown,
adinauer,
markushi and
romtsn
as code owners
September 23, 2026 08:07
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Sep 24, 2026
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.
Previews that set both
widthDpandheightDpfailed to snapshot when they contained aLazyRow,LazyColumn, or any layout that can't handle an infinite max constraint.The generated test rendered these previews with
RenderingMode.FULL_EXPAND, which measures the root with unbounded constraints in both directions, so scrollables throwHorizontally/Vertically scrollable component was measured with an infinity maximum ... constraints.The device screen is already sized to
widthDp x heightDp, soNORMALrenders the preview at exactly that size, matching Android Studio.Reproduced with SAGP 6.21.0 + Paparazzi 2.0.0-alpha05 and confirmed that with
NORMALall previews pass and previously passing snapshots keep the same pixel dimensions.Why no tests? This repo is currently Java 17 but Paparazzi requires java 21 so we can't write any tests right now :'(
Fixes #1456
🤖 Generated with Claude Code