1.54.0
Breaking change: Report HTML and JSON paths have changed
The HTML report used to be at build/reports/roborazzi/index.html but is now located at build/reports/roborazzi/<build_variant>/index.html. This is a first step toward fixing a long-standing issue where running recordRoborazzi (instead of recordRoborazziDebug) could break test results; further work is still needed to make it fully reliable.
You should be able to fix it by adding /debug/ (or your build variant) to the path in your CI script. I believe the change is straightforward, but if you run into any cases where it's difficult please let me know.
Note: This change does not affect the paths of the generated screenshot images, so most users will not be impacted.
Thank you for your contribution, @vladcudoidem!
Behavioral change: Fixed screenshot timing for Compose Preview Support
Previously, we used Espresso.onIdle() and ShadowLooper.idle(), but these APIs are not suitable for Compose. Consequently, screenshots could not be captured after onSizeChanged completed.
@Preview
@Composable
fun PreviewOnSizeChanged() {
var size by remember { mutableStateOf("unknown") }
Box(
modifier = Modifier
.size(100.dp)
.background(Color.Blue)
.onSizeChanged { size = "${it.width}x${it.height}" } // Now invoked! (It used to be skipped.)
) {
Text(text = size, color = Color.White)
}
}
If you encounter issues with infinite animations—such as CircularProgressIndicator—you can configure frame-based captures using @RoboComposePreviewOptions.
@RoboComposePreviewOptions(
manualClockOptions = [ManualClockOptions(advanceTimeMillis = 0L)]
)
Thank you for reporting this issue, @savvasenok!
What's Changed
- Add PreviewOnSizeChanged to reproduce issue #768 by @takahirom in https://github.com/takahirom/roborazzi/pull/769
- Store HTML and JSON reports in flavored directories by @vladcudoidem in https://github.com/takahirom/roborazzi/pull/749
- Fix onSizeChanged recomposition not completing before capture by @takahirom in https://github.com/takahirom/roborazzi/pull/770
Full Changelog: https://github.com/takahirom/roborazzi/compare/1.53.0...1.54.0