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

AccessibilityRenderExtension doesn't work correctly with RenderingMode.SHRINK #1350

Open
VirtualParticle opened this issue Mar 20, 2024 · 3 comments · May be fixed by #1355
Open

AccessibilityRenderExtension doesn't work correctly with RenderingMode.SHRINK #1350

VirtualParticle opened this issue Mar 20, 2024 · 3 comments · May be fixed by #1355
Assignees
Labels
bug Something isn't working
Milestone

Comments

@VirtualParticle
Copy link

Description
Using the AccessibilityRenderExtension is useful for analyzing accessibility information, but the information added to the side of the screenshot is cropped out when the SHRINK rendering mode is used.

Steps to Reproduce
Here is an example test:

class ExampleTest {

    @get:Rule
    val paparazzi = Paparazzi(
        renderingMode = RenderingMode.SHRINK,
        renderExtensions = setOf(AccessibilityRenderExtension()),
    )

    @Test
    fun exampleTest() {
        paparazzi.snapshot {
            Box(
                modifier = Modifier
                    .background(Color.White)
                    .padding(16.dp)
            ) {
                Text(text = "Hello, world!")
            }
        }
    }

}

Expected behavior
I would expect for the accessibility information on the side of the screenshot to be included in the cropped screenshot, that is to say that the crop would take into account the size of the accessibility information, even if it was taller than the actual content.

Additional information:

  • Paparazzi Version: 1.3.3
  • OS: MacOS
  • Compile SDK: 34
  • Gradle Version: 8.6
  • Android Gradle Plugin Version: 8.3.0

Screenshots
Screenshot using SHRINK:
image

Screenshot using NORMAL:
image

I've given fixing this a look and it seems like one of the challenges here is that the accessibility information is a canvas element which can't easily use things like WRAP_CONTENT.

@VirtualParticle VirtualParticle added the bug Something isn't working label Mar 20, 2024
@jrodbx jrodbx added this to the 1.3.4 milestone Mar 22, 2024
@MedetZhakupov
Copy link

Is it considered blocker for the release 1.3.4 @adamalyyan ?

@adamalyyan
Copy link
Collaborator

I don't think this would be considered a blocker but I'll defer to @geoff-powell as his PR will resolve this!

@geoff-powell
Copy link
Collaborator

Ya I think this might not make 1.3.4. Need to figure out a better way to render accessibility information in a layout so we can correctly measure the details view.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants