Skip to content

Releases: takahirom/roborazzi

1.50.0

23 Aug 00:58
5f393b7
Compare
Choose a tag to compare

Fixed: Resolved Gradle task dependency errors with Android Gradle Plugin 8.12+ where GenerateComposePreviewRobolectricTestsTask output was used by compilation tasks without explicit dependencies. Thank you @papo2608 for reporting this issue.

What's Changed

Full Changelog: 1.49.0...1.50.0

1.49.0

18 Aug 23:44
921a3c1
Compare
Choose a tag to compare

ComposablePreviewScanner 0.7.0 Compatibility Update

Breaking Change - Compatibility Update Required

This release addresses a breaking compatibility issue with ComposablePreviewScanner 0.7.0 that affects users of Roborazzi's Preview support feature.

The Problem

When using ComposablePreviewScanner 0.7.0 with previous versions of Roborazzi, you'll encounter NoSuchMethodError at runtime. This happens because:

  • Method relocation: ComposablePreviewScanner 0.7.0 moved methods from AndroidPreviewScreenshotIdBuilder to provide common PreviewScreenshotIdBuilder methods for Glance and Compose Multiplatform
  • Import mismatch: Previous Roborazzi versions contain generated code with outdated import statements
  • Runtime failure: Auto-generated Roborazzi tests from Previews crash when trying to execute methods at their old locations

The Solution

This Roborazzi update replaces the old method calls and import statements with new ones compatible with ComposablePreviewScanner 0.7.0+. However, since these new method locations don't exist in ComposablePreviewScanner 0.6.x, you must update both libraries together.

⚠️ Required Action

If you use Roborazzi's Preview support, you must:

  • Update Roborazzi to this version
  • Update ComposablePreviewScanner to 0.7.0 or later

Both updates are required - updating only one will cause build or runtime errors.

Migration Steps

// Update both dependencies together
implementation "io.github.takahirom.roborazzi:roborazzi:1.49.0"
implementation "io.github.sergio-sastre.ComposablePreviewScanner:android:0.7.0" // or newer

Improved Error Detection

We've added clear build-time error messages to help you identify when this compatibility issue occurs, so you'll know exactly what needs to be updated instead of encountering cryptic runtime errors.

Common Update Scenarios

Scenario 1: Update only ComposablePreviewScanner to 0.7.0
NoSuchMethodError with old Roborazzi. Update Roborazzi to resolve.

Scenario 2: Update only Roborazzi
→ Compile-time error with clear message to update ComposablePreviewScanner ✅

Acknowledgments

Thanks to @sergio-sastre for collaboration on resolving this compatibility challenge and maintaining the ComposablePreviewScanner library.

What's Changed

Full Changelog: 1.48.0...1.49.0

1.48.0

14 Aug 04:03
2401a3e
Compare
Choose a tag to compare

Fix Preview Size Retention Bug

Fixed issue where @Preview annotation size attributes (heightDp/widthDp) incorrectly persisted between captures

Problem

Subsequent previews without explicit size would inherit dimensions from previous previews instead of using defaults.

Solution

Save and restore Robolectric qualifiers properly in captureRoboImage() to ensure preview size isolation.

Thanks to @smuldr for reporting this issue!

Breaking Changes: Update Libraries

You can see the changes at: https://github.com/takahirom/roborazzi/actions/runs/16952566040

Overall, we are now using Kotlin 2.0.21. We don't chase the latest versions, but we want to add tests using the latest Compose Multiplatform Previews. Thank you for letting me know about this! @sergio-sastre

What's Changed

  • Update dependency androidx.compose.material3:material3 to v1.3.2 by @renovate[bot] in #673
  • Update Gradle, AGP and Kotlin versions by @takahirom in #718
  • Fix preview size retention bug by @takahirom in #721

Full Changelog: 1.47.0...1.48.0

1.47.0

11 Aug 05:09
0f085a2
Compare
Choose a tag to compare

Compose Preview Tester Customization

Added Capturer interface to AndroidComposePreviewTester for customizing capture behavior (#716). This allows setting custom
comparison thresholds and other RoborazziOptions for generated Compose preview tests.

import com.dropbox.differ.SimpleImageComparator
import com.github.takahirom.roborazzi.*

@ExperimentalRoborazziApi
class MyCustomComposePreviewTester(
  private val defaultCapturer: AndroidComposePreviewTester.Capturer = AndroidComposePreviewTester.DefaultCapturer()
) : AndroidComposePreviewTester(
  capturer = { parameter ->
    val customOptions = parameter.roborazziOptions.copy(
      compareOptions = parameter.roborazziOptions.compareOptions.copy(
        // Set custom comparison threshold (0.0 = exact match, 1.0 = ignore differences)
        imageComparator = SimpleImageComparator(maxDistance = 0.01f)
      )
    )
    defaultCapturer.capture(
      parameter.copy(roborazziOptions = customOptions)
    )
  }
)

Fixes #703. Thanks @pavel163 for the issue report and @sergio-sastre for the review!

What's Changed

  • Minor tweak to documentation for Groovy DSL by @smugleafdev in #715
  • Add Capturer interface for customizing AndroidComposePreviewTester by @takahirom in #716

New Contributors

Full Changelog: 1.46.1...1.47.0

1.46.1

05 Jul 04:03
c1af6cc
Compare
Choose a tag to compare

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

Full Changelog: 1.46.0...1.46.1

1.46.0(Not released)

28 Jun 04:40
5225b17
Compare
Choose a tag to compare

(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

Full Changelog: 1.45.1...1.46.0

1.45.1

18 Jun 07:53
6dfaaaf
Compare
Choose a tag to compare

1.45.0 (Publishing Failed)

17 Jun 10:40
36c9a13
Compare
Choose a tag to compare

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
image
  • 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

01 Jun 05:56
62ab157
Compare
Choose a tag to compare

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

11 May 04:47
401a373
Compare
Choose a tag to compare

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