Releases: takahirom/roborazzi
1.46.1
Bugfix: Fix screenshot sizing for RoborazziComposeSizeOption and Previews on Robolectric 4.15+
This release finally resolves a complex screenshot sizing issue that occurred after the Robolectric 4.15 update. Version 1.46.0 was never released as we discovered additional edge cases during the pre-release phase. This version, 1.46.1, addresses all known issues.
Initially, we migrated to using RuntimeEnvironment.setQualifiers()
to configure the screen size, following the recommended approach for recent Robolectric versions. However, this change introduced new problems, especially when a widthDp
and heightDp
with different values were specified, or when used in combination with the device
parameter in @Preview
.
After extensive investigation and discussion, we've implemented a more robust solution. Roborazzi now automatically adds the correct orientation qualifier (-land
or -port
) based on the provided dimensions and ensures the qualifiers are applied in the correct order to avoid conflicts with other configurations. This fixes sizing for all Compose screenshot tests, making them reliable and predictable again.
Acknowledgements
A huge thank you to everyone who contributed to resolving this challenging issue! This fix would not have been possible without the collaborative effort of the community.
- A special and massive thank you to @sergio-sastre for their incredibly thorough testing and persistent feedback. They identified several critical edge cases, provided detailed reproductions, and patiently validated every fix, which was essential for making this solution robust.
- Thank you to the Robolectric team, especially @paulsowden and @hoisie, for their invaluable guidance. Their deep insights into Robolectric's internals and clear explanation of how
setQualifiers
and orientation work were crucial in pointing us toward the correct and final solution. - Thanks to @mannodermaus for the initial detailed bug report that kicked off this entire investigation.
- Also, thank you to @suhtai for providing helpful information in the early stages.
What's Changed
- Fix compare diff CI by @takahirom in #706
- Add previews to debug size options by @takahirom in #712
- Add automatic land/port qualifier when both widthDp and heightDp are set by @takahirom in #711
Full Changelog: 1.46.0...1.46.1
1.46.0(Not released)
(I haven't released this yet. We are discussing this change, so please wait a little longer.)
Bugfix: Fix screenshot sizing for RoborazziComposeSizeOption and Previews
This release addresses an issue where screenshot sizes were not being applied correctly after the Robolectric 4.15 update. This affected both RoborazziComposeSizeOption
and @Preview
annotations with widthDp
or heightDp
.
We now use RuntimeEnvironment.setQualifiers()
to configure the screen size, which is the recommended approach for recent Robolectric versions. This should fix sizing for all Compose screenshot tests.
A huge thank you to everyone who helped resolve this!
- Thanks to @mannodermaus for the detailed bug report.
- Special thanks to the Robolectric team, including @hoisie and @paulsowden, for their guidance and support.
- Also, thank you to @suhtai for providing additional information.
If you encounter any further issues with this change, please don't hesitate to open a new issue.
What's Changed
- Use qualifier approach for size by @takahirom in #704
Full Changelog: 1.45.1...1.46.0
1.45.1
Please refer to https://github.com/takahirom/roborazzi/releases/tag/1.45.0
1.45.0 (Publishing Failed)
The attempt to publish version 1.45.0 to the Maven Central repository appears to have failed. The release status is showing as "FAILED," so I will publish version 1.45.1 instead.
(This issue has since been resolved by contacting Maven Central support. Please use 1.45.1)
Bug fixes
- The dialog's background dimming is now visible, just as it would be on a real device. Thank you for investigating this. @jeppeman
- There was a bug that caused Roborazzi to crash when using BoxWithConstraints with a Dialog. Thank you, @matsudamper, for the report and the sample code.
What's Changed
- Add ShadowLooper.shadowMainLooper().idle() before fetchRobolectricWindowRoots() by @takahirom in #696
- Add dim color to dialog by @takahirom in #697
Full Changelog: 1.44.0...1.45.0
1.44.0
Please refer to https://github.com/takahirom/roborazzi/releases/tag/1.44.0-alpha01 to see the main changes in version 1.44.0. We are still seeking feedback on RoboComposePreviewOptions. RoboComposePreviewOptions is still experimental, and we may introduce breaking changes.
New feature: Added JUnit @Category
to auto-generated tests from Compose Preview
You can now filter tests using JUnit4's RoborazziComposePreviewTestCategory
. Thanks to @hellohj for the suggestion.
Bugfix: Subdirectory screenshots are now removed when roborazzi.cleanupOldScreenshots=true
Previously, when roborazzi.cleanupOldScreenshots=true
was used, subdirectory screenshots were not removed as intended. Thanks to @pacoalface-jt for reporting the bug.
What's Changed
- Support RoboComposePreviewOptions to support manual clock by @sergio-sastre in #633
- Downgrade Java target version to 11 and add javadoc generation to CI workflow by @takahirom in #666
- Rename debugLog to roborazziDebugLog and update usages across the codebase by @takahirom in #668
- Update JetBrains/writerside-github-action digest to 4d78a74 by @renovate in #660
- Fix Gemini OpenAI compatibility API by @takahirom in #671
- Improve compose config performance for Compose Preview Support by @takahirom in #667
- Update actions/download-artifact digest to 95815c3 by @renovate in #670
- Update actions/upload-artifact digest to ea165f8 by @renovate in #672
- Introduce Ollama support for roborazzi-ai-openai by @takahirom in #674
- Make temperature and maxTokens nullable because they are not used in thinking models. by @takahirom in #676
- Replace JvmAnnotationScanner with CommonComposablePreviewScanner + add example with @PreviewParameters by @sergio-sastre in #678
- Update AGP 8.7.3 by @takahirom in #679
- Configure Gradle to publish to Central Portal by @takahirom in #683
- Try using walkTopDown instead of listFiles for cleanup by @takahirom in #685
- Add failing whenRemoveSubdirectoryTestTheOldScreenshotShouldBeRemoved by @takahirom in #686
- Add RoborazziComposePreviewTestCategory to preview tests by @takahirom in #680
Full Changelog: 1.43.1...1.44.0
1.44.0-alpha04
Example update for Compose Multiplatform
The Roborazzi sample for the Compose Multiplatform @Preview
annotation has been updated to use CommonComposablePreviewScanner
. Thanks to @sergio-sastre for this contribution!
Central Portal Migration
This migration to the Central Portal should not affect users. We've made this change because the previous publishing service (Sonatype OSSRH) is being sunset.
What's Changed
- [NO library dependency change]Replace JvmAnnotationScanner with CommonComposablePreviewScanner + add example with @PreviewParameters by @sergio-sastre in #678
- [NO library dependency change]Update AGP 8.7.3 by @takahirom in #679
- Configure Gradle to publish to Central Portal by @takahirom in #683
Full Changelog: 1.44.0-alpha03...1.44.0-alpha04
1.44.0-alpha03
Bugfixes and breaking changes for AI powered Assertion.
OpenAiAiAssertionModel's JsonSchemaType is renamed to ApiType. I realized we needed to adjust other areas beyond JsonSchema, so I renamed it.
Ollama Support
We’ve tried using local LLMs like Gemma in GitHub Actions. It’s not stable yet. If you have GPU servers, using it in a CI server seems feasible. I suggest checking the MMMU benchmark score, and a score of 65 or higher would be desirable.
You can use it like this.
aiAssertionOptions = AiAssertionOptions(
assertionImageType = AiAssertionOptions.AssertionImageType.Actual(),
aiAssertionModel = OpenAiAiAssertionModel(
// loggingEnabled = true,
baseUrl = "http://localhost:11434/v1/",
apiKey = "",
apiType = OpenAiAiAssertionModel.ApiType.Ollama,
modelName = "gemma3:4b-it-qat",
seed = null,
),
)
Bugfix for reasoning models
When using Azure OpenAI API's reasoning models, I encountered errors when passing temperature
and max_tokens
. I resolved this by making these parameters nullable to avoid passing them when not needed.
What's Changed
- Update actions/download-artifact digest to 95815c3 by @renovate in #670
- Update actions/upload-artifact digest to ea165f8 by @renovate in #672
- Introduce Ollama support for roborazzi-ai-openai by @takahirom in #674
- Make temperature and maxTokens nullable because they are not used in thinking models. by @takahirom in #676
Full Changelog: 1.44.0-alpha02...1.44.0-alpha03
1.44.0-alpha02
Small fixes
- We had a top-level function named
debugLog()
, but since it is not intended for public use, we have deprecated it and renamed it toroborazziDebugLog()
. - We used to call
RuntimeEnvironment.setQualifiers()
multiple times within a single test in Compose Preview Support. However, since this can negatively impact performance, we have consolidated the calls into a single invocation. This change may result in different images. If you notice any differences and they are problematic, please let us know. - Gemini's JSON Schema validation appears to have become stricter recently, so we made some adjustments to the JSON schema used for Gemini.
What's Changed
- Rename debugLog to roborazziDebugLog() and update usages across the codebase by @takahirom in #668
- [CI] Update JetBrains/writerside-github-action digest to 4d78a74 by @renovate in #660
- Fix Gemini OpenAI compatibility API by @takahirom in #671
- Improve compose config performance for Compose Preview Support by @takahirom in #667
Full Changelog: 1.44.0-alpha01...1.44.0-alpha02
1.44.0-alpha01
Why is this an alpha release?
We don't usually release an alpha version. This release serves as a base implementation for future versions, allowing us to test whether this approach works well across various projects. If you are using Experimental Compose Preview Support
, please try it out and provide feedback to help us improve it.
Introducing RoboComposePreviewOptions
for Experimental Compose Preview Support
We have received a great deal of feedback regarding Experimental Compose Preview Support—particularly concerning animated composables such as the CircularProgressIndicator, which animates endlessly and causes test timeout errors. Previously, developers had to comment out code or implement complex workarounds. In this release, we introduce RoboComposePreviewOptions
to address these issues, although it involves some breaking changes. To use RoboComposePreviewOptions
, you need to add the new roborazzi-annotations
dependency. If you do not use Experimental Compose Preview Support, please refer to Experimental Compose Preview Support.
Thanks to @sergio-sastre for contributing to the base implementation. These changes also pave the way for future customizations in Roborazzi.
@RoboComposePreviewOptions(
manualClockOptions = [
ManualClockOptions(
advanceTimeMillis = 0L,
),
ManualClockOptions(
advanceTimeMillis = 516L, // 500 ms + 16ms frame
),
ManualClockOptions(
advanceTimeMillis = 1032L,
),
]
)
@Preview
@Composable
fun PreviewDelayed() {
...
}
Breaking changes for Experimental Compose Preview Support's ComposePreviewTester users
Key interface changes
ComposePreviewTester
now handlesTestParameter
instead of rawComposablePreview
.- A new
@RoboComposePreviewOptions
annotation enables time-based captures. - The
roborazzi-annotations
module has been added as a new dependency.
Migration
Update custom testers:
// Before
class CustomTester : ComposePreviewTester<AndroidPreviewInfo> {
override fun previews(): ComposablePreview<AndroidPreviewInfo> = AndroidComposablePreviewScanner().scanPackageTrees(...)
override fun test(preview: ComposablePreview<AndroidPreviewInfo>)
}
// After
class CustomTester : ComposePreviewTester<AndroidPreviewJUnit4TestParameter> {
override fun testParameters(): AndroidPreviewJUnit4TestParameter = AndroidComposablePreviewScanner().scanPackageTrees(...)
override fun test(preview: AndroidPreviewJUnit4TestParameter)
}
Sample implementations
- CustomPreviewTester handling Android previews
- MultiplatformPreviewTester for KMP previews
What's Changed
- Support RoboComposePreviewOptions to support manual clock by @sergio-sastre in #633
- Downgrade Java target version to 11 and add javadoc generation to CI workflow by @takahirom in #666
Full Changelog: 1.43.1...1.44.0-alpha01
1.43.1
We added error handling for font availability checks in 1.43.0. However, it seems that the "font not available" error is an Error rather than an Exception, so we updated the code to handle Throwable.
What's Changed
- [No Roborazzi library dependency update] Update dependency androidx.compose.ui:ui-tooling-preview to v1.7.8 by @renovate in #643
- Handle font availability errors by catching Throwable by @takahirom in #665
Full Changelog: 1.43.0...1.43.1