Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Window Stacking Order Issue #230

Merged

Conversation

takahirom
Copy link
Owner

@takahirom takahirom commented Dec 19, 2023

Enhanced window layering in screenshot functionality: Windows are now sorted by type for consistent layering, ensuring dialogs and other important windows are captured correctly.

Copy link

Snapshot diff report

File name Image
com.github.takahirom
.roborazzi.sample.Wi
ndowCaptureTest.dump
_compare.png

@takahirom takahirom changed the title Fix order of windows by window type Improve Window Layering by Sorting Windows by Type Dec 19, 2023
@takahirom takahirom merged commit 606b265 into main Dec 19, 2023
4 checks passed
@takahirom takahirom deleted the takahirom/fix-order-of-windows-by-window-type/2023-12-19 branch December 19, 2023 13:54
@takahirom takahirom changed the title Improve Window Layering by Sorting Windows by Type Fix Window Stacking Order Issue Dec 19, 2023
github-merge-queue bot referenced this pull request in slackhq/circuit Jan 27, 2024
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
|
[io.github.takahirom.roborazzi](https://togithub.com/takahirom/roborazzi)
| plugin | minor | `1.8.0` -> `1.9.0` |
|
[io.github.takahirom.roborazzi:roborazzi-junit-rule](https://togithub.com/takahirom/roborazzi)
| dependencies | minor | `1.8.0` -> `1.9.0` |
|
[io.github.takahirom.roborazzi:roborazzi-compose](https://togithub.com/takahirom/roborazzi)
| dependencies | minor | `1.8.0` -> `1.9.0` |
|
[io.github.takahirom.roborazzi:roborazzi](https://togithub.com/takahirom/roborazzi)
| dependencies | minor | `1.8.0` -> `1.9.0` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

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

###
[`v1.9.0`](https://togithub.com/takahirom/roborazzi/releases/tag/1.9.0)

[Compare
Source](https://togithub.com/takahirom/roborazzi/compare/1.8.0...1.9.0)

##### Announcement: Simplified Release Strategy for Roborazzi

We're making some changes to our release strategy to enhance your
experience. Moving forward, we will be streamlining our versioning
system. **Instead of maintaining separate `alpha/rc/stable` versions, we
will integrate experimental features directly into stable releases,
marked with clear experimental annotations**. This approach aims to
simplify updates and improve clarity while ensuring you still have
access to the latest features and improvements.

We value your input and experience. If you have any thoughts or feedback
on this change, please feel free to share them with us on [GitHub Issue
#&#8203;243](https://togithub.com/takahirom/roborazzi/issues/243).

##### New Experimental Features

-   **Introduction of `captureScreenRoboImage()` Function:**
This function executes screenshot tests that include dialogs on the
screen, offering an alternative to the conventional use of Espresso's
ViewInteraction or Compose Test's SemanticsNodeInteraction
captureRoboImage(). Thank you,
[@&#8203;nelletto](https://togithub.com/nelletto), for bringing this
issue with dialog screenshots to our attention.

    *Before:*

    ```kotlin
    onRoot().captureRoboImage()
    onView(isRoot()).captureRoboImage()
    ```

    *After:*

    ```kotlin
    captureScreenRoboImage()
    ```

<img width="384" alt="image"
src="https://github.com/takahirom/roborazzi/assets/1386930/84428e4b-c7b5-40ef-9900-fccc6d4fee52">

-   **RoborazziTaskType Property:**
I developed Roborazzi to facilitate layout viewing during UI tests,
addressing the limitations in Robolectric's layout visibility.
Initially, Roborazzi couldn't support just viewing layouts during the
verification task (roborazziVerifyDebug). Hence, I've introduced a
feature allowing task type alteration during test executions.

    ```kotlin
    onView(ViewMatchers.isRoot())
      .captureRoboImage(
        roborazziOptions = RoborazziOptions(
taskType =
roborazziSystemPropertyTaskType().convertVerifyingToComparing()
        )
      )
    ```

##### Behavior Changes

-   Adjustments for Upcoming Robolectric Shadow Rendering Support:
While Robolectric is in the process of introducing technical support for
shadow rendering, Roborazzi is adapting its screenshot capture method
accordingly. We're shifting towards using the PixelCopy class more
extensively instead of relying solely on the View draw method. If you
notice any issues with this change, please report them to us. Thank you,
[@&#8203;sergio-sastre](https://togithub.com/sergio-sastre), for
highlighting the advantages of using PixelCopy.

##### Bug Fixes

-   **Fixed Potential Memory Leak:**
Addressed a memory leak issue occurring when using `compose
captureRoboImage{}` multiple times within a single test. (Thanks for
reporting this [@&#8203;vetoketju](https://togithub.com/vetoketju) )
-   **Resolved File Path Duplication:**
Corrected an issue where not specifying a file path with
`relativePathFromRoborazziContextOutputDirectory` resulted in duplicated
file paths, like
`build/output/roborazzi/build/output/roborazzi/xxxx.png`.
- Fixed a bug in window ordering for screenshots: Windows are now
accurately layered by type for more reliable and consistent screenshot
results.
- Fixed the issue where captureScreenRoboImage() failed to capture
Material3 Compose dialogs and bottom sheets.
[@&#8203;marianeum](https://togithub.com/marianeum) Thank you for
reporting this issue!
- Resolved the issue causing comparison images to enlarge when using the
scale option.

##### Others

-   **Documentation Enhancement:**
Added comprehensive documentation using Writerside, a documentation tool
from JetBrains.
    [Roborazzi Documentation](https://takahirom.github.io/roborazzi)
Thank you,
[@&#8203;timothyfroehlich](https://togithub.com/timothyfroehlich),
[@&#8203;sergio-sastre](https://togithub.com/sergio-sastre), and
[@&#8203;ZacSweers](https://togithub.com/ZacSweers), for your
suggestions regarding documentation tools.

- Thanks to [@&#8203;itochan](https://togithub.com/itochan)'s
contribution, Roborazzi has moved to a version catalog, reduced unwanted
dependencies and organized

-   Enhanced performance.

- Fix Bug Causing Comparison Image to Enlarge and Enhance Performance by
Avoiding Creation of Unnecessary Canvases

- Use ComposeTestRule interface instead of concrete
AndroidComposeTestRule class by
[@&#8203;GisoBartels](https://togithub.com/GisoBartels) in
[https://github.com/takahirom/roborazzi/pull/241](https://togithub.com/takahirom/roborazzi/pull/241)

-   Pass the default output directory setting from Gradle

##### What's Changed

- Fix the issue of the file path being duplicated by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/214](https://togithub.com/takahirom/roborazzi/pull/214)
- \[docs]Add Roborazzi documentation using Writerside by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/216](https://togithub.com/takahirom/roborazzi/pull/216)
- \[docs]Fix path of document by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/217](https://togithub.com/takahirom/roborazzi/pull/217)
- \[docs]Fix writerside errors by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/218](https://togithub.com/takahirom/roborazzi/pull/218)
- \[docs]Fix markdown issue by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/219](https://togithub.com/takahirom/roborazzi/pull/219)
- \[docs]Fix docs ARTIFACT name by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/220](https://togithub.com/takahirom/roborazzi/pull/220)
- \[docs]Add product-web-url to buildprofiles.xml by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/221](https://togithub.com/takahirom/roborazzi/pull/221)
- \[docs]Tweak docs by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/222](https://togithub.com/takahirom/roborazzi/pull/222)
- \[docs]Add template by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/223](https://togithub.com/takahirom/roborazzi/pull/223)
- Add RoborazziTaskType property to RoborazziOptions by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/211](https://togithub.com/takahirom/roborazzi/pull/211)
- Add captureScreenRoboImage for capturing screen images, including
dialogs by [@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/225](https://togithub.com/takahirom/roborazzi/pull/225)
- \[docs]Fix document tag by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/226](https://togithub.com/takahirom/roborazzi/pull/226)
- Add activityScenario.close() to prevent activity leak by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/228](https://togithub.com/takahirom/roborazzi/pull/228)
- Fix Window Stacking Order Issue by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/230](https://togithub.com/takahirom/roborazzi/pull/230)
- Migrate to version catalog by
[@&#8203;itochan](https://togithub.com/itochan) in
[https://github.com/takahirom/roborazzi/pull/231](https://togithub.com/takahirom/roborazzi/pull/231)
- Update dropbox differ and remove bom dependency and remove unneeded
junit dependency by [@&#8203;takahirom](https://togithub.com/takahirom)
in
[https://github.com/takahirom/roborazzi/pull/234](https://togithub.com/takahirom/roborazzi/pull/234)
- Update the org.json library to patch the vulnerability by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/235](https://togithub.com/takahirom/roborazzi/pull/235)
- Fix CaptureResultTest and Add plan test workflow by
[@&#8203;momomomo111](https://togithub.com/momomomo111) in
[https://github.com/takahirom/roborazzi/pull/238](https://togithub.com/takahirom/roborazzi/pull/238)
- Use View draw method to capture for Compose Material3 by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/237](https://togithub.com/takahirom/roborazzi/pull/237)
- Fix Bug Causing Comparison Image to Enlarge and Enhance Performance by
Avoiding Creation of Unnecessary Canvases by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/239](https://togithub.com/takahirom/roborazzi/pull/239)
- Use ComposeTestRule interface instead of concrete
AndroidComposeTestRule class by
[@&#8203;GisoBartels](https://togithub.com/GisoBartels) in
[https://github.com/takahirom/roborazzi/pull/241](https://togithub.com/takahirom/roborazzi/pull/241)
- Pass the default output directory setting from Gradle by
[@&#8203;takahirom](https://togithub.com/takahirom) in
[https://github.com/takahirom/roborazzi/pull/249](https://togithub.com/takahirom/roborazzi/pull/249)

##### New Contributors

- [@&#8203;itochan](https://togithub.com/itochan) made their first
contribution in
[https://github.com/takahirom/roborazzi/pull/231](https://togithub.com/takahirom/roborazzi/pull/231)
- [@&#8203;momomomo111](https://togithub.com/momomomo111) made their
first contribution in
[https://github.com/takahirom/roborazzi/pull/238](https://togithub.com/takahirom/roborazzi/pull/238)
- [@&#8203;GisoBartels](https://togithub.com/GisoBartels) made their
first contribution in
[https://github.com/takahirom/roborazzi/pull/241](https://togithub.com/takahirom/roborazzi/pull/241)

**Full Changelog**:
takahirom/roborazzi@1.8.0...1.9.0

</details>

---

### Configuration

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

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR becomes conflicted, 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://togithub.com/renovatebot/renovate).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4xNTMuMSIsInVwZGF0ZWRJblZlciI6IjM3LjE1My4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiJ9-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant