Skip to content

Commit

Permalink
Update roborazzi to v1.38.0 (#1148)
Browse files Browse the repository at this point in the history
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[io.github.takahirom.roborazzi](https://redirect.github.com/takahirom/roborazzi)
| plugin | minor | `1.36.0` -> `1.38.0` |
|
[io.github.takahirom.roborazzi:roborazzi-core](https://redirect.github.com/takahirom/roborazzi)
| dependencies | minor | `1.36.0` -> `1.38.0` |
|
[io.github.takahirom.roborazzi:roborazzi-compose](https://redirect.github.com/takahirom/roborazzi)
| dependencies | minor | `1.36.0` -> `1.38.0` |
|
[io.github.takahirom.roborazzi:roborazzi-junit-rule](https://redirect.github.com/takahirom/roborazzi)
| dependencies | minor | `1.36.0` -> `1.38.0` |
|
[io.github.takahirom.roborazzi:roborazzi](https://redirect.github.com/takahirom/roborazzi)
| dependencies | minor | `1.36.0` -> `1.38.0` |
|
[io.github.takahirom.roborazzi:roborazzi-compose-desktop](https://redirect.github.com/takahirom/roborazzi)
| dependencies | minor | `1.36.0` -> `1.38.0` |

---

### Release Notes

<details>
<summary>takahirom/roborazzi (io.github.takahirom.roborazzi)</summary>

###
[`v1.38.0`](https://redirect.github.com/takahirom/roborazzi/releases/tag/1.38.0)

[Compare
Source](https://redirect.github.com/takahirom/roborazzi/compare/1.37.0...1.38.0)

##### Bugfix

##### Fix: Bug preventing the revival of deleted screenshot images

Thanks to
[@&#8203;pedromfmachado](https://redirect.github.com/pedromfmachado)'s
contribution, we've addressed a bug where deleted screenshot test images
would be erroneously revived. Previously, when screenshot tests were
removed and their corresponding images deleted from the output
directory, running the `record` task again would cause the Roborazzi
Gradle task to recreate the removed images. While this could be
temporarily resolved with `roborazzi.cleanupOldScreenshots=true`, that
approach was undesirable as it would also remove images when test
filters were used. This was a complex issue to solve, and we extend our
gratitude to
[@&#8203;pedromfmachado](https://redirect.github.com/pedromfmachado) for
the fix.

##### Fix: Made screenshot dump deterministic

We have a dump feature that allows us to check the properties or
hierarchy of views or composables in an image. We sorted the properties
to ensure a deterministic output. Thanks to
[@&#8203;siarhei-luskanau](https://redirect.github.com/siarhei-luskanau) for
this contribution.

##### New Feature

##### Feature: Added `RoborazziComposeActivityThemeOption`

Previously, changing the theme of `RoborazziTransparentActivity` was not
possible. We have now deprecated `RoborazziTransparentActivity` and
renamed it to `RoborazziActivity`. Additionally, we added
`RoborazziComposeActivityThemeOption` to enable changing the Activity's
theme. Thank you again,
[@&#8203;pedromfmachado](https://redirect.github.com/pedromfmachado),
for this feature.

You can now change the Activity theme like this:

```kotlin
 @&#8203;OptIn(ExperimentalRoborazziApi::class)
 @&#8203;Test
 fun whenNonTransparentThemeItShouldHaveNonTransparentBackground() {
   captureRoboImage(
     roborazziComposeOptions = RoborazziComposeOptions {
       activityTheme(android.R.style.Theme_Material_Light)
     }
   ) {
     Text("This composable function should NOT have transparent background!")
   }
 }
```

##### What's Changed

- Sort key order of ComposePrintToString to stabilize output in Dump
screenshots. by
[@&#8203;siarhei-luskanau](https://redirect.github.com/siarhei-luskanau)
in
[https://github.com/takahirom/roborazzi/pull/611](https://redirect.github.com/takahirom/roborazzi/pull/611)
- Added RoborazziComposeActivityThemeOption by
[@&#8203;pedromfmachado](https://redirect.github.com/pedromfmachado) in
[https://github.com/takahirom/roborazzi/pull/612](https://redirect.github.com/takahirom/roborazzi/pull/612)
- \[Code Style] Add JetCodeStyleSettings to codestyle setting by
[@&#8203;takahirom](https://redirect.github.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/614](https://redirect.github.com/takahirom/roborazzi/pull/614)
- Removing files from intermediate dir to prevent old screenshots from
reappearing by
[@&#8203;pedromfmachado](https://redirect.github.com/pedromfmachado) in
[https://github.com/takahirom/roborazzi/pull/616](https://redirect.github.com/takahirom/roborazzi/pull/616)
- Rename theme() to activityTheme() by
[@&#8203;takahirom](https://redirect.github.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/617](https://redirect.github.com/takahirom/roborazzi/pull/617)

##### New Contributors

- [@&#8203;pedromfmachado](https://redirect.github.com/pedromfmachado)
made their first contribution in
[https://github.com/takahirom/roborazzi/pull/612](https://redirect.github.com/takahirom/roborazzi/pull/612)

**Full Changelog**:
takahirom/roborazzi@1.37.0...1.38.0

###
[`v1.37.0`](https://redirect.github.com/takahirom/roborazzi/releases/tag/1.37.0)

[Compare
Source](https://redirect.github.com/takahirom/roborazzi/compare/1.36.0...1.37.0)

##### Bug Fixes and Workarounds

##### Compose AlertDialog Support

Support for capturing Alert Dialogs has been fixed, ensuring correct
screenshot display. `captureScreenRoboImage()`, which merges all
windows, is now used only when multiple windows are present. Thanks to
[@&#8203;ashughes](https://redirect.github.com/ashughes) for reporting
this and to [@&#8203;mhidaka](https://redirect.github.com/mhidaka) and
[@&#8203;hiroaki404](https://redirect.github.com/hiroaki404) for
bringing it to my attention at a Japan Android testing event.

<img width="366" alt="image"
src="https://github.com/user-attachments/assets/e339de2e-ea28-44e8-9946-a24fa22a5286"
/>

##### Workaround for Overlap Handling for SDK 35 Compose Screenshots
##### Problem

When updating to SDK 35 and using the default theme, the ActionBar is
included in screenshots, leading to overlap when using
`createComposeRule()`. This occurs because `createComposeRule()` uses
the default theme by default. Thank you for letting me know about this,
[@&#8203;keyboardsurfer](https://redirect.github.com/keyboardsurfer)!

<img width=400
src=https://github.com/user-attachments/assets/ba5f29ae-24bb-48f9-aa27-f335f80b784f
/>

I have filed an issue for this:
https://issuetracker.google.com/issues/383368165

##### Why this happens

SDK 35 enforces edge-to-edge display, which means it **does not provide
automatic padding for the ActionBar**.

##### How Roborazzi currently workarounds this

Roborazzi now automatically hides the ActionBar when taking screenshots
on SDK 35 and higher. This functions similarly to
`view.getActivity()?.actionBar?.hide()`. However, this workaround may
cause performance issues and should not be relied upon. Roborazzi
outputs warning logs with alternative suggestions. Thank you to
[@&#8203;sergio-sastre](https://redirect.github.com/sergio-sastre) for
advising on this workaround!

**If you need to include the ActionBar in screenshots,** Roborazzi
provides a flag, `roborazzi.compose.actionbar.overlap.fix=false`, that
can be added to your `gradle.properties` file.

##### What should we do?

A permanent solution will likely require changes from Google. In the
meantime, adding `<application
android:theme="@&#8203;style/android:Theme.Material.Light.NoActionBar"
/>` to the module's `src/test/AndroidManifest.xml` file changes the
Activity's default theme and resolves the issue. Thank you to
[@&#8203;mattinger](https://redirect.github.com/mattinger) for finding
this!


[https://github.com/takahirom/roborazzi/issues/598#issuecomment-2533372700](https://redirect.github.com/takahirom/roborazzi/issues/598#issuecomment-2533372700)

##### Stabilized Output for Dump Screenshots

Thanks to
[@&#8203;siarhei-luskanau](https://redirect.github.com/siarhei-luskanau)
for contributing an improvement that reduces unnecessary diffs for the
Roborazzi dump feature.

##### New Features

##### Add `inspectionMode()` for Compose Previews

Thanks to
[@&#8203;YusukeMoriJapan](https://redirect.github.com/YusukeMoriJapan)'s
contribution, `inspectionMode()` is now available in
`RoborazziComposeOptions`. This is particularly useful when working with
libraries that have specific preview implementations. This mode is off
by default to maintain high fidelity.

Here's how to enable it:

```kotlin
captureRoboImage(
    roborazziComposeOptions = RoborazziComposeOptions {
        inspectionMode(true)
    }
) {
    ...
}
```

***

##### What's Changed

- Fix document build by
[@&#8203;takahirom](https://redirect.github.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/597](https://redirect.github.com/takahirom/roborazzi/pull/597)
- Sort units and actions of ComposePrintToString to stabilize output in
Dump screenshots. by
[@&#8203;siarhei-luskanau](https://redirect.github.com/siarhei-luskanau)
in
[https://github.com/takahirom/roborazzi/pull/600](https://redirect.github.com/takahirom/roborazzi/pull/600)
- Update API version for sample by
[@&#8203;takahirom](https://redirect.github.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/601](https://redirect.github.com/takahirom/roborazzi/pull/601)
- add localInspectionMode property to RoborazziComposeOptions by
[@&#8203;YusukeMoriJapan](https://redirect.github.com/YusukeMoriJapan)
in
[https://github.com/takahirom/roborazzi/pull/588](https://redirect.github.com/takahirom/roborazzi/pull/588)
- \[Refactor] Separate compose lambda test by
[@&#8203;takahirom](https://redirect.github.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/606](https://redirect.github.com/takahirom/roborazzi/pull/606)
- Add elevation for PreviewNormal preview test by
[@&#8203;takahirom](https://redirect.github.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/608](https://redirect.github.com/takahirom/roborazzi/pull/608)
- Fix alert dialog support by
[@&#8203;takahirom](https://redirect.github.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/555](https://redirect.github.com/takahirom/roborazzi/pull/555)
- Add default theme test by
[@&#8203;takahirom](https://redirect.github.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/603](https://redirect.github.com/takahirom/roborazzi/pull/603)
- Revert compileSdk and targetSdk for library by
[@&#8203;takahirom](https://redirect.github.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/609](https://redirect.github.com/takahirom/roborazzi/pull/609)
- Add overlap workaround by
[@&#8203;takahirom](https://redirect.github.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/604](https://redirect.github.com/takahirom/roborazzi/pull/604)

##### New Contributors

-
[@&#8203;siarhei-luskanau](https://redirect.github.com/siarhei-luskanau)
made their first contribution in
[https://github.com/takahirom/roborazzi/pull/600](https://redirect.github.com/takahirom/roborazzi/pull/600)

**Full Changelog**:
takahirom/roborazzi@1.36.0...1.37.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about these
updates again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Renovate
Bot](https://redirect.github.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS42OS4zIiwidXBkYXRlZEluVmVyIjoiMzkuODIuNiIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
  • Loading branch information
slack-oss-bot authored Jan 2, 2025
1 parent 2f6b00f commit eaafca3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ nullawayGradle = "2.1.0"
okhttp = "5.0.0-alpha.14"
okio = "3.9.1"
retrofit = "2.11.0"
roborazzi = "1.36.0"
roborazzi = "1.38.0"
slack-lint = "0.8.2"
sortDependencies = "0.13"
spotless = "7.0.0.BETA4"
Expand Down

0 comments on commit eaafca3

Please sign in to comment.